Ansible

Ansible 101

Why Ansible

Automate the repetitive tasks involve:

  • provisioning

  • configuration

  • CD

  • application deployment

  • security compliance

Concept

Control node

Managed node

Inventory

Commands

Install
# clone a repo to local machine
python3 -m pip installl --user ansible

# create an inventory by adding the IP address or FQDN to
# /etc/ansible/hosts
[myvirtualmachines]
192.0.2.50
192.0.2.51
192.0.2.52

# verify the hosts in inventory
ansible all --list-hosts
Connection
# ssh connection
ssh username@192.0.2.50

# ping the managed nodes
ansible all -m ping

Advanced Ansible

Last updated