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
15 views

Is it possible to `include` a tasks file with a different set of hosts?

Ideally, I'd like to be able to do something like: - include: deregister_from_loadbalancer.yml delegate_to: loadbalancer In such a way that I still have access to the vars for the host I'm ...
0
votes
0answers
22 views

Ansible log in as regular user and become root

using the new "become" syntax, how do you configure your playbook to log in to a host as a regular user, switch to the root user and ask for a password? I tried: --- - hosts: foo gather_facts: no ...
4
votes
1answer
36 views

How can I reduce the verbosity of certain Ansible tasks to not leak passwords into syslog?

Sometimes I would like to use Ansible's lineinfile or blockinfile modules to write a password into some configuration file. If I do so, the whole line or block, password included, ends up in my ...
0
votes
1answer
36 views

Ansible run ends up with MODULE FAILURE?

I am unable to figure out anymore on this as there's no way that I know of to get a "real" error message out of ansible. I run the below $ ansible -i /opt/ansible/ec2.py ...
1
vote
0answers
22 views

Ansible: a host appears in more than one group with a shared parent. A play is run for the parent, can it run multiple times?

I have this: [child1] host [child2] host [parent:children] child1 child2 and a play: - host: parent task: some_task Since "child1" and "child2" have the same host the play is only run once. ...
0
votes
0answers
40 views

SSH ProxyCommand not working with ansible_ssh_common_args

I'm using a jump box (server A) to access server B. As per the ansible docs here, I have the following: ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q ec2-user@A.A.A.A"' Server B is, ...
1
vote
1answer
29 views

Best practice for creating Ansible users

What is the best practice for handling local and remote users in ansible? My current understand is we have a local and remote machine with a default local user and default admin user on the remote ...
1
vote
0answers
28 views

Ansible sudo actions on Azure VM's

I using the CentOS-2nics-lb-cluster azure template to create a test environment with two virtual machines. The default admin user is created with this blob. "osProfile": { "computerName": ...
-1
votes
0answers
21 views

Ansible hanging forever on a host specified using IP address that I can SSH to just fine otherwise?

As the title says ansible is hanging up on one of my hosts and I cannot figure out why for the life of me. It is using an IP address so FQDN resolution shouldn't even come into play here. Here is what ...
0
votes
1answer
35 views

How to run multiple playbooks in order with Ansible

I'm working on several Ansible playbooks to spin up a new server instance. There are approximately 15 different playbooks I need to run in a specific order to successfully spin up a server. My ...
1
vote
1answer
85 views

How to use Ansible to manage remote lxc containers?

How can I use Ansible to execute tasks on lxc containers on a remote server? We use Ansible to deploy our code on several servers (physical and virtual machines). Until now, every instance had a ...
0
votes
1answer
49 views

Ansible: Permission denied (publickey, password)

I'm not able to connect to a host in Ansible. This is the error: 192.168.1.12 | UNREACHABLE! => { "changed": false, "msg": "ERROR! SSH encountered an unknown error during the ...
0
votes
1answer
62 views

Ansible playbook running ad-hoc command

could somebody please help, I am trying to create an Ansible playbook for our VMWare virtual hosts but the playbook will not work. If I run the same command on its own, it succeeds. Single command ...
0
votes
1answer
38 views

How to do proper error handling in ansible?

From what I can tell, ansible only does error handling at the level of tasks, which is really not enough for what I want it to be able to do. Specifically, my use case is a run-of-the-mill ...
0
votes
1answer
15 views

Pass ethernet interface to iptables rule in ansible playbook

I'm writing a pretty simple ansible playbook for setting up our iptables firewall in centos. Here is the playbook I wrote: --- - hosts: test remote_user: deploy sudo: True tasks: - name: Get ...
-1
votes
1answer
27 views

What is the best way to limit an ansible install task to only install if the package is not already present

While creating a playbook for a vagrant box, I want to skip install steps if the package is already installed. This seems like such a common scenario but is not expliclity mentioned in the conditional ...
0
votes
3answers
93 views

How can I have ansible restart the ssh session after installing nvm?

nvm requires that a user logs out / back in after installation for the changes to take effect. How can I allow for this in an ansible task running via vagrant. here's what I tried: - name : Install ...
0
votes
1answer
47 views

How can I use stdout within an ansible conditional correctly?

tasks: - name: check if rpmforge installed shell: rpm -q rpmforge-release-0.5.3-1.el6.rf.i686 register: shell_output - name: Enable repo for htop shell: "{{ item }}" ...
0
votes
1answer
31 views

How can I install Development Tools via vagrant and ansible on Centos 6.7

I get this error when running my first ansible playbook (i.e. I am not familiar with ansible yet) TASK: [Install packages] ****************************************************** failed: [default] ...
2
votes
2answers
179 views

Add extra module to ansible

I have installed ansible to make automation deploy my system and i need some extra module to work with it. I downloaded module yumrepo.py on ansible github and add it to my library directory. But when ...
0
votes
1answer
49 views

Is it assumed that if you use Ansible, you'll use Vagrant too?

I'm building a multi-server e-commerce website using Django and PostgreSQL. I'll be utilizing multiple servers (app, database, static, etc.) from Linode. Currently I configure my servers using a ...
1
vote
1answer
52 views

Can ansible tasks be used as dependencies?

I currently have three ansible tasks: create vhosts test config reload nginx I now registered the last two as handlers, but the forward notifications of ansible feel wrong for what i am doing: ...
0
votes
0answers
31 views

Ansible and EC2: How to enumerate running instances by tag?

In a playbook, I want to spin up a bunch of Spot instances on EC2 and deploy some services on them. Since I want to re-use already running spot instances with a specific tag, I am using exact_count ...
4
votes
1answer
62 views

Ansible: error when trying to unarchive a .tar.gz retrieved via the “get_url” module

I'm using Ansible 1.9.4 on a Debian (Jessie 8.2) virtual machine. I have a file that is stocked on Google Cloud Platform that I retrieve on the remote via the "get_url" module. But when I try to ...
0
votes
0answers
31 views

manage docker container on a several host from a remote server

I am trying to create a classroom environment for the many labs sessions i have for a networking classes. I am thinking of a docker container based architecture with ansible to orchestrate the ...
3
votes
2answers
174 views

ansible and reloading AWS dynamic inventory

See also: http://stackoverflow.com/questions/29003420/reload-ansibles-dynamic-inventory. My question: is there a better way of doing what's below? I have an ansible role that provisions AWS ...
0
votes
1answer
194 views

Ansible not found in PATH after installation on Vagrant box

The Problem For a test, I set up a very simple Vagrant file. This is just to test how working with Ansible is. Sadly I am stuck at step number 2 with the following error during vagrant up --provision ...
3
votes
1answer
64 views

How to refer to an existing uid and gid in Ansible?

In my playbook I install the amavis package. Later in a task I use the mount module to setup a ramdisk (tmpfs). In order to let the tmpfs-ramdisk be owned by the uid and gid created during amavis ...
0
votes
1answer
50 views

Supervisorctl error on Ansible: [Errno 111] Connection refused: file: /usr/lib/python2.7/socket.py

It seems there are some problems with supervisor floating around: http://stackoverflow.com/questions/18859063/supervisor-socket-error-issue I tried the solution by essentially adding the "config" ...
0
votes
1answer
49 views

ansible vca_vapp AttributeError: 'NoneType' object has no attribute 'startswith'

When using vca_vapp in Ansible against VCloud, I get the error "AttributeError: 'NoneType' object has no attribute 'startswith'" when using the example. TASK [vca_vapp vm_name=myvm3 username={{ ...
1
vote
1answer
30 views

ansible user variable overwritten by local machine user

so I am getting ansible setup and have a host configuration successfully setup via my ansible_hosts file: 104.236.59.171 ansible_connection=ssh ansible_user=root checking the configuration status ...
1
vote
1answer
121 views

Add static route with Ansible

How do I add and delete routes in my route table with Ansible? I can't seem to find any network or system modules for this.
1
vote
1answer
79 views

Ansible hangs on git clone

I am trying to setup a task that clones a repo in a vagrant box. I have setup agent forwarding properly, added the repo server in ~/.ssh/known_hosts, and have validated I can log in as vagrant user ...
0
votes
1answer
44 views

Ansible loops and conditions with arrays

I want to be able to control the behaviour of a module by specifying changed_when condition. This works fine when executing simple task like the one in the docs: - command: some command ...
0
votes
0answers
19 views

Strategy to use Multiple Cloud Accounts for Ansible Tower Playbooks

The Ansible Tower for Job Templates accepts only one CLOUD Account Credentials. What would be the best way to handle situation like perform DR from AWS Account A to AWS Account B. We can think of ...
2
votes
1answer
29 views

How to configure auto-scaling with Bamboo Agents?

We are able to launch new Bamboo agents and register them with the Bamboo server by using AWS auto scaling groups and using the user data, but scaling down is an issue. A Bamboo agent is like a ...
0
votes
1answer
26 views

Find a program that could be in several different places with Ansible

I'm ansibilizing a couple servers for a python application, some of which are CentOS, others are debian. Is there a convenient way to locate a program that could be installed in various places, ...
0
votes
2answers
222 views

Create multiple VMware guests with vsphere_guest module

I have the following Ansible playbook for creating (cloning) VMware virtual machines (VMs) from a template: - name: Create VMware guest hosts: localhost connection: local gather_facts: False ...
0
votes
1answer
22 views

Do I need my application baked into the AMI to use auto scaling or can I use ansible for deployment?

I have an Ansible playbook that deploys my java app running on port 8080. It does this: Unregister instance from ELB Bring Java application offline Update RPM package with new jar file Bring Java ...
2
votes
1answer
55 views

Ansible - include statement

I have something like this: ... - name: Include TEST ENV tasks include: test_env.yml when: test_env tags: - test ... as part of a role. The thing is it does not behave as I ...
0
votes
0answers
33 views

Multiple ports for ssh in Ansible

We can set port for ssh connection for host: [api] 10.0.0.1 ansible_connection=ssh ansible_ssh_user=root ansible_ssh_port=22 But how can I set additional port for case when server uses another port ...
2
votes
1answer
63 views

How to combine two lists?

I have a task which uses with_subelements but it's terrible slow for big list (especially that most of the elements has duplicates and I don't need to run it multiple times for them). So I'm looking ...
3
votes
1answer
51 views

Ansible Playbook: Ensure a process is running on any one node of a cluster?

Ansible makes it easy enough to ensure that a process is running on every host. I could do something like: --- - hosts: app_cluster tasks: - name: Look for the "foo" process shell: ps -ef ...
0
votes
1answer
29 views

Serialization with Ansible with a jumpbox/build-server

We are using a build-server that is delegating_to and deploying the build to the application servers. I am not sure how we are going to "serialize" since everything is being done on the build-server ( ...
0
votes
1answer
1k views

Install rpm package using Ansible

How do I install .rpm package on remote machine using Ansible? The obvious solution is to use command module, but that is a bit silly. Also I would like to avoid setting up a yum repository just for ...
1
vote
1answer
120 views

Ansible: How to run one Task Host by Host?

On the play-level, we have serial: 1 to allow us to run the whole play one host at a time. But I haven't found a simple way to do this on a single task. This is especially relevant, if the task in ...
0
votes
0answers
214 views

Deploy a VMware guest with Ansible

I try to deploy a VMWare guest via Ansible. Unfortunately ansible-playbook -i inventory.local vmware.yml PLAY [all] ******************************************************************** ...
0
votes
1answer
47 views

Skip apt faster if already installed using ansible

I'm using ansible to deploy to a server. The apt stage (it is Ubuntu) takes a long time to run even if the correct version is already installed (I'm guessing it just runs and sees that nothing needs ...
1
vote
1answer
35 views

VPS freeze every few days

I have a recurring problem with one of my applications/servers i'm responsible for. I basically had one VPS with all the stack needed to run my application (nginx + postgresql + ruby + ruby on rails + ...
1
vote
1answer
404 views

Ansible with Github: Permission denied (Publickey)

I'm trying to understand the GitHub ssh configuration with Ansible (I'm working on the Ansible: Up & Running book). I'm running into two issues. Permission denied (publickey) - When I first ran ...