Ansible Ad-Hoc commands

Ad-hoc commands in Ansible allow you to execute simple tasks at the command line against one or all of your hosts. An ad-hoc command consists of two parameters: the host group that defines on what machines to run the task against and the Ansible module to run. These parameters are passed to the ansible binary for invocation. Running ad-hoc commands ping all hosts ansible all -m ping execute the command "uptime" on all hosts ansible all -m shell -a 'uptime' run the command disk usage using the inventory…

Keep reading

Ansible inventory

Inventory is a list of servers that Ansible uses to manage the resources. There are two different type of inventories: Static Manual inventory that we manage. Dynamic The inventory source is imported automatically from cloud providers as EC2, Azure, OpenStack, and more. How to use the inventory file? There are many ways to setup the inventory file on your controller machine. Inventory file location level path note root /etc/ansible/hosts user $USER/.ansible/hosts recommended If you are using a different path, you must to specify the inventory file…

Keep reading

Ansible introduction

Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. Highlights Human readable and simple to understand Agent less Access is done with SSH Large support community Many roles and modules available Host inventory handles and defines the infrastructure Free and Open Source Software (FOSS) Ansible core components Controller Machine The machine where Ansible is installed, responsible for running the provisioning on the servers you are managing.InventoryAn initialization file that contains information about the servers you…

Keep reading