flutter, ensure permissions are correct for pub -cache folder.

This commit is contained in:
me committed 2026-11-10 19:22:47 -07:00
1 parent aa9ccbfd54
commit 3bc2185962
1 file changed
+108 -101
+108 -101
View File
@@ -46,116 +46,123 @@
get_mime: false get_mime: false
register: flutter_download_stat register: flutter_download_stat
## Packages ## - name: Workstation | Linux | Software | Flutter | Install Block
- name: Workstation | Linux | Software | Flutter | Necessities
ansible.builtin.package:
name:
- curl
- git
- unzip
- "{{ xz }}"
- zip
- "{{ mesa }}"
- "{{ mesa_utils }}"
state: present
when: coding
# https://docs.flutter.dev/get-started/install/linux/desktop
- name: Workstation | Linux | Software | Flutter | Linux App Dependencies
ansible.builtin.package:
name:
- clang
- cmake
- git
- "{{ ninja }}"
- pkg-config
- "{{ gtk3 }}"
- "{{ xz_libs }}"
- "{{ cpp }}"
state: present
when: coding
# https://docs.flutter.dev/get-started/install/linux/android
- name: Workstation | Linux | Software | Flutter | Android App Dependencies
ansible.builtin.package:
name:
- "{{ c_libs }}"
- "{{ cpp_libs }}"
- "{{ z_libs }}"
- "{{ bzip }}"
state: present
when: coding
## Install SDK ##
- name: Workstation | Linux | Software | Flutter | SDK
block: block:
- name: Workstation | Linux | Software | Flutter | Download SDK ## Packages ##
ansible.builtin.get_url:
url: "{{ flutter_url }}"
dest: "{{ flutter_download_file }}"
owner: "{{ user }}"
group: "{{ user }}"
mode: '0664'
when: not flutter_download_stat.stat.exists
- name: Workstation | Linux | Software | Flutter | Create Folder - name: Workstation | Linux | Software | Flutter | Necessities
ansible.builtin.package:
name:
- curl
- git
- unzip
- "{{ xz }}"
- zip
- "{{ mesa }}"
- "{{ mesa_utils }}"
state: present
# https://docs.flutter.dev/get-started/install/linux/desktop
- name: Workstation | Linux | Software | Flutter | Linux App Dependencies
ansible.builtin.package:
name:
- clang
- cmake
- git
- "{{ ninja }}"
- pkg-config
- "{{ gtk3 }}"
- "{{ xz_libs }}"
- "{{ cpp }}"
state: present
# https://docs.flutter.dev/get-started/install/linux/android
- name: Workstation | Linux | Software | Flutter | Android App Dependencies
ansible.builtin.package:
name:
- "{{ c_libs }}"
- "{{ cpp_libs }}"
- "{{ z_libs }}"
- "{{ bzip }}"
state: present
## Install SDK ##
- name: Workstation | Linux | Software | Flutter | SDK
block:
- name: Workstation | Linux | Software | Flutter | Pub Cache Permissions
ansible.builtin.file:
path: "{{ user_user.home }}/.pub-cache"
state: directory
owner: "{{ user }}"
group: "{{ user }}"
mode: "0755"
when: user_user.home != ""
- name: Workstation | Linux | Software | Flutter | Download SDK
ansible.builtin.get_url:
url: "{{ flutter_url }}"
dest: "{{ flutter_download_file }}"
owner: "{{ user }}"
group: "{{ user }}"
mode: '0664'
when: not flutter_download_stat.stat.exists
- name: Workstation | Linux | Software | Flutter | Create Folder
ansible.builtin.file:
path: "{{ flutter_sdk_location }}"
state: directory
owner: "{{ user }}"
group: "{{ user }}"
mode: '0755'
- name: Workstation | Linux | Software | Flutter | Extract SDK
ansible.builtin.unarchive:
src: "{{ flutter_download_file }}"
dest: "{{ flutter_sdk_location }}"
owner: "{{ user }}"
group: "{{ user }}"
become: true
become_user: "{{ user }}"
when: not flutter_sdk_stat.stat.exists
- name: Workstation | Linux | Software | Flutter | Delete Archive
ansible.builtin.file: ansible.builtin.file:
path: "{{ flutter_sdk_location }}" path: "{{ flutter_download_file }}"
state: directory state: absent
owner: "{{ user }}"
group: "{{ user }}"
mode: '0755'
- name: Workstation | Linux | Software | Flutter | Extract SDK ## Configure Environment ##
ansible.builtin.unarchive:
src: "{{ flutter_download_file }}"
dest: "{{ flutter_sdk_location }}"
owner: "{{ user }}"
group: "{{ user }}"
become: true - name: Workstation | Linux | Software | Flutter | Modify PATH (profiles)
become_user: "{{ user }}" ansible.builtin.blockinfile:
when: coding path: "{{ user_user.home }}/{{ item }}"
and not flutter_sdk_stat.stat.exists block: |
export FLUTTER_HOME="{{ flutter_home }}"
export PATH="{{ flutter_bin }}:$PATH"
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
state: present
create: true
backup: true
mode: "0755"
loop:
- ".bash_profile"
- ".zprofile"
- ".profile"
when: user_user.home != ""
- name: Workstation | Linux | Software | Flutter | Delete Archive ## Test SDK ##
ansible.builtin.file:
path: "{{ flutter_download_file }}"
state: absent
when: coding
## Configure Environment ## - name: Workstation | Linux | Software | Flutter | Doctor Report
ansible.builtin.shell: "{{ item }}"
loop: "{{ flutter_report_commands }}"
become: true
become_user: "{{ user }}"
register: shell_check
changed_when: shell_check.rc == 0
- name: Workstation | Linux | Software | Flutter | Modify PATH (profiles)
ansible.builtin.blockinfile:
path: "{{ user_user.home }}/{{ item }}"
block: |
export FLUTTER_HOME="{{ flutter_home }}"
export PATH="{{ flutter_bin }}:$PATH"
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
state: present
create: true
backup: true
mode: "0755"
loop:
- ".bash_profile"
- ".zprofile"
- ".profile"
when: coding
and user_user.home != ""
## Test SDK ##
- name: Workstation | Linux | Software | Flutter | Doctor Report
ansible.builtin.shell: "{{ item }}"
loop: "{{ flutter_report_commands }}"
become: true
become_user: "{{ user }}"
register: shell_check
changed_when: shell_check.rc == 0
when: coding when: coding
## Uninstall SDK ## ## Uninstall SDK ##