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

15
votes
3answers
1k 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 ...
10
votes
1answer
3k views

How to see stdout of ansible commands?

How do I see stdout for ansible-playbook commands? -v only shows ansible output, not the individual commands. It would be great if I could figure out how to do this immediately, so if something ...
8
votes
1answer
617 views

Configuration management: push versus pull based topology

The more established configuration management (CM) systems like Puppet and Chef use a pull-based approach: clients poll a centralized master periodically for updates. Some of them offer a masterless ...
6
votes
2answers
1k views

How to handle SSH port changes with Ansible?

I'm trying to use Ansible for automating the setup process of new server instances. One of the setup tasks changes the default SSH port, therefore requiring me to update the hosts list. Is it ...
5
votes
5answers
2k views

Rolling update with puppet, ansible or fabric

I have some jetty servers with a loadbalancer before them. Now I want to update my application without downtime. When one jetty is going down and no longer reachable the loadbalancer automatically ...
4
votes
1answer
434 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 ...
4
votes
2answers
431 views

Create user if not exist in Ansible

I want to make sure a given user always exist in a system, so only create when it is not exist my current tasks is: - name: Create default user action: user name={{ user }} groups={{ group }} ...
4
votes
1answer
80 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 ...
4
votes
1answer
201 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 ...
4
votes
1answer
228 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 ...
3
votes
3answers
985 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 ...
3
votes
3answers
1k views

ansible playbook, different user by operating system

I'm starting to play with ansible. I have a bunch of servers (Ubuntu, Centos, Red hat...). The servers have different users. For the ubuntu servers I use sudo user, for the rest I use root user. How ...
3
votes
1answer
27 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
463 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 ...
3
votes
2answers
1k views

How do I add sudo permissions to a user created with Ansible?

What is the cleanest way of doing this? Tried adding the user to the sudo group with the users module but Ansible reports it can't find the sudo group.
3
votes
1answer
171 views

Using Nagios Event Handlers to bring system back in correct state

I'm pretty new to monitoring , config management, etc. so please bare with me. I've read up on config management / provisioning tools like Ansible and SaltStack. These sound pretty good to me and I ...
3
votes
0answers
110 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 ...
2
votes
2answers
275 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 ...
2
votes
1answer
20 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 ...
2
votes
1answer
421 views

Reusing tasks in Ansible

In Ansible, is it possible to define a set of tasks in one files and then run selected tasks from other playbooks? The documentation describes how to include and reuse the task list, is there a way to ...
2
votes
2answers
486 views

Ansible : using different sudo user for different hosts

Recently started using ansible. We have servers where the application is setup under different users, like in server xyz.com, unix user is xyz_user and so on. So in case of xyz.com, ansible xyz.com ...
2
votes
2answers
1k views

Should I install Ansible with python pip or homebrew on Mac OSX Mavericks? [closed]

I recently moved to using OSX to administrate my linux box, so I'm very new to using linux programs on OSX. I want to use Vagrant with Ansible to bootstrap my development environment, so I need to ...
2
votes
2answers
34 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 ...
2
votes
0answers
68 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 ...
2
votes
2answers
501 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
462 views

Ansible playbook not working trying to run patch

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 vars: home: '/home/vagrant' ...
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 ...
1
vote
1answer
98 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
vote
3answers
456 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 ...
1
vote
2answers
552 views

How do I authenticate a user on specific tasks using Ansible?

I'm getting 'msg: Failed to lock apt for exclusive operation' when trying to install some dependencies in a playbook using apt, with the vagrant user. I'm suspecting it tells me this because it can't ...
1
vote
1answer
92 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
159 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
vote
2answers
909 views

Ansible experts: Command or Shell task hangs when using ssh to create a tunnel

I am using Ansible to push configuration. I have a task inside a playbook that I want to start an ssh tunnel in the background for mongodb. The task command that i'm using is - name: Start tunnel ...
1
vote
2answers
290 views

Force Ansible to throw out error when vars is missing in yml?

Is it possible to force Ansible when replacing the var in yml files, which is undefined, throw out an error instead silently replaced by an empty string?
1
vote
1answer
965 views

Ansible playbook, create a user with the option --disabled-login

I need create a user with the option --disabled-login with ansible's playbook. The command line is: sudo adduser --disabled-login git I'm searching on Ansible's documentation. And the option ...
1
vote
1answer
134 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
2answers
179 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 ...
1
vote
1answer
1k views

Is it possible to execute the Vagrant Ansible provisioner on a Windows host machine?

It seems that Vagrant doesn't let me automatically provision the Ansible provisioner on Windows using Vmware. I'm not really sure whether Ansible has to be installed on the host machine, (in my case ...
1
vote
3answers
796 views

ssh-copy-id in one line with password, possible?

I'm trying to setup an automated script in Ansible to set a new server, and i'm using ssh-copy-id to add the Ansible master server to the new server's authorized ssh keys. I created a script which ...
1
vote
2answers
46 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 ...
1
vote
1answer
136 views

Ansible installs php5filter instead of php5

I have a strange problem with Ansible that I use to install / update / manage my webservers. I have an installation script that is supposed to make sure that I always have the latest PHP5 module in ...
1
vote
0answers
119 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> ...
1
vote
1answer
122 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
131 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
2answers
603 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 ...
1
vote
1answer
90 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 ...
1
vote
1answer
549 views

Ansible Gathering Facts not working?

Everytime I run a playbook, ansible will install the packages again and again, even thought it is installed, so how does it work actually? ansible-playbook -i hosts site.yml GATHERING FACTS ...
0
votes
1answer
214 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 ...
0
votes
1answer
43 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
3answers
143 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 ...