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

-2
votes
1answer
52 views

How to make sudo -u not require password [on hold]

I'm using ansible with vagrant and ansible is trying to sudo as postgres user to run some postgres commands. Ansible running as vagrant user seems to run something like sudo -u postgres psql This ...
1
vote
0answers
19 views

how to access host variable of a different host with Ansible?

Let's say a have a host that collects some data and it's in a group [collectors]. I also have hosts in group [reporters]. So I want to set a variable on reporters from groups['collectors'][0] ip ...
0
votes
1answer
18 views

Ansible error when unpacking some archives into /usr/local/lib

I'm running an ansible playbook on my machine, and every task completes successfully except for several steps that involve unpacking various zip and tar.gz archives into /usr/local/lib. Here's an ...
3
votes
1answer
28 views

Tweaking Ansible output

I want to use Ansible to collect information from a number of servers. The information should be postprocessed locally, so it should be presented in a certain format. Other than grep and sed and awk ...
0
votes
0answers
27 views

How can I run a delegated task for an offline host using Ansible?

I have Ansible tasks for enabling and disabling Nagios checking for some hosts. They use "delegate_to" the Nagios server. However, I can't use them when the host in question is offline, because ...
1
vote
2answers
35 views

Ensuring a given set of RPMs, and only those RPMs, are installed

I have multiple lists of RPMs (one per configuration), and a set of remote machines. Each list includes all of the RPMs needed to run my machine in the configuration I choose. For a given ...
0
votes
1answer
36 views

passing list of lists in a playbook to a single command (not with_items)

I two groups of hosts: dc1 and dc2. Also combined to a DC group. I need to pass a list of IP addresses of hosts from a foreign DC to a command. with_items doesn't work here at all. Should look like ...
0
votes
1answer
49 views

Associative array in Ansible playbook

I'm trying to add users to my servers using Ansible. Each user have a different encrypted password. I have something like that: vars: users: - myuser1 - myuser2 password: ...
0
votes
1answer
46 views

file created by ansible seems to have mangled permissions

Issue with files created by Ansible I’m looking at using to setup some new servers at a new ISP and I’ve been doing some basic steps to test first. I am new but have done some testing on diff servers ...
0
votes
0answers
94 views

Ansible stuck on gathering facts

I'm having some odd issues with my ansible box(vagrant). Everything worked yesterday and my playbook worked fine. Today, ansible hangs on "gathering facts"? Here is the verbose output: ...
1
vote
1answer
32 views

using pgpool doesn't see a list of variables into group_var directory

I am using Ansible + Vagrant to create my infrastructure or make a little simulation of I wish. It installing postgres and creating a ssh directory to store the differents keys for each host. It is ...
0
votes
1answer
25 views

Is it possible to get host groups from nagios config to ansible?

We have already nice preconfigured nagios with hosts, host groups etc... Is it possible to get host groups from nagios to ansible? are there some plug-in/module which may allow us to do: ansible ...
1
vote
2answers
76 views

How set to ansible a default user/pass pair to ssh connection

I am using ansible and I have it configuration in my inventory/all: [master] 192.168.1.10 ansible_connection=ssh ansible_ssh_user=vagrant ansible_ssh_pass=vagrant [slave] 192.168.1.11 ...
3
votes
1answer
100 views

How to get remote server facts on ansible

I have playbook where i setup web-servers. And in this playbook i want to know local-network ip address of db server. All this servers i have in inventory file. How i can do it? I tried to use ...
2
votes
1answer
119 views

Have a Vagrant VM destroy itself or power off on completion of a long-running task

I've been using Vagrant with Ansible to perform certain ETL tasks. This has provided some flexibility and transparency: jobs can be easily be moved around and the YAML playbook provides some level of ...
-1
votes
1answer
132 views

Access to ESXI using Ansible (python)

I'm want to execute a command using Ansible on an remote ESXi but it seems that a module grp is missing. # ansible esxi -a "date" esxi | FAILED >> { "failed": true, "msg": "Traceback ...
3
votes
1answer
59 views

Securing the primary Ansible user

