ansible-desktop/roles/dev-flutter/tasks/install-flutter.yml

44 lines
1012 B
YAML
Raw Normal View History

2023-08-20 12:14:45 +00:00
- name: Create temp dir
file:
path: "{{ tmp_dir }}"
state: directory
2023-08-20 13:45:22 +00:00
- name: "Install Flutter"
2023-08-20 12:14:45 +00:00
become: yes
unarchive:
2023-08-20 13:45:22 +00:00
src: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_{{ flutter.version }}-stable.tar.xz"
2023-08-20 12:14:45 +00:00
dest: "{{ tmp_dir }}"
remote_src: yes
- name: get folder name
shell: ls "{{ tmp_dir }}"
register: dir_name
- name: Copy to final directory
become: yes
2023-08-20 13:45:22 +00:00
command: "cp -ra {{ tmp_dir }}/{{ dir_name.stdout }} {{ flutter.dir }}"
2023-08-20 12:14:45 +00:00
- name: Remove temp directory
become: yes
file:
path: "{{ tmp_dir }}"
state: absent
- name: Create symbolic link for flutter
become: yes
file:
2023-08-20 13:45:22 +00:00
src: "{{ flutter.dir }}/bin/flutter"
2023-08-20 12:14:45 +00:00
dest: "/usr/local/bin/flutter"
state: link
- name: Create symbolic link for dart
become: yes
file:
2023-08-20 13:45:22 +00:00
src: "{{ flutter.dir }}/bin/dart"
2023-08-20 12:14:45 +00:00
dest: "/usr/local/bin/dart"
state: link
- name: Set flutter android sdk dir
shell:
cmd: flutter config --android-sdk {{ android.dir }}