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
1answer
14 views

Restarting network interfaces that have changed with ansible

I've got an ansible role that - name: add virtual interface configs for vlan template: src=ifcfg-eth.vlan.j2 dest=/etc/sysconfig/network-scripts/ifcfg-{{ item.device }} with_items: "{{ ...
0
votes
0answers
12 views

Automate vm creation and configuration with ansible

I am looking at different ways to consistently, quickly and automatically provision and configure linux VMs. I am currently using ansible to configure all my servers. It really is the business. I ...
1
vote
1answer
11 views

Via ansible change password of non-root account using passwd command and picking old password from ansible files

I have got a lot of systems having a common username to login. The password is also same for most of the systems. I have 1 inventory file with all the systems. For the systems that have a different ...
0
votes
0answers
13 views

Ansible fails on AWS domain name, but not on ip and other domain name

I have a machine which I am trying to ping via ansible to test my connection. Originally we were using the AWS domain name (note, not using the actual addresses): ...
2
votes
1answer
46 views

How can I use Ansible to conditionally append a line in a file?

I'm trying to create an Ansible task that sets up trim/discards. I have a playbook that takes care of everything else (LVM, fstrim), but I can't figure out how to get crypttab configured properly. ...
1
vote
1answer
62 views

Ansible host “unreachable”: true

I just started learning the basics of Ansible. And facing some problem related to server connectivity via SSH. I created a folder named publich_html and put my code into that folder and changed the ...
1
vote
0answers
19 views

Ansible: updating select packages if installed without installing if not

I have a few tens of hosts that are a mix of CentOS 6 and 7. I recently started using Ansible to help manage them, but I'm still very much a newbie. Like everybody, I have a periodic need to update ...
1
vote
1answer
36 views

How to fetch specific data from a module in ansible to be used under another host

Here is a Linode playbook to spin a cloud server instance: --- - hosts: 127.0.0.1 connection: local tasks: - name: Create Linode Machine linode: api_key: 'blablabla' name: ...
0
votes
0answers
20 views

Ansible-galaxy not working with sudo

I'm having problems instaling plugins with ansible-galaxy. I've tried 3 things: Instaling without sudo: ansible-galaxy install sfromm.epel [WARNING]: - sfromm.epel was NOT installed successfully: ...
6
votes
2answers
141 views

Immutable Server model with Docker/Ansible vs. Ansible, Puppet, and Foreman in AWS?

We are running into an interesting argument and are falling into two camps. I'm interested in any particular problems with either idea or gotchas we might be missing. Really, anything that can help us ...
1
vote
1answer
57 views

Changing the IP of a vSphere guest VM using Ansible

I want to deploy a VM from a template on vSphere and change the new instance IP via Ansible (2.x). I've managed to clone the template with vsphere_guest module but I didn't find a way to change the IP ...
0
votes
1answer
24 views

Ansible stat, register and when while looping

I have this: - stat: path=/etc/pki/tls/certs/{{ item.ServerName }}.crt with_items: - "{{ prod }}" register: sslcheck - debug: var=sslcheck - name: Create self-signed SSL ...
0
votes
0answers
21 views

looping using with_items while registering it

I am passing 3 variable values from inventory file. Now i want to confirm that all the 3 variables values are present in inventory file. I am registering the values with with_items but how to check ...
0
votes
1answer
24 views

Ansible and fact dependent variables

Can an inventory variable in Ansible be dependent on a fact? Namely, I have a variable in group_vars/all/cars.yml that I would like to set to a value dependent on ansible_fqdn. Like: --- ...
0
votes
1answer
25 views

how to store value of ansible fact variable in another variable

I wanted to store value of ansible fact variable in some other variable, and also wanted to check is that fact variable is empty or not Below is my code where i can print the value of ansible_local ...
1
vote
1answer
38 views

Can I use ansible to startup jboss service in domain mode?

I used sh /usr/local/jboss/bin/domain.sh manually, and jboss works fine. When I use ansible to start jboss automatically, jboss log always shows "Container is down". File /root/startup_jboss.sh : ...
1
vote
0answers
678 views

Ansible: Failed to connect to the host via ssh

Anyone know why this isn't working? I'm using Ansible on Cygwin using a compiled version of sshpass. I followed the instructions at http://www.jeffgeerling.com/blog/running-ansible-within-windows ...
0
votes
2answers
33 views

Setting up icinga2 nodes via Ansible: how do I get the ticket from the master?

I'm trying to write an Ansible playbook to set up Icinga2 nodes, but each host needs a unique ticket from the Icinga2 master to authenticate. Right now I'm thinking of ssh'ing out from the node to the ...
0
votes
1answer
19 views

I am trying to use vars_prompt but when i run the playbook it directly gives me prompt and ask for the value, it doesn't checks in inventory file

What I want is set the priority of variables. I am passing the variable from inventory file and if the variable is not defined in inventory file then it should ask for user prompt. I am trying to ...
0
votes
0answers
37 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
1answer
33 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
20 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
21 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
40 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
46 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
44 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
29 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
2answers
61 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
33 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
29 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
26 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
42 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
3k 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
110 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
20 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
38 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
56 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
45 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
43 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
13 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
25 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
44 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 tries to execute a list of commands that rbash doesn't like at all: umask ...
0
votes
0answers
25 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
15 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
34 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
28 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
36 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
36 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
35 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 ...