Posts

Showing posts with the label ansible-pull

Ansible 5: Commands and their examples

Image
Hello Automation specialists, This post is for trying all the Ansible Command-line tools,  it's like a cheat sheet for ansible CLI with executed examples to better understand their usage. Ansible command-line utilities can be executed only on the box where the Ansible engine is installed and running. ansible  ansible command is used for define and run a single task 'playbook' against a set of hosts. ansible command is an extra-simple tool/framework/API for doing 'remote operations'.   Case 1: ansible -i inventory.yml all --list-hosts # all ansible -i inventory.yml dbserver --list-hosts #Specific group ansible -i inventory.yml common --list-hosts # same as all if inventory is yml Listing host using ansible command Case 2: # inventory set in the ansible.cfg ansible all --list-hosts # a group specific ansible web --list-hosts # checking for a specific host in a group ansible web --list-hosts -l 192.168.33.22...