Add flutter

This commit is contained in:
Przemek Grondek 2023-08-20 14:14:45 +02:00
parent 039ebe3bac
commit 006e82979d
4 changed files with 61 additions and 2 deletions

View File

@ -1,7 +1,7 @@
---
- hosts: localhost
roles:
- ubuntu
# - ubuntu
# - dwm
# - firefox
# - docker
@ -18,5 +18,6 @@
# - chromium
# - terraform
# - no-snap
- flutter
vars:
desktop_src_dir: {{ ansible_user_dir }}/src/desktop
desktop_src_dir: "{{ ansible_user_dir }}/src/desktop"

View File

@ -0,0 +1,46 @@
- name: install jmespath for json_query
become: yes
apt:
update_cache: yes
pkg:
- python3-jmespath
- name: Create temp dir
file:
path: "{{ tmp_dir }}"
state: directory
- name: "Flutter"
become: yes
unarchive:
src: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_{{ version }}-stable.tar.xz"
dest: "{{ tmp_dir }}"
remote_src: yes
- name: get folder name
shell: ls "{{ tmp_dir }}"
register: dir_name
- name: Copy to final directory
become: yes
command: "cp -ra {{ tmp_dir }}/{{ dir_name.stdout }} {{ flutter_dir }}"
- name: Remove temp directory
become: yes
file:
path: "{{ tmp_dir }}"
state: absent
- name: Create symbolic link for flutter
become: yes
file:
src: "/opt/flutter/bin/flutter"
dest: "/usr/local/bin/flutter"
state: link
- name: Create symbolic link for dart
become: yes
file:
src: "/opt/flutter/bin/dart"
dest: "/usr/local/bin/dart"
state: link

View File

@ -0,0 +1,8 @@
- name: Check if old version exists
stat:
path: "{{ flutter_dir }}"
register: flutter_dir_status
- import_tasks: install.yml
when:
- not flutter_dir_status.stat.exists

View File

@ -0,0 +1,4 @@
---
tmp_dir: /tmp/flutter
flutter_dir: /opt/flutter
version: 3.13.0