For the file group_vars/windows/main.yml
I suggest to use ansible vault
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[local] | |
localhost ansible_connection=local | |
[windows:vars] | |
ansible_winrm_scheme=http | |
ansible_connection=winrm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download and run | |
# curl https://gist.githubusercontent.com/realtebo/3451070eba5a55186afb686d1690abd2/raw/install_ansible.sh?_=$(date +%s) | bash | |
sudo apt-get update && sudo apt-get install software-properties-common -y | |
sudo apt-add-repository universe -y | |
sudo apt-add-repository ppa:ansible/ansible -y | |
sudo apt-get update && sudo apt-get install ansible python-pip -y | |
pip install "pywinrm>=0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################################## | |
# https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html#upgrading-powershell-and-net-framework | |
# | |
# The username and password parameters are stored in plain text in the registry. Make sure the Remove-Item | |
# commands are run, check them after the script finishes to ensure no credentials are still stored on the host. | |
# | |
# The ConfigureRemotingForAnsible.ps1 script is intended for training and development purposes only and | |
# should not be used in a production environment, since it enables settings (like Basic authentication) | |
# that can be inherently insecure. | |
############################################################################################################## |
NewerOlder