Top "Ansible-inventory" questions

Use this tag for questions regarding the Ansible inventory defined either as a static file (aka hosts file), or dynamically through external scripts (for example AWS EC2 inventory).

Reload Ansible's dynamic inventory

I'm using Ansible to setup EC2 instances and deploy an app. There's a hosts script which gathers tags related servers …

ansible ansible-inventory
Ansible get hostname as defined in inventory

In my inventory I define hosts like this: [server1] 141.151.176.223 I am looking for a variable which keeps the server1 name, …

ansible hostname ansible-inventory
Ansible: How to declare global variable within playbook?

How can I declare global variable within Ansible playbook. I have searched in google and found the below solution, but …

ansible ansible-inventory
List all ansible hosts from inventory file for a task

For a backup I need to iterate over all hosts in my inventory file to be sure that the backup …

ansible ansible-playbook ansible-inventory
How Exactly Does Ansible Parse Boolean Variables?

In Ansible, there are several places where variables can be defined: in the inventory, in a playbook, in variable files, …

boolean ansible yaml ansible-inventory
How do you get group name of the executing role in ansible

I have a use case where I need to create a directory in all hosts in a group whose name …

ansible ansible-inventory
How to prompt user for a target host in Ansible?

I want to write a bootstrapper playbook for new machines in Ansible which will reconfigure the network settings. At the …

ansible ansible-inventory
ansible returns with "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6))

I am running myserver in ubuntu: + sudo cat /etc/os-release NAME="Ubuntu" VERSION="16.04.6 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=…

ansible ansible-2.x ansible-inventory ansible-facts
Run Ansible playbook without inventory

Consider if I want to check something quickly. Something that doesn't really need connecting to a host (to check how …

ansible ansible-inventory
How to define hash (dict) in ansible inventory file?

I am able to define a hash(dict) like below in group_vars/all: region_subnet_matrix: site1: region: "{{ aws_…

ansible ansible-inventory