ansible-desktop/roles/flutter/tasks/install.yml
2023-08-20 14:14:45 +02:00

47 lines
1002 B
YAML

- 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