Skip to content

Instantly share code, notes, and snippets.

View realtebo's full-sized avatar
💭
I may be slow to respond.

Mirko Tebaldi realtebo

💭
I may be slow to respond.
  • Somewhere over the raimbow
  • Ferrara, Italy
View GitHub Profile
@realtebo
realtebo / First steps with ansible.md
Last active August 8, 2018 16:15
Starting with ansible

For the file group_vars/windows/main.yml I suggest to use ansible vault

@realtebo
realtebo / ansible_vault.md
Last active November 3, 2020 00:28
How to use encrypted vault files for storing sensitive da ta and NOT enter a password every time :)

How to use the vault with ansible

Prerequisites

pip install cryptography

Create the file

The EDITOR const is optional, but I use to show how to force the use of an editor instead of another.

@realtebo
realtebo / hosts
Created August 7, 2018 20:25
/etc/ansible/hosts
[local]
localhost ansible_connection=local
[windows:vars]
ansible_winrm_scheme=http
ansible_connection=winrm
@realtebo
realtebo / install_ansible.sh
Last active March 31, 2020 22:24
Install ansible on a Ubuntu 18.04 Server
#!/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"
@realtebo
realtebo / configure_for_ansible_winrm.ps1
Last active August 10, 2020 03:28
Configure the local Windows 10 machine for be controlled remotely from ansible
##############################################################################################################
# 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.
##############################################################################################################