It seems that there are only two reasonable approaches for the primary Ansible user: Using root Using another user (e.g., ansible) with NOPASSWD sudo access The first option is a no-go since I ...
1
vote
1answer
76 views

Install image with Ansible via IPMI?

Is there a way to install an image on and provision a bare metal SuperMicro IPMI server from the ground up with Ansible via in-band IPMI over VPN? I'm looking to see if I can automate the ...
-1
votes
1answer
197 views

MySQL installation with Ansible on Debian Wheezy

As the title suggests, I am trying to install MySQL Server 5.5 on Debian with Ansible. Since this needs to be a silent installation, I provide the root password before the installation with debconf ...
1
vote
1answer
117 views

Why is my instance failing ELB health checks when adding it to the load balancer via Ansible?

I am trying to add an EC2 instance to an Elasitic Load Balancer using an Ansible playbook, with the ec2_elb module. This is the task that should do this: - name: "Add host to load balancer {{ ...
1
vote
2answers
46 views

Issue with sharp in host vars Ansible

Since # is considered as a comment in /etc/ansible/hosts I'm unable to use a password containing a sharp. [hosts] host1 ansible_ssh_user=user ansible_ssh_pass=userpass ansible_su_pass=My#Password ...
1
vote
1answer
199 views

Ansible: Excecute task only when a tag is specified

Ansible tags can be used to run only a subset of tasks/roles. This means that by default all tasks are executed and we can only prevent some tasks to execute. Can we limit a task to be exectued only ...
3
votes
2answers
787 views

Iptables management with ansible in huge environment

What is the best way to manage iptables from one point and have the ability to edit something on local server. We need to add some rules centralized on all servers, but we have specific servers with ...
1
vote
2answers
200 views

Always trigger handler execution in Ansible

I'm using Ansible to provision my development server. I want it to always start some services for me. I have handlers for this purpose but what is the best way to trigger handler execution without ...
1
vote
1answer
73 views

Ansible Role include

I have a task that can be used by several roles. I added it to lib/mycommontask.yml On my playbook on roles/my-project/tasks/main.yml I have: -- - include: lib/mycommontask.yml vars: project: ...
1
vote
3answers
342 views

Accessing hostvars for a host group in anisble

I am trying to use ansible to add entries in the server hosts file. I have a group of servers that I need to talk to each other over a private LAN. My inventory file: [server_list] server1 server2 ...
4
votes
1answer
842 views

Weird network problems with Vagrant, VirtualBox, Ansible and Ubuntu Server box

We are using Vagrant and Ansible to provision VirtualBox machine. It was working great, but recently we've started to encounter some weird network problems with tasks that require access to the ...
1
vote
1answer
88 views

Configure all hosts, then create a list of the config for all hosts?

I deployed a huge number of hosts with Ansible - which did work very nice. Each host got its individual settings and configuration. Now I'd like to generate a config file for another system that ...
1
vote
1answer
148 views

SSH via terminal succeeds, but same SSH connection via Ansible fails on same machine?

