Install chocolatey
This commit is contained in:
parent
6fee48aa48
commit
5322f83dfb
1 changed files with 19 additions and 0 deletions
19
tasks/main.yml
Normal file
19
tasks/main.yml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
---
|
||||||
|
- name: 'Install chocolatey'
|
||||||
|
block:
|
||||||
|
- name: try to install using ansible
|
||||||
|
chocolatey.chocolatey.win_chocolatey:
|
||||||
|
name: chocolatey
|
||||||
|
state: present
|
||||||
|
register: _choco
|
||||||
|
until: _choco is succeeded
|
||||||
|
retries: 4
|
||||||
|
delay: 2
|
||||||
|
rescue:
|
||||||
|
- name: Install choco using powershell
|
||||||
|
ansible.windows.win_powershell:
|
||||||
|
script: |
|
||||||
|
rm -rf C:\ProgramData\chocolatey;
|
||||||
|
Set-ExecutionPolicy Bypass -Scope Process -Force;
|
||||||
|
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
|
||||||
|
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
|
Loading…
Reference in a new issue