Обновить playbooks/install_software_win.yml

This commit is contained in:
ogrechko committed 2026-10-02 12:12:57 +03:00
1 parent 56c73827e9
commit 3a09e9373b
1 file changed
+13 -3
+13 -3
View File
@@ -23,7 +23,7 @@
unc_file: "{{ smb_path | regex_replace('\\\\+$', '') }}\\{{ installer_file }}" unc_file: "{{ smb_path | regex_replace('\\\\+$', '') }}\\{{ installer_file }}"
tasks: tasks:
- name: Check installer on share and list folder - name: Check installer on share and list folder
ansible.windows.win_powershell: ansible.windows.win_powershell:
parameters: parameters:
Share: "{{ smb_path }}" Share: "{{ smb_path }}"
@@ -49,7 +49,6 @@
$res.error = $_.Exception.Message $res.error = $_.Exception.Message
} }
$Ansible.Result = $res $Ansible.Result = $res
error_action: continue
register: share_check register: share_check
no_log: true no_log: true
failed_when: false failed_when: false
@@ -68,4 +67,15 @@
else 'Файл ' ~ installer_file ~ ' не найден в ' ~ smb_path }} else 'Файл ' ~ installer_file ~ ' не найден в ' ~ smb_path }}
when: >- when: >-
(share_check.result.error | default('x')) != '' or (share_check.result.error | default('x')) != '' or
not (share_check.result.exists | default(false)) not (share_check.result.exists | default(false))
- name: Install {{ installer_file }}
ansible.windows.win_package:
path: "{{ unc_file }}"
username: "{{ smb_user }}"
password: "{{ smb_pass }}"
state: present
arguments: "{{ installer_args }}"
product_id: "{{ product_id | default(omit) }}"
creates_path: "{{ creates_path | default(omit) }}"
no_log: true