Skip to content

Commit

Permalink
fix(falcon_install): use win_stat to expand %SYSTEMROOT% properly
Browse files Browse the repository at this point in the history
windows sucks... nuff said :(
  • Loading branch information
carlosmmatos committed Oct 22, 2024
1 parent 1bdbbb8 commit be99b1c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion roles/falcon_install/tasks/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
- name: CrowdStrike Falcon | Copy Sensor Installation Package to remote host (windows)
ansible.windows.win_copy:
src: "{{ falcon_sensor_download.path }}"
dest: "{{ falcon_windows_tmp_dir }}"
dest: "{{ falcon_windows_tmp_dir_stat.stat.path }}"
changed_when: false
register: win_falcon_sensor_copied
when: ansible_os_family == "Windows"
Expand Down
8 changes: 8 additions & 0 deletions roles/falcon_install/tasks/preinstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
- ansible_facts['os_family'] == "Windows"
changed_when: no

- name: CrowdStrike Falcon | Validate Temporary install directory (Windows)
ansible.windows.win_stat:
path: "{{ falcon_windows_tmp_dir }}"
when:
- ansible_facts['os_family'] == "Windows"
register: falcon_windows_tmp_dir_stat
failed_when: false

- name: CrowdStrike Falcon | Verify Falcon is not already installed (macOS)
ansible.builtin.stat:
path: "{{ falcon_path }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/falcon_install/tasks/win_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

- name: CrowdStrike Falcon | Remove tmp install directory (Windows)
ansible.windows.win_file:
path: "{{ falcon_windows_tmp_dir }}"
path: "{{ falcon_windows_tmp_dir_stat.stat.path }}"
state: absent
changed_when: no
4 changes: 2 additions & 2 deletions roles/falcon_install/tasks/win_url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
- name: CrowdStrike Falcon | Downloading Installation Package from URL (Windows)
ansible.windows.win_get_url:
url: "{{ falcon_download_url }}"
dest: "{{ falcon_windows_tmp_dir }}"
dest: "{{ falcon_windows_tmp_dir_stat.stat.path }}"
url_username: "{{ falcon_download_url_username | default(omit) }}"
url_password: "{{ falcon_download_url_password | default(omit) }}"
when:
- falcon_download_url
- falcon_windows_tmp_dir
- falcon_windows_tmp_dir_stat.stat.path
register: falcon_sensor_download
retries: "{{ falcon_retries }}"
delay: "{{ falcon_delay }}"
Expand Down

0 comments on commit be99b1c

Please sign in to comment.