Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management.

learn more… | top users | synonyms

0
votes
0answers
4 views

How to use variables inside hostvars lookups in Ansible?

I'm using Ansible and dynamic inventory to provision servers in AWS. To initialize a clusterd service I need to lookup the private dns hostnames of other nodes in the cluster based on a variable. ...
1
vote
0answers
8 views

Unable to get module for managing windows system working in ansible

I am learning ansible. My laptop is running Windows 7 and is part of a domain. I have installed Ubuntu linux inside a VM on my laptop and installed Ansible in it, and other python and kerberos ...
0
votes
1answer
15 views

become root when running on specific OS

I want Ansible to become root only if it is running on a specific OS, let's say, Ubuntu. I've tried: become: ansible_os_family == 'Darwin' become: (ansible_os_family == 'Darwin') become: {{ ...
2
votes
0answers
13 views

Passing parameters to ansible callbacks

I have recently been alerted to the existence of ansible callbacks, which appear to be a way to modify some of the defaults under given conditions. However, I have scoured the ansible documentation ...
2
votes
1answer
35 views

How to secure configuration management server

There are many configuration management software options nowadays (Chef, Puppet, CFEngine, Ansible...) which offer an architecture with their repository on a central server and clients communicating ...
0
votes
0answers
29 views

Ansible known_hosts task fails

I'm new with ansible and I created small ansible-playbook, that adds github ssh host key to known_hosts in each server: --- - hosts: all tasks: - name: Add github to ssh known-hosts ...
1
vote
1answer
27 views

error while playing ansible playbook

I just installed ansible on a server in aws and then created a playbook to run the same but while running i am getting error as below : ERROR! 'copy' is not a valid attribute for a Play The error ...
0
votes
0answers
23 views

Which local user accounts should I use for Ansible?

I can't find any official (ansible.com) doc where they suggest which user or class of user to use on the target machines, those machines that are to be managed. I suppose any local user would be OK ...
1
vote
1answer
18 views

Ansible cannot check service status and restart it

I am new in ansible. Now I try to restart my Tomcat service. It looks like ansible cannot detect service status (started/stopped) and cannot (re)start it. Please tell how to do diagnostic? See here ...
0
votes
1answer
23 views

How to create a local fact in Ansible playbook which will skip steps which are already done in previous runs?

I wrote a playbook which clones from git three repo's and compiling them from source. Whenever I provision a machine which uses this playbook, the repos are cloned, no matter if the local copy of the ...
0
votes
1answer
16 views

How can I set an Ansible variable whose value won't be known until after running the playlist?

I'm working on an Ansible script to set up a new TeamCity build agent, and there's one part of the process that I don't know how to automate. After installing a TeamCity build agent, it must be ...
1
vote
2answers
24 views

What is the correct way to export environmental values through ansible playbook?

I wrote an ansible playbook which is supposed to install a tool called kafkacat. Most of the tasks in the playbook work, all but one (the most important one). I'm compiling the tool from source and ...
2
votes
1answer
29 views

Ansible : How to find the route ID connected to a subnet

I have a VPC with some routes and subnets. I want to get ansible to work with it but I can't see a way to link the subnet with the route table ID. I've used the ec2_vpc_route_table_facts, ...
18
votes
2answers
2k views

Will Ansible prevent the execution of 'rm -rf /' in a shell script

This is based upon this hoax question here. The problem described is having a bash script which contains something to the effect of: rm -rf {pattern1}/{pattern2} ...which if both patterns include ...
0
votes
1answer
53 views

Foreman without puppet?

We're a python shop, are using ansible, and are looking at integrating foreman with ansible to tackle bare-metal installs. Is it possible at all to use foreman w/o puppet? I found the documentation ...
1
vote
1answer
19 views

ansible copy over balanced hosts

Ansible question here. I did build a play with a template for a vhost (ssl and non ssl). This vHost will be use in DEV, QUAL and Production server. I have a variable file with variables for each ...
0
votes
1answer
15 views

How to override the previous defined PHP value via Ansible PHP role?

I'm trying to apply override PHP's opcache.max_accelerated_files setting via geerlingguy's Ansible Role for PHP onto geerlingguy/centos6's VM using the following lines (as part of provisioning ...
0
votes
2answers
27 views

ansible git pull without storing the password on the server

When simply using the command line, the main strategy would be to use the cache git credential helper: git config --global credential.helper cache git config --global credential.username {{ gituser ...
0
votes
1answer
33 views

vagrant 1.8.1 doesn't seem to install ansible when it's specified in ansible_local

My provisioner is like this: config.vm.provision :ansible_local do |ansible| ansible.playbook = '/home/deploy/sosd/local/ansible/sosd.yml' ansible.install = true end But on vagrant up it seems ...
-1
votes
2answers
28 views

Running python script on anisble

I have an ansible server that I find works fine, but when I try to run a python script on the deployed servers I get no such file or directory, even though I visually confirm they are there. Here's ...
0
votes
1answer
39 views

Recurring Ansible Tasks

I've been familiarizing myself with Ansible and Puppet for use as a provisioning and configuration management tool. I may not be misunderstanding something about the way Anisble is used, but the only ...
0
votes
1answer
12 views

Unable to form a link of a file which is in sites-available to a directory sites-enabled in remote server using ansible?

Unable to form a link of a file which is in sites-available to a directory sites-enabled in remote server using ansible? This is command I want to execute using file module of ansible: ln -s ...
0
votes
1answer
18 views

how to execute a particular role of ansible?

For example i have created the following roles sqldb, rabbitmq, keystone and in the main playbook file i've mentioned all of the three roles, but while executing main playbook using ansible-playbook ...
1
vote
1answer
34 views

Ansible & rbash

I want to manage a bunch of devices running /bin/rbash as the default shell with Ansible. The problem is that Ansible always try to execute a list of commands that rbash doesn't like at all: umask ...
0
votes
0answers
22 views

Ansible conflicts with AppArmor

I am trying to run some Ansible playbooks on a fresh Ubuntu 14.04 install. But this hangs on the first task, whatever the task is. Even the ping module doesn't work. When I stop AppArmor on my target ...
1
vote
1answer
13 views

Ansible generating task per runtime object

I'd like to make Ansible run a task per some object found at runtime. For example one per file in a specified directory or one per running process. Is there a way to implement this inside of ...
1
vote
0answers
28 views

Ansible variable precedence

I'm trying to understand variable precedence in Ansible - more exactly the part about host_vars and group_vars in inventory or playbook. My layout looks like this: production/ ├── inventory (alfa, ...
1
vote
1answer
22 views

run specific role on any condition

I have created a role named cleanup which is my final role in playbook (which handles some cleanups after running all otherroles) here is a simplified version of my playbook - hosts: myhost roles: ...
2
votes
2answers
26 views

How to enumerate network interfaces in Ansible

I'd like to get an ordered list of the network interfaces on a machine using Ansible. Modern Linux systems don't use eth0, eth1, etc. So the names are unpredictable. On our network we connect the ...
1
vote
1answer
34 views

How do you manage package updates with Ansible?

I'd like to use Ansible to roll out package updates to my machines. But I'd like to test those updates on a local vm first. How is this usually achieved in the real world ? Do I "lock" every ...
2
votes
0answers
26 views

Cannot install from ansible-galaxy on an FC22 machine

Ansible is installed from github, as per ansible site's instructions, and appears to work OK. But galaxy fails thusly: # ansible-galaxy -vvv install goozbach.epel Using /etc/ansible/ansible.cfg as ...
2
votes
1answer
39 views

How to specify different hosts for different playbooks in one ansible script

As I understand, each playbook takes one hosts entry. I want to know that if I create a container playbook that includes other playbooks, can I parameterize the hosts for each playbook include. So ...
2
votes
1answer
32 views

Ansible ignores it's configuration file (ansible.cfg), what could be the reason?

I'm running Vagrant 1.8.1 and ansible 1.8.4 on Mac OS. I've started 2 Ubuntu machines on vagrant: itais-MacBook-Pro:ansible-dir itaiganot$ ./dev/hosts --list | jq '.' { "web": [ "web" ], ...
0
votes
1answer
25 views

Using nested conditinal blocks in ansible

I am trying to insert a conditional block inside a conditional block: - block: - postgresql_db: name={{ dbname }} state=absent - postgresql_db: name={{ dbname }} ... - block: - get_url: ...
0
votes
1answer
29 views

Ansible. Correct way to copy nginx config

We have task like: - template: src=templates/nginx/default dest=/etc/nginx/sites-available/default owner=root group=root When I run it like: ansible-playbook -i ...
1
vote
0answers
64 views

ansible-playbook with group_vars

I'm trying to organize ansible from a ssh model to pull. Before I had a setup like group_vars/ all prod stage dev Now I'm trying to run everything via cron so I tried this setup staging/ ...
0
votes
1answer
270 views

Ansible ping fails - host unreachable

I just started learning the basics of Ansible, and looked up why I am getting the above error but can't figure out how to sort it out. This is the trace: Me-Air:ansible me$ ansible all -m ping -vvv ...
0
votes
0answers
33 views

openstack-ansible stuck on ssh

I'm being brave on deploying OpenStack using Ansible. Finally stage of punching commands except I'm running into ssh error. This seems to be either forked or customized ansible for OpenStack. In the ...
1
vote
0answers
18 views

Ansible work with large variables locally

I am trying to develop a local configuration management application working with ansible(2.0.1) under the hood. I have large selection of variables (about 1000 entries per var file) to be used which ...
1
vote
1answer
38 views

ansible custom facts returning string not array

I have a custom fact for my servers to retrieve customer data. This works fine on the machine and returning valid json. I can write the output to another facts-file and this works perfectly fine too. ...
0
votes
0answers
64 views

Passing an Ansible host fact as stdin to a command

Is there a core module in Ansible 2.0+ which allows to use a host fact as a standard input for a command? I want to run a program on remote hosts, passing passphrases to it, so echoing the variable ...
1
vote
1answer
40 views

Where does ansible package module search for given package name?

I am new to ansible and trying to copy and install jdk on remote machine. I would like to use rpm install only considering I have all different flavours of clients.(RHEL, Centos, Ubuntu etc). Below is ...
2
votes
1answer
150 views

Ansible has difficulty restarting Supervisor

I'm trying to restart Supervisor through my Ansible Playbook but I seem to be stumbling into an issue with the supervisor module for Ansible. In my Supervisor config I have defined a program: ...
2
votes
0answers
75 views

Forward Kerberos Authentication on Ansible

I have an ansible control machine (host-A) that need to talk with host-C, an Windows machine that doesn't have local users (It's an Active Directory). host-A doesn't have network access to host-C, ...
1
vote
1answer
35 views

What's the correct way to reference hosts as variables in Ansible?

I'm fairly new to Ansible, and am in a bit of a dilemma with our flow for this particular script. We have a list of certs that we want to deploy to each host; these are unique to each host, so 1:1 ...
1
vote
1answer
52 views

How to loop through interface facts

The setup module from ansible provides the fact ansible_interfaces "ansible_interfaces": [ "lo", "eth0", "eth1" ], And per interface some facts: "ansible_eth0": { "active": true, ...
3
votes
1answer
156 views

Ansible SSH error although standard ssh is working

I want to apply the playbook to the localhost ansible-playbook site.yml --limit localhost -vvvv and I get TASK [setup] ******************************************************************* ...
1
vote
1answer
47 views

Commands not working “with_item” in ansible playbook

I am new to ansible and trying to write a basic playbook for mongodb backup with simplest method. here is what i am trying to do: --- - hosts: mongo tasks: - name: Mongo Dump command: ...
1
vote
2answers
78 views

Get current hostname and push it into conf file with ansible

I'm working into an ansible playbook to get the current hostname of a server and then set it into a configuration file. I cannot figure it out how can I push the shell output using the lineinfile ...
1
vote
0answers
21 views

How do I get the ec2 tag Name from my ec2 hosts?

I'm wanting to extract the "Name" tag from ec2 instances. How do I do that? It doesn't seem to be part of ec2_facts