Posts

Showing posts with the label ansible-inventory

Ansible Configuration and inventory

Image
In this post I would like to explain about what I had explored on the Ansible Configuration changes at different scopes. Also see the impact of different parameter customizations related to the ansible host inventories. Working with Ansible Configuration - ansible.cfg  This ansible.cfg file will be available in the default location (ANSIBLE_HOME/ Ansible.cfg) when you install with yum. It is not available when you use pip installation. To get a copy of the ansible.cfg you can see a ' rpmsave ' file in the default ANSIBLE_HOME location /etc/ansible. The ANSIBLE_HOME can be changed as per the requirements we can defined in the configuration file. Ansible inventory   Learning about the inventory setup for Ansible controller, first it will look into the ansible.cfg about where is the inventory location defined. If no line mentioned in the configuration file then default inventory location will be used as  /etc/ansible/...

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...