Can anyone possibly shed any light on why this is happening? I am logged into machine A, the client, with user basicuser. When I try to run an ansible playbook on machine B (server machine, as ...
1
vote
1answer
226 views

Using more advanced filters with ansible setup module

I'm new to ansible, but I cant find the answer to this question which I think looks fairly simple.. In playbooks, you can get facts in ansible using example {{ ansible_eth0["ipv4"]["address"] }} or ...
2
votes
1answer
816 views

Ansible ssh as user and execute has root (expect like)

I have to administer an important number of hosts where there is only one user able to access from SSH (let's call him foo) and then have to login as root to execute privilegied commands. Foo user ...
2
votes
2answers
171 views

How to clean up stuff from roles that aren't used any more on a server?

Suppose I have a host that is, among other things, a web server, where the related Ansible role installs nginx, performs some essential configuration in /etc/nginx, and opens up ports 80 and 443 in ...
3
votes
1answer
451 views

Ansible iterate a dictionary with lists

I have the following variable loaded via include_vars: access: username-foo: - path: / permissions: rwX recursive: true username-bar: - path: / ...
5
votes
1answer
1k views

Ansible: copy template only when destination file does not exist

I'm using Ansible 1.6.6 to provision my machine. There is a template task in my playbook that creates destination file from Jinja2 template: tasks: - template: src=somefile.j2 ...
0
votes
1answer
58 views

How to notify a handler at the end of execution?

I have a Rackspace instance that I use for testing. I am using a seperate user for running Ansible, and due to my SSH configuration update tasks, if I notify the "restart ssh" task when needed, later ...
0
votes
1answer
68 views

how to provide username and password for ansible mail module

How to provide username and password of email account while using ansible mail module. I'm using gmail smtp server. In documentation of mail module nothing is mentioned about it. I also came across ...
2
votes
1answer
486 views

Running Ansible locally inside a Dockerfile SSH authentication issue

I'm unable to run my ansible playbook inside a Dockerfile due to authentication issues. Here's my dockerfile: FROM ubuntu:14.04 MAINTAINER hyperfocus # Update system and install ansible RUN apt-get ...
5
votes
1answer
226 views

Distribute ssh public keys among hosts

I'm setting up some machines with Ansible and need to enable password less connections between them. I've got a database master and several slaves. For initial replication the slaves need to ssh into ...
1
vote
2answers
86 views

Looking for a way to get team public keys to EC2 instance autonomously

I am administering a single (now) ec2 instance which will provide some tools to our users. I am using Ansible to manage it. I have it set to create users using a mix of a Cron-job and Ansible (by ...
0
votes
1answer
321 views

use file from host as input for lineinfile module

I'm currently setting up a system with ansible and want to automate it as much as possible. So I'm creating the public keys on my ansible machine and copy them to the hosts so that I can control the ...
0
votes
1answer
404 views

Error compiling PHP 5.5.9 on CentOS 6.5 during make command

Here is the error message: cc: internal compiler error: Killed (program cc1) Please submit a full bug report, with preprocessed source if appropriate. See ...
3
votes
0answers
344 views

Kickoff Ansible Playbook after Cobbler install

I am working on implementing Cobbler and Ansible to do our server deploys and am having one final issue. My Ansible playbook works great, my Cobbler install works great, but the issue is in tying them ...
0
votes
0answers
270 views

Restarting redis after installing with Ansible hangs

I'm using the following playbook albeit slightly modified with a newer version of Redis: https://github.com/Kami/ansible-redis I removed the Disable obsolete init.d service and generate upstart ...
1
vote
0answers
223 views

pipework-mediated network configuration of docker container works from CLI, but not through ansible

When running the following from a shell (with pipework from https://github.com/jpetazzo/pipework in the path) all is good: #> docker run -i -t -d --expose=22 <DEBIAN_STABLE_IMAGE_ID> ...
2
votes
1answer
271 views

Use Ansible to create vagrant box ?

I am new to Ansible and I bit confused if I can better use Vagrant to create VM instances (on EC2 and local virtual boxes) and use Ansible only for provisioning or if I can/should use Ansible to ...
2
votes
1answer
463 views

Ansible: Can I use vars_files when some files do not exist

That's the part: vars_files: - vars/vars.default.yml - vars/vars.yml If a file vars/vars.yml does not exist - here is an error. ERROR: file could not read: /.../vars/vars.yml How can I ...
-1
votes
3answers
451 views

Can I administer Amazon RDS instances with, Chef? Salt? Puppet? Ansible?

On the face of it, it looks like I need to be able to install some software daemons on the target nodes for these things to work. If I can't do that (e.g. an Amazon RDS instance), what are my options? ...
1
vote
2answers
634 views

how to unify package installation tasks in ansible?

I am starting with ansible and will use it, among others, to install packages on several Linux distros. I see in the docs that the yum and apt commands are separated - what would be the easiest way ...
1
vote
1answer
253 views

How to initialize known_hosts/authorized_keys/public/private key pairs with ansible

I am using ansible to configure and deploy my app on several machines. The only problem I have now is that I am not sure how to properly initialize/automate the very first connection to this machines? ...
2
votes
2answers
2k views

Ansible not executing host specific playbook in Vagrant multi-machine provisioning

When provisioning with ansible in Vagrant, I am unable to get server/role specific playbooks to run. There is a common playbook run for all hosts, and that is working, but when trying to target a ...