ansible-inventory Questions
3
Solved
I want to run a playbook containing some roles on multiple host groups I create dynamically with the group_by module.
I'm able to do it like the example below (ping replacing my actual role).
I w...
Earthworm asked 20/6, 2017 at 11:30
2
Solved
How can I pass a relative path so that Ansible can copy files from node/keys and copy them to a server?
The playbook is ansible/playbook.
My directory structure is:
├── ansible
│ ├── inventory
│ ...
Otter asked 11/9, 2019 at 11:37
7
I have a dummy doubt that keeps me stuck for a long time. I have a very banal inventory file with hosts and variables:
[lb]
10.112.84.122
[tomcat]
10.112.84.124
[jboss5]
10.112.84.122
...
[tes...
Police asked 20/2, 2014 at 12:51
6
Solved
I am trying to get started with Ansible to provision my Vagrantbox, but I can’t figure out how to deal with host files.
According to the documentation the should be storred in /etc/ansible/hosts, ...
Rhu asked 22/2, 2014 at 18:42
1
I am trying to find whether particular director exists in ansible, if not, create the one..The problem i am facing here is that the below code should not create a /var/tmp/directory, but it creates...
Sextuplicate asked 15/6, 2020 at 16:22
1
I have a dynamic ansible inventory which uses the aws_ec2 module. It works quite well, generally. However, there is one issue. I've tried several times to create groups using the 'groups:' keyword,...
Deen asked 31/5, 2020 at 2:13
2
We have a set of servers shared between different instances of an application and would like the list of them to be a separate file, with other -- instance-specific inventories -- including it.
(I...
Alga asked 31/10, 2019 at 22:29
1
Solved
I am new to Ansible and I am trying to create an Ansible Playbook, which makes a backup of directories from different hosts to the control server (which is the same machine where Ansible is invoked...
Proselytize asked 27/10, 2019 at 17:2
1
I have defined the nginx_upstreams variable in a different role that in turn uses the geerlingguy.nginx role and I have also specified the "name", "strategy" and the "servers", but when I run this ...
Foremast asked 2/8, 2019 at 21:3
1
Solved
I'm trying to run my Ansible playbook on a remote server using a provided ssh key.
I have added the following configuration to my inventory file:
all:
hosts:
server1:
ansible_host: [email...
Radloff asked 13/9, 2019 at 7:44
2
Solved
Ansible AWX requires inventories to be entered in yaml or json format.
When you start learning ansible, you may take the choice to start off with your inventory in ini format.
https://docs.ansibl...
Seljuk asked 30/8, 2019 at 13:5
2
Solved
I am having a playbook with two different plays
Sample.yml
- name : Play1
hosts: Host1
tasks:
...
- name: Play2
hosts: Host2
tasks:
...
I need to run this playbook with two different ho...
Darice asked 27/2, 2019 at 11:27
3
Solved
I'm creating a playbook with this play:
On hosts hypervisors:
retrieve list of virtual machines from all hosts
use module add_host to add all of them in a new inventory group called guests
My ...
Mattress asked 8/2, 2017 at 6:52
6
Solved
In Ansible 2.1, I have a role being called by a playbook that needs access to a host file variable. Any thoughts on how to access it?
I am trying to access the ansible_ssh_host in the test1 section...
Gerik asked 13/10, 2016 at 17:56
1
i have 500+ target servers that have a ansible compatible python version 2.7
installed at different locations like shown below.
/usr/bin/python /opt/apps/xerto/tools/ansible/bin/python2.7
/opt/atl...
Mayfield asked 6/2, 2019 at 22:20
2
Solved
I have a host file that looks roughly like this:
[kibanamaster]
efk host_ip host user passwd
[elasticnode]
esnode host_ip user passwd
and I am trying something in the style of
- name: get ip a...
Galliwasp asked 6/6, 2017 at 12:10
1
Solved
Introduction
For over a month I've been running the following command:
ansible-playbook -vvvvi host_test rhel-tests.yml
Which connected via SSH and ran tests on a host successfully without a...
Acotyledon asked 3/8, 2018 at 15:26
3
Solved
In the best practices page, there is an example that uses hosts.yml for hosts files:
In the docs, however, I can only find the INI syntax for writing hosts files.
What is the syntax for the inv...
Esperanzaespial asked 12/12, 2016 at 5:50
1
Considering the following Ansible hosts file:
[webservers]
server1.example.com ansible_ssh_pass=1234567
server2.example.com ansible_ssh_pass=2345678
server3.example.com ansible_ssh_pass=3456789
...
Lucretialucretius asked 21/6, 2018 at 17:3
1
Solved
In Ansible 2.4.2.0, can I override the SSH key set in inventory with ansible_ssh_private_key_file on command line? It is not possible with --private-key option as reported on this issue: Command-li...
Extenuate asked 25/5, 2018 at 9:54
1
I have a use case where I need to create a directory in all hosts in a group whose name will be the name of the group.
Eg :
I create a dynamic inventory file with output of the form :
{
"d...
Sophisticated asked 20/3, 2018 at 17:21
2
Solved
In my inventory I define hosts like this:
[server1]
141.151.176.223
I am looking for a variable which keeps the server1 name, as I am using it to define server hostname.
inventory_hostname is...
Mallorca asked 21/1, 2018 at 14:13
1
Solved
I have the next snippet in my role template:
upstream portal {
{% set nodes = groups["my_dev_cluster"] %}
{% for node in nodes %}
...do something with nodes...
{% endfor %}
}
And it works we...
Stereochrome asked 7/12, 2017 at 15:16
1
So from what I gather, we can use ansible.cfg to set the default inventory file that ansible looks for when running a playbook.
We can also override that inventory by using the -i parameter when r...
Gonion asked 6/12, 2017 at 19:20
2
I'm trying to write a simple Ansible Playbook, please look at snippets below. Using Ansible 2.4.0.0, Ubuntu 17.04, Python 2.7.13.
This is my first time using Ansible and Playbooks so please don't b...
Hollah asked 10/10, 2017 at 14:22
© 2022 - 2024 — McMap. All rights reserved.