|
7 | 7 | os_type={{ __checkmk_agent_files_mapping[ansible_facts['os_family']] }}&\ |
8 | 8 | agent_type=host_name" |
9 | 9 | validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" |
10 | | - dest: "{{ __checkmk_agent_agent.file.host }}" |
| 10 | + dest: "{{ __checkmk_agent_agent.file.download.host }}" |
11 | 11 | method: GET |
12 | 12 | headers: |
13 | 13 | Authorization: "Bearer {{ checkmk_agent_user }} {{ __checkmk_agent_auth }}" |
|
20 | 20 | # This task may fail, as we fall back to the vanilla agent later |
21 | 21 | failed_when: false |
22 | 22 | changed_when: __checkmk_agent_host_download_state.status_code is defined and __checkmk_agent_host_download_state.status_code == 200 |
23 | | - delegate_to: "{{ checkmk_agent_delegate_download }}" |
| 23 | + delegate_to: "{{ 'localhost' if checkmk_agent_delegate_download else 'inventory_hostname' }}" |
24 | 24 | tags: |
25 | 25 | - download-package |
26 | 26 |
|
|
39 | 39 | folder_name={{ checkmk_agent_folder }}&\ |
40 | 40 | agent_type=generic" |
41 | 41 | validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" |
42 | | - dest: "{{ __checkmk_agent_agent.file.pro }}" |
| 42 | + dest: "{{ __checkmk_agent_agent.file.download.pro }}" |
43 | 43 | method: GET |
44 | 44 | headers: |
45 | 45 | Authorization: "Bearer {{ checkmk_agent_user }} {{ __checkmk_agent_auth }}" |
|
56 | 56 | # This task may fail, as we fall back to the vanilla agent later |
57 | 57 | failed_when: false |
58 | 58 | changed_when: __checkmk_agent_folder_download_state.status_code is defined and __checkmk_agent_folder_download_state.status_code == 200 |
59 | | - delegate_to: "{{ checkmk_agent_delegate_download }}" |
| 59 | + delegate_to: "{{ 'localhost' if checkmk_agent_delegate_download else 'inventory_hostname' }}" |
60 | 60 | tags: |
61 | 61 | - download-package |
62 | 62 |
|
|
71 | 71 | ansible.windows.win_get_url: |
72 | 72 | url: "{{ __checkmk_agent_agent.url.community }}" |
73 | 73 | validate_certs: "{{ checkmk_agent_server_validate_certs | bool }}" |
74 | | - dest: "{{ __checkmk_agent_agent.file.community }}" |
| 74 | + dest: "{{ __checkmk_agent_agent.file.download.community }}" |
75 | 75 | timeout: "{{ checkmk_agent_download_timeout | default(omit) }}" |
76 | 76 | when: | |
77 | 77 | checkmk_agent_edition | lower == "community" |
|
80 | 80 | retries: 3 |
81 | 81 | delay: 10 |
82 | 82 | until: "not __checkmk_agent_vanilla_download_state.failed | bool" |
83 | | - delegate_to: "{{ checkmk_agent_delegate_download }}" |
| 83 | + delegate_to: "{{ 'localhost' if checkmk_agent_delegate_download else 'inventory_hostname' }}" |
84 | 84 | tags: |
85 | 85 | - download-package |
86 | 86 |
|
87 | 87 | - name: "{{ ansible_facts['system'] }}: Transfer host-specific {{ checkmk_agent_edition | upper }} Agent." |
88 | 88 | ansible.windows.win_copy: |
89 | | - src: "{{ __checkmk_agent_agent.file.host }}" |
90 | | - dest: "{{ __checkmk_agent_agent.file.host }}" |
| 89 | + src: "{{ __checkmk_agent_agent.file.download.host }}" |
| 90 | + dest: "{{ __checkmk_agent_agent.file.upload.host }}" |
91 | 91 | when: | |
92 | 92 | checkmk_agent_edition | lower != "community" |
93 | 93 | and checkmk_agent_host_specific | bool |
|
97 | 97 |
|
98 | 98 | - name: "{{ ansible_facts['system'] }}: Transfer folder-specific {{ checkmk_agent_edition | upper }} Agent." |
99 | 99 | ansible.windows.win_copy: |
100 | | - src: "{{ __checkmk_agent_agent.file.pro }}" |
101 | | - dest: "{{ __checkmk_agent_agent.file.pro }}" |
| 100 | + src: "{{ __checkmk_agent_agent.file.download.pro }}" |
| 101 | + dest: "{{ __checkmk_agent_agent.file.upload.pro }}" |
102 | 102 | when: | |
103 | 103 | checkmk_agent_edition | lower != "community" |
104 | 104 | and checkmk_agent_folder_specific | bool |
|
108 | 108 |
|
109 | 109 | - name: "{{ ansible_facts['system'] }}: Transfer Vanilla {{ checkmk_agent_edition | upper }} Agent." |
110 | 110 | ansible.windows.win_copy: |
111 | | - src: "{{ __checkmk_agent_agent.file.community }}" |
112 | | - dest: "{{ __checkmk_agent_agent.file.community }}" |
| 111 | + src: "{{ __checkmk_agent_agent.file.download.community }}" |
| 112 | + dest: "{{ __checkmk_agent_agent.file.upload.community }}" |
113 | 113 | when: | |
114 | 114 | checkmk_agent_delegate_download != inventory_hostname |
115 | 115 | and (checkmk_agent_edition | lower == "community" |
|
0 commit comments