Support EXE software package ansible module, collected 2:
Win_package (this time use this)
Official Document: Http://docs.ansible.com/ansible/latest/modules/win_package_module.html
Win_chocolatey
Official Document: Http://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html
For example, install the vc2013 (32-bit) package Vcredist_x86.exe:
- Since the Win_package module needs to be product_id, it is necessary to confirm the product_id and find the location:
32-bit program: Hklm:software\wow6432node\microsoft\windows\currentversion\uninstall
64-bit program: Hklm:software\microsoft\windows\currentversion\uninstall
Note: HKLM is the abbreviation for HKEY_LOCAL_MACHINE
Install Vcredist_x86.exe manually to get product_id:
{13a4ee12-23ea-3371-91ee-efb36ddfff3e}
Writing Playbook
[[email protected] ~]# cat vc.yaml---- name: Install vcgather_facts: Falsehosts: alltasks:- name: install vc 2013 win_package: path: D:\upload\vcredist_x86.exe product_id: ‘{13A4EE12-23EA-3371-91EE-EFB36DDFFF3E}‘ arguments: /install /passive /norestart
- Executive Playbook
Ansible-playbook Vc.yaml
Complete
To install a Windows package using Ansible