android, fix everything lint suggested besides the pipefails for single liners.

This commit is contained in:
me
2026-10-05 07:13:36 -07:00
parent 58f8636969
commit 39b949517a
+37 -25
View File
@@ -205,29 +205,29 @@
- name: Workstation | Linux | Software | Android | SDK - name: Workstation | Linux | Software | Android | SDK
block: block:
- name: Workstation | Linux | Software | Android | Download Commandline Tools - name: Workstation | Linux | Software | Android | Download Commandline Tools
get_url: ansible.builtin.get_url:
url: "{{ android_url }}" url: "{{ android_url }}"
dest: "{{ android_download_file }}" dest: "{{ android_download_file }}"
owner: "{{ user }}" owner: "{{ user }}"
group: "{{ user }}" group: "{{ user }}"
mode: '0664' mode: '0664'
when: not android_download_stat.stat.exists when: not android_download_stat.stat.exists
- name: Workstation | Linux | Software | Android | Create Folder - name: Workstation | Linux | Software | Android | Create Folder
ansible.builtin.file: ansible.builtin.file:
path: "{{ android_sdk_cmdline_temp }}" path: "{{ android_sdk_cmdline_temp }}"
state: directory state: directory
owner: "{{ user }}" owner: "{{ user }}"
group: "{{ user }}" group: "{{ user }}"
mode: '0755' mode: '0755'
- name: Workstation | Linux | Software | Android | Extract Tools - name: Workstation | Linux | Software | Android | Extract Tools
unarchive: ansible.builtin.unarchive:
src: "{{ android_download_file }}" src: "{{ android_download_file }}"
dest: "{{ android_sdk_cmdline_temp }}" dest: "{{ android_sdk_cmdline_temp }}"
owner: "{{ user }}" owner: "{{ user }}"
group: "{{ user }}" group: "{{ user }}"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
@@ -251,6 +251,8 @@
- emulator - emulator
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
register: shell_check
changed_when: shell_check.rc == 0
when: coding when: coding
and not android_sdkmanager_check.stat.exists and not android_sdkmanager_check.stat.exists
@@ -345,6 +347,8 @@
ansible.builtin.shell: "{{ android_sdkmanager2_list }} --all > {{ android_report_file }}" ansible.builtin.shell: "{{ android_sdkmanager2_list }} --all > {{ android_report_file }}"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
register: shell_check
changed_when: shell_check.rc == 0
when: coding when: coding
## Flutter and Licenses ## ## Flutter and Licenses ##
@@ -353,18 +357,24 @@
ansible.builtin.shell: "{{ flutter }} config --android-sdk={{ android_sdk_location }}" ansible.builtin.shell: "{{ flutter }} config --android-sdk={{ android_sdk_location }}"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
register: shell_check
changed_when: shell_check.rc == 0
when: coding when: coding
- name: Workstation | Linux | Software | Android | License Agreements [1/2] - name: Workstation | Linux | Software | Android | License Agreements [1/2]
ansible.builtin.shell: "yes | {{ android_sdkmanager_final }} --licenses --sdk_root={{ android_sdk_location }}" ansible.builtin.shell: "yes | {{ android_sdkmanager_final }} --licenses --sdk_root={{ android_sdk_location }}"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
register: shell_check
changed_when: shell_check.rc == 0
when: coding when: coding
- name: Workstation | Linux | Software | Android | License Agreements [2/2] - name: Workstation | Linux | Software | Android | License Agreements [2/2]
ansible.builtin.shell: "yes | {{ flutter }} doctor --android-licenses" ansible.builtin.shell: "yes | {{ flutter }} doctor --android-licenses"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
register: shell_check
changed_when: shell_check.rc == 0
when: coding when: coding
- name: Workstation | Linux | Software | Android | Refresh Flutter Doctor Report - name: Workstation | Linux | Software | Android | Refresh Flutter Doctor Report
@@ -372,6 +382,8 @@
loop: "{{ flutter_report_commands }}" loop: "{{ flutter_report_commands }}"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
register: shell_check
changed_when: shell_check.rc == 0
when: coding when: coding
## Configure Environment ## ## Configure Environment ##
@@ -385,10 +397,10 @@
state: absent state: absent
create: true create: true
backup: true backup: true
mode: "0755"
loop: loop:
- "{{ user_root.home }}" - "{{ user_root.home }}"
- "{{ user_user.home }}" - "{{ user_user.home }}"
ignore_errors: true
when: coding when: coding
and user_root.home != "" and user_root.home != ""
and user_user.home != "" and user_user.home != ""
@@ -402,10 +414,10 @@
state: absent state: absent
create: true create: true
backup: true backup: true
mode: "0755"
loop: loop:
- "{{ user_root.home }}" - "{{ user_root.home }}"
- "{{ user_user.home }}" - "{{ user_user.home }}"
ignore_errors: true
when: coding when: coding
and user_root.home != "" and user_root.home != ""
and user_user.home != "" and user_user.home != ""
@@ -415,16 +427,16 @@
path: "{{ user_user.home }}/{{ item }}" path: "{{ user_user.home }}/{{ item }}"
block: | block: |
export ANDROID_HOME="{{ android_sdk_location }}" export ANDROID_HOME="{{ android_sdk_location }}"
export ANDROID_SDK_ROOT="$ANDROID_HOME" export ANDROID_SDK_ROOT="$ANDROID_HOME"
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}" export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
marker: '# {mark} MANAGED BY ANSIBLE | Android' marker: '# {mark} MANAGED BY ANSIBLE | Android'
state: present state: present
create: true create: true
backup: true backup: true
mode: "0755"
loop: loop:
- ".bash_profile" - ".bash_profile"
- ".zprofile" - ".zprofile"
ignore_errors: true
when: coding when: coding
and user_user.home != "" and user_user.home != ""