Ansible automation demo for Cygate Techdays 2019 by Christofer Tibbelin
default name is hosts in /etc/ansible/
These are DNS names in my case. Can be IP, SSH or Ansible names.
[servers]
server1
server2.mylocal
ansible -i inventory.ini -m ping all
ansible -i inventory.ini -m ping servers
This is called 'facts' in Ansible
ansible -i inventory.ini -m setup all
ansible -i inventory.ini -m setup -a 'gather_subset=!all,!any,network' servers
ansible -i inventory.ini -m setup -a 'filter=ansible_default_ipv4' servers
Demo 3 📖
Building our first playbook instead of console commands