|
10 | 10 | tags:
|
11 | 11 | - onboarding
|
12 | 12 |
|
13 |
| -- name: Extract onboarding package. |
14 |
| - unarchive: |
15 |
| - src: "{{ onboarding_source }}" |
16 |
| - dest: /etc/opt/microsoft/mdatp |
17 |
| - creates: /etc/opt/microsoft/mdatp/MicrosoftDefenderATPOnboardingLinuxServer.py |
18 |
| - mode: 0600 |
19 |
| - owner: root |
20 |
| - group: root |
21 |
| - remote_src: "{{ '://' in onboarding_source }}" |
22 |
| - register: unarchive_out |
23 |
| - ignore_errors: yes |
24 |
| - when: not uninstall |
25 |
| - tags: |
26 |
| - - onboarding |
27 |
| - - molecule-notest |
28 |
| - |
29 |
| -- name: Create licence file |
30 |
| - command: |
31 |
| - cmd: /usr/bin/python3 /etc/opt/microsoft/mdatp/MicrosoftDefenderATPOnboardingLinuxServer.py |
32 |
| - creates: /etc/opt/microsoft/mdatp/mdatp_onboard.json |
| 13 | +- name: Extract and validate the onboarding package. |
| 14 | + block: |
| 15 | + - name: Extract onboarding package. |
| 16 | + unarchive: |
| 17 | + src: "{{ onboarding_source }}" |
| 18 | + dest: /etc/opt/microsoft/mdatp |
| 19 | + creates: /etc/opt/microsoft/mdatp/MicrosoftDefenderATPOnboardingLinuxServer.py |
| 20 | + mode: 0600 |
| 21 | + owner: root |
| 22 | + group: root |
| 23 | + remote_src: "{{ '://' in onboarding_source }}" |
| 24 | + register: unarchive_out |
| 25 | + ignore_errors: yes |
| 26 | + tags: |
| 27 | + - onboarding |
| 28 | + - molecule-notest |
| 29 | + |
| 30 | + - name: Create licence file |
| 31 | + command: |
| 32 | + cmd: /usr/bin/python3 /etc/opt/microsoft/mdatp/MicrosoftDefenderATPOnboardingLinuxServer.py |
| 33 | + creates: /etc/opt/microsoft/mdatp/mdatp_onboard.json |
| 34 | + |
| 35 | + - name: "DEBUG: output from onboarding unzip attempt." |
| 36 | + debug: |
| 37 | + var: unarchive_out |
| 38 | + verbosity: 3 |
| 39 | + when: |
| 40 | + - unarchive_out is defined |
| 41 | + tags: |
| 42 | + - onboarding |
| 43 | + - molecule-notest |
| 44 | + |
| 45 | + - name: Custom error handling for configuration unzip. |
| 46 | + fail: |
| 47 | + msg: "mdatp configuration json did not unzip successfully." |
| 48 | + when: |
| 49 | + - unarchive_out is defined |
| 50 | + - unarchive_out.failed |
| 51 | + - not 'Failed to find handler' in unarchive_out.msg |
| 52 | + tags: |
| 53 | + - onboarding |
| 54 | + - molecule-notest |
| 55 | + |
33 | 56 | when: not uninstall
|
34 |
| - |
35 |
| -- name: "DEBUG: output from onboarding unzip attempt." |
36 |
| - debug: |
37 |
| - var: unarchive_out |
38 |
| - verbosity: 3 |
39 |
| - when: |
40 |
| - - unarchive_out is defined |
41 |
| - - not uninstall |
42 |
| - tags: |
43 |
| - - onboarding |
44 |
| - - molecule-notest |
45 |
| - |
46 |
| -- name: Custom error handling for configuration unzip. |
47 |
| - fail: |
48 |
| - msg: "mdatp configuration json did not unzip successfully." |
49 |
| - when: |
50 |
| - - unarchive_out is defined |
51 |
| - - unarchive_out.failed |
52 |
| - - not 'Failed to find handler' in unarchive_out.msg |
53 |
| - - not uninstall |
54 |
| - tags: |
55 |
| - - onboarding |
56 |
| - - molecule-notest |
0 commit comments