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

1
vote
1answer
22 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 {{ ...
2
votes
2answers
65 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 ...
2
votes
1answer
263 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 ...
0
votes
0answers
36 views

Provisioning & Deploying to Development, Staging, and Production using a simple single method

Background I'm working on a small web application that relies on Python (Flask), Redis, and MongoDB, with Ansible currently being used for provisioning the production system. I also have GitLab CI ...
1
vote
2answers
18 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 ...
0
votes
1answer
35 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 ...
2
votes
2answers
1k 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 ...
0
votes
1answer
67 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 ...
0
votes
2answers
45 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 ...
2
votes
2answers
780 views

How do I enable additional debugging output from Ansible and Vagrant?

I'm investigating Ansible for server and application provisioning. My application is currently provisioned with shell scripts in Vagrant. Rather than rewrite my scripts I've taken a sample and ...
1
vote
2answers
303 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 ...
0
votes
4answers
572 views

SSH aborts with Too many authentication failures

I'm attempting to run this simple provisioning script but I'm encountering errors when running vagrant up and then vagrant provision commands. I read that I needed to create a /etc/ansible/hosts file ...
1
vote
1answer
32 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: ...
3
votes
2answers
989 views

Deploying a folder of template files using ansible

Is there an easy way to deploy a folder full of template .j2 folder to a linux box, using the same name as the template, but without the .j2 extension, rather than using the template module for each ...
1
vote
2answers
88 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 ...
2
votes
1answer
289 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
83 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
72 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
149 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 ...
1
vote
2answers
1k views

ansible: why is the file module skipping?

I have an ansible 1.1 playbook where I do something like this: - name: copy files sudo: True ...
2
votes
2answers
76 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
131 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: / ...
3
votes
1answer
261 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
39 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
46 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
2answers
386 views

How to install Python packages to (Homebrew) Ansible's site-packages folder

I have installed Ansible (v1.4.4) and Python (2.7.6) via Homebrew. I'm creating an Ansible playbook for setting up a local development machine on Mac (Mavericks). When I get to the step to import a ...
5
votes
1answer
136 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
1answer
185 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? ...
1
vote
1answer
172 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 ...
1
vote
2answers
56 views

Where do I find the latest ansible error log

I used an ansible script to bring a server configuration up. I was running the script from inside the server and doing everything at the localhost inventory. Now the ssh connection I had to the ...
4
votes
1answer
373 views

Passing free-form commands to Ansible using complex-args form

I'm using programatically generated Ansible playbooks. In general, because playbooks are just YAML, this is straightforward. However, when using the "simple" key=value form, playbooks aren't pure ...
0
votes
2answers
64 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
152 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 ...
1
vote
1answer
243 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 ...
0
votes
1answer
227 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 ...
17
votes
3answers
2k views

How can I implement ansible with per-host passwords, securely?

I would like to use ansible to manage a group of existing servers. I have created an ansible_hosts file, and tested successfully (with the -K option) with commands that only target a single host ...
3
votes
0answers
212 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 ...
4
votes
1answer
267 views

How to make ansible use password if key was rejected?

My new server instances are configured to login on root via ssh with password. I want my playbook to reconfigure it to use keys instead and disable root login with password on first run, so I need ...
1
vote
3answers
752 views

Running an Ansible ping on a remote host fails with an unknown SSH error

I'm attempting to do an Ansible ping ansible all -m ping --ask-pass but I get SSH failures. As the debug log is rather extensive, I've trimmed down the below quote to where I think the problem ...
0
votes
0answers
203 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
169 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> ...
3
votes
3answers
1k views

How can I add a user to multiple groups in Ansible?

I can't add a user to multiple groups, I keep getting msg: this module requires key=value arguments. This is the piece of code I'm trying: - name: make a new user user: name=user ...
1
vote
2answers
260 views

Is the SSH SFTP subsystem required on the managed nodes for Ansible to work?

When I run: ansible all -a "/bin/echo hello" -u myuser I get back: mydomain.myhost.com | FAILED => failed to open a SFTP connection (Channel closed.) The SFTP subsystem is disabled on the ...
-1
votes
3answers
345 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? ...
-2
votes
1answer
490 views

Why chef, puppet, ansible, salt, etc.? [duplicate]

The devops tools ecosystem is puzzling to me. Instead of shell scripts that work everywhere everyone in the server orchestration/management space is bolting on their own proprietary formats. Ansible ...
1
vote
1answer
164 views

Deployment and configuration of complex python application scheme

Challenge Our fresh application uses several services: custom build postgresql, redis, celery, rabbitmq, haproxy, nginx, uwsgi, about 4 our internal processes (mostly python), AngularJS ...
1
vote
1answer
447 views

How can I prepend to PATH while running Ansible's pip module?

I'm attempting to install psycopg2 into a Python virtualenv with Ansible's pip module, but I need to prepend an entry to PATH for it to build correctly (it needs to know the path to the directory ...
1
vote
1answer
109 views

Best practices for software configuration?

I'm configuring my AWS EC2 instances with Ansible, but I don't know what's the best way of storing my app configuration. Now I'm just sending a "app.properties" file to the server, using Ansible, but ...
4
votes
1answer
724 views

Ansible playbook not working trying to run make & configure with complex switches

This is a follow-on to this question. I'm trying to use Ansible to provision a Vagrant VM. The VM is running CentOS 6.4. I'm using the following (abbreviated) ansible playbook: - hosts: default ...
1
vote
2answers
387 views

Run included ansible task as standalone task

I have many Ansible playbooks that will get included in much larger playbooks. For example: --- - name: Add user me user: name=me comment="Me" uid=9999 groups=somegroup - name: Add my ssh public ...