Skip to content

Instantly share code, notes, and snippets.

@ncracker
Last active April 8, 2019 18:04
Show Gist options
  • Save ncracker/b82094ae056c260d277f92eb878c6a97 to your computer and use it in GitHub Desktop.
Save ncracker/b82094ae056c260d277f92eb878c6a97 to your computer and use it in GitHub Desktop.
Setting up Ansible control machine - targets are going to be Windows hosts
#!/bin/bash
# Set up CentOS to act as an Ansible controller
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# ensure CentOS all up-to-date
yum update -y
# epel is to be used for pip
yum install epel-release -y
# install pip via epel repo
yum install python-pip -y
# install Ansible
yum install ansible -y
# Fix for "winrm or requests is not installed" Ansible error
# https://access.redhat.com/solutions/3356681
pip install "pywinrm>=0.2.2"
# datadogpy to be used by the ansible callback plugin
pip install datadog
# install DDatadog Ansible role
ansible-galaxy install Datadog.datadog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment