|
5 | 5 | state: present |
6 | 6 |
|
7 | 7 | - name: Get MAS account status |
8 | | - command: mas account |
| 8 | + command: '"{{ mas_path }}" account' |
9 | 9 | register: mas_account_result |
10 | 10 | failed_when: mas_account_result.rc > 1 |
11 | 11 | check_mode: false |
|
14 | 14 | - ansible_distribution_version is version('12', '<') |
15 | 15 |
|
16 | 16 | - name: Sign in to MAS when email and password are provided. |
17 | | - command: 'mas signin "{{ mas_email }}" "{{ mas_password }}"' |
| 17 | + command: '"{{ mas_path }}" signin "{{ mas_email }}" "{{ mas_password }}"' |
18 | 18 | register: mas_signin_result |
19 | 19 | when: |
20 | 20 | - ansible_distribution_version is version('10.13', '<') |
|
24 | 24 | - not mas_signin_dialog |
25 | 25 |
|
26 | 26 | - name: Sign in to MAS when email is provided, and complete password and 2FA using dialog. |
27 | | - command: 'mas signin "{{ mas_email }}" "{{ mas_password }}" --dialog' |
| 27 | + command: '"{{ mas_path }}" signin "{{ mas_email }}" "{{ mas_password }}" --dialog' |
28 | 28 | register: mas_signin_result |
29 | 29 | when: |
30 | 30 | - ansible_distribution_version is version('10.13', '<') |
|
33 | 33 | - mas_email is truthy |
34 | 34 |
|
35 | 35 | - name: List installed MAS apps. |
36 | | - command: mas list |
| 36 | + command: '"{{ mas_path }}" list' |
37 | 37 | register: mas_list |
38 | 38 | check_mode: false |
39 | 39 | changed_when: false |
40 | 40 |
|
41 | 41 | - name: Ensure unwanted MAS apps are uninstalled. |
42 | | - command: mas uninstall "{{ item.id | default(item) }}" |
| 42 | + command: '"{{ mas_path }}" uninstall "{{ item.id | default(item) }}"' |
43 | 43 | with_items: "{{ mas_uninstalled_apps }}" |
44 | 44 | when: (item.id | default(item) | string) in mas_list.stdout |
45 | 45 |
|
46 | 46 | - name: Ensure configured MAS apps are installed. |
47 | | - command: mas install "{{ item.id | default(item) }}" |
| 47 | + command: '"{{ mas_path }}" install "{{ item.id | default(item) }}"' |
48 | 48 | with_items: "{{ mas_installed_apps + mas_installed_app_ids }}" |
49 | 49 | when: (item.id | default(item) | string) not in mas_list.stdout |
50 | 50 |
|
51 | 51 | - name: Upgrade all apps (if configured). |
52 | | - command: mas upgrade |
| 52 | + command: '"{{ mas_path }}" upgrade' |
53 | 53 | when: mas_upgrade_all_apps |
0 commit comments