sudo su
yum update
yum install -y git
cd /usr/local/src
yum -y install git python-jinja2 python-paramiko PyYAML make MySQL-python
git clone git://github.com/ansible/ansible.git
cd ansible
git submodule update --init --recursive
make install
CTRL + Dsudo echo "[localhost]" > ~/ansible_hosts
sudo echo "localhost ansible_connection=local" >> ~/ansible_hosts
export ANSIBLE_INVENTORY=~/ansible_hostssudo vim /etc/ansible/hosts
[127.0.0.1]
127.0.0.1 ansible_connection=local
[localhost]
127.0.0.1 ansible_connection=localexport AWS_ACCESS_KEY_ID='AK123'
export AWS_SECRET_ACCESS_KEY='abc123'[test.yml]
---
- name: implicit localhost test...
hosts: localhost
tasks:
- debug: msg="hello world" ansible-playbook test.yml
To Force use Ansible 2.0:
git clone git://github.com/ansible/ansible.git cd ansible git checkout -b stable-2.0 origin/stable-2.0 git submodule update --init --recursive sudo make installTo Force use Ansible 2.1:
git clone git://github.com/ansible/ansible.git cd ansible git checkout -b stable-2.1 origin/stable-2.1 git submodule update --init --recursive sudo make installTo Force use Ansible 2.3:
git clone https://github.com/ansible/ansible.git cd ansible git checkout -b stable-2.3 origin/stable-2.3 git submodule update --init --recursive sudo make installTo Force use Ansible 2.4:
git clone https://github.com/ansible/ansible.git cd ansible git checkout -b stable-2.4 origin/stable-2.4 git submodule update --init --recursive sudo make installFor ansible 2.7:
sudo python -m pip install -U pip sudo pip install packaging git clone https://github.com/ansible/ansible.git cd ansible git checkout -b stable-2.7 origin/stable-2.7 git submodule update --init --recursive sudo make install