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
0answers
9 views

Does coreos' cloud-init have something similar to ansible's vault?

I'm trying to setup ssl keys and certs onto a coreos machine, on the previous ubuntu machine I was using, I had ansible's vault encrypt the key and cert for source control and decrypt it when adding ...
0
votes
2answers
55 views

ansible tower reports : stdout capture is missing

How to fix the error of stdout capture being missing. I am scheduling couple of tasks, initially they are running fine after couple of iteration it is throwing this error.
1
vote
0answers
10 views

Put a “config-test” step into an ansible recipe

While writing this, I solved my own problem. So I'll put the question and answer in case it helps someone else (and in case someone would like to point out a better way): I'm trying to get ansible ...
1
vote
2answers
137 views

Appending to lists or adding keys to dictionaries in Ansible

(Related to Callbacks or hooks, and reusable series of tasks, in Ansible roles): Is there any better way to append to a list or add a key to a dictionary in Ansible than (ab)using a jina2 template ...
0
votes
0answers
20 views

Ansible mercurial clone hangs on deploy, runs fine on subsequent runs

I have an Anisble playbook that does the following: Launches an EC2 Instance Switches to that instance in a second play within the playbook, and configures the instance for our specific purpose ...
4
votes
1answer
177 views

How to encrypt binary files in Ansible?

We are using Ansible Vault to store passwords, private keys for certificates etc. in our Ansible Playbook git repository. All of our existing private data is in text form, so we can store it in ...
1
vote
1answer
17 views

ansible lineinfile escaped quotes go missing

Using ansible 1.5.4, the command lineinfile: dest=/etc/bash.bashrc line="bind '\"\e[B\"':history-search-forward" added the line bind '"\e[B"':history-search-forward to /etc/bash.bashrc perfectly ...
3
votes
1answer
73 views

How do I make Ansible actually compile a config file having changed my debconf settings for an application?

I'm using Ansible to try to configure all of the workstations involved with a particular project to be able to use BitTorrent sync with a standard configuration (this is actually just an example of ...
0
votes
2answers
399 views

Convert value of an Ansible variable from lower case to upper case

I am working on a playbook to join linux systems to Active Directory. I can't seem to find a way to convert the value of ansible_hostname to uppercase. One of the commands I need to run requires the ...
2
votes
1answer
31 views

ansible task does not trigger handlers

I'm having trouble getting a task within an ansible role to trigger handlers. Here are the files I'm using: roles/services/tasks/postgresql.yml shows - name: install postgresql packages apt: ...
0
votes
1answer
18 views

Azure, internet facing load balancer without using cloud services

Is it possible to have load balancing between virtual machines without placing the machines in the same cloud service? We want to use Ansible to configure our machines and setup RabbitMQ but I can't ...
5
votes
4answers
1k views

Running apt-get autoremove with ansible

I maintain a flock of EC2 servers with ansible. The servers are regularly updates and upgraded using the apt module. When I manually tried to upgrade a server, I received the following message: $ ...
6
votes
2answers
706 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 ...
0
votes
1answer
15 views

Launching an EC2 Instance with an IAM Role Using Ansible

I'm trying to launch an instance with an IAM Role using Ansible. But I don't find how to do it. Does anyone know if it is possible? If I can't use Ansible. I try it with boto
10
votes
4answers
5k 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 ...
2
votes
1answer
96 views

Executing commands on the Ansible host from a handler

I am trying to implement the following scenario in Ansible (v1.9.1): Ansible connects to remote host and uses su to become root. Ansible host fetches remote configuration file that it is about to ...
2
votes
2answers
835 views

What does “localhost | FAILED => Missing become password” mean? How do I get past it?

I have a Ubuntu 14.04 virtual machine set up in virtualbox and I am trying to follow these instructions. https://serversforhackers.com/an-ansible-tutorial When I get to the module section and try to ...
2
votes
1answer
161 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
0answers
54 views

Ansible local_action: stat doesnt find my file

I want to copy a file to remote nodes, but only if the file exists. I copied it into /tmp/webapps/partner.war My Task is: - local_action: stat path="/tmp/webapps/{{ application }}.war" register: ...
0
votes
2answers
27 views

Cannot put application back into ELB: Instance has not passed the configured HealthyThreshold number of health checks consecutively

Putting the EC2 instance back into the ELB used to work 90% of the time. Unfortunately lately the deployment regulary fails with the next error: 15:51:59 TASK: [Start the app] ...
1
vote
1answer
42 views

Easiest way to exit Ansible playbook while debugging

Say I'm debugging an Ansible playbook and want to quit after a given task (and not run through all of the following tasks). Is there any one-line magic command available, or do I have to manually ...
12
votes
4answers
4k 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 ...
2
votes
1answer
60 views

Ansible fails to restart service - why?

I'm trying this on AWS EC2 instance running Ubuntu 14.04. I have a task that notifies a handler. When the handler is run I get an error. I'm having trouble understanding the error message and ...
0
votes
1answer
22 views

Pass hosts from master playbook to included playbook

How can I pass the hosts from a master playbook to an included playbook? I'm trying to create a master playbook for a type of server (e.g., a web server) which shares some common playbooks with other ...
2
votes
2answers
74 views

Parametric ansible command based on facts, how to do it?

I am updating some of my ansible playbooks to run on the latest version of Fedora, that now uses dnf by default. Since most of my playbooks should run on CentOS as well, I would like my script to run ...
0
votes
1answer
348 views

Ansible AWS dynamic inventory: `./ec2.py --list` unauthorized

I'm trying to use Ansible's ./ec2.py --list --refresh-cache to list my AWS EC2 instances. Via documentation, I've run through this checklist: AWS (docs via Amazon's Controlling Access to Amazon EC2 ...
0
votes
1answer
47 views

Is it possible to / how would one include vars files from other vars files?

I know it's possible to include tasks / handlers files in other similar files via lines like the following - name: Configure django include: django.yml - name: Configure nginx reverse proxy ...
1
vote
1answer
49 views

Using Ansible to provisioning users: Modify facts/expand hostvars?

First off, I apologize for the terrible title. I'm not entirely sure how to succinctly describe the problem. So here's my challenge. I'm working on provisioning database users and would like a ...
2
votes
2answers
42 views

Run ansible task on other members of a group, but not the current member

So I have a group of nginx server: [nginx_internal_servers] n01.local n02.local n03.local And I have a pre deploy task to run. I'm running in serial:1 mode, and I only want this pre deploy task to ...
0
votes
2answers
67 views

ansible print debug msg variable

I try to print the previously registered mosh_version variable using the ansible debug msg command like this: - name: Print mosh version debug: msg="Mosh Version: {{ mosh_version.stdout }}" It ...
2
votes
2answers
91 views

How can I stop ansible from writing passwords to the logfiles?

I am setting up a MySQL server and want Ansible to set the mysql-root password during installation. With the help of the internet I came up with this solution: - name: Set MySQL root password before ...
4
votes
4answers
2k 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
1answer
89 views

ansible command with_items

In ansible 1.5.4 the following command worked flawlessly: - name: Generate postfix dhparams command: "{{ item }}" with_items: - openssl gendh -out /etc/postfix/dh_512.pem -2 512 ...
0
votes
1answer
43 views

Ansible ad-hoc bracket expansion

Is it possible to use bracket expansion in an ad-hoc command? I'm trying to do: ansible web3 -m shell -a "sudo gzip /var/opt/tomcat/logs/appname.log.2015-05-2{4..7}" -K But it's being interpreted ...
0
votes
1answer
79 views

Ansible shell command fails under sudo when it should succeed

I have an Ansible task based on https://github.com/al3x/sovereign/blob/master/roles/tarsnap/tasks/tarsnap.yml#L2 that keeps failing when it should succeed. I used to run the role with ...
1
vote
2answers
85 views

Can i use my roles from Ansible in Ansible Tower?

I have created about 30 roles in ansible. Do i have to manually convert those in single playbooks to use them in Ansible Tower?
5
votes
1answer
176 views

Multi-datacenter Ansible load balancer template

I am migrating the management of an existing multi-datacenter setup to Ansible, but I am not sure what is the best way to model it, as I am new to it. I have three data centers D1, D2 and D3. In ...
1
vote
1answer
156 views

Managing OpenVZ containers with Ansible

Is there any elegant way to manipulate OpenVZ containers with Ansible? Sure I can install an SSH daemon on each and put my public keys, but as soon as there is a vzcl enter command maybe there is a ...
0
votes
2answers
55 views

setting up asg with Ansible and not able to use ec2.py for inventory

I have created local configuration and Amazon Auto-scaling group. By using this code. --- - local_action: image_id: ami-61f9324 instance_type: t2.micro module: ec2_lc name: ...
0
votes
0answers
13 views

Ansible roles licensed A/L/GPL: infects entire playbook? [duplicate]

Curious your thoughts. There are some great Ansible roles for a project I'm working on that are licensed using the GPL family, but I'm concerned that it'll infect the whole project if I use the one ...
0
votes
1answer
58 views

rename VMware vCenter guest name via Ansible

I'm trying to find a way to rename guest vm name (not the OS ) in vsphere (vcenter Env). I've managed to create a VM using the vsphere_guest module but I cant find a way to rename the guest VM the ...
1
vote
1answer
38 views

Shouldn't ansible-playbook -e “sudo=no” override sudo: true in my playbook?

When I auth with a non-sudo user I want to override playbook sudo. --- name: test hosts: foo sudo: yes If I do: ansible-playbook test.yml -e "sudo=no" It doesn't get properly override, instead ...
-5
votes
1answer
40 views

init system vs configuration management [closed]

Best practice: What tasks would you give to an init system like systemd vs a configuration management system like ansible? What I like about starting up services with a CM is portability across ...
0
votes
2answers
72 views

RabbitMQ auto-configuration of cluster

The RabbitMQ clustering document https://www.rabbitmq.com/clustering.html describes a process whereby you can deploy a configuration file for clustering so that a cluster is automatically created ...
0
votes
1answer
90 views

Can I use IAM Roles for Ansible

Apparently the AWS Access Key and Secret Key are optional parameters for the AWS Cloud Modules, however the places where the ansible would pick up those values are from Environment variables. Can we ...
5
votes
1answer
2k 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: ...
2
votes
1answer
75 views

Use Ansible task name as variable

I have some task in a playbook. I need send a message for each task. - name: Upload kubernetes config template: src=kubernetes-config.j2 dest=/etc/kubernetes/config backup=yes ...
1
vote
1answer
123 views

Migration from ansible to saltstack

We have a large AWS infrastructure which we manage and configure using ansible. I want to try and move our configuration management to saltstack. I've setup a server to be the salt-master and ...
1
vote
1answer
114 views

How to fetch multiple files from remote machine to local with Ansible

I would like to copy files from remote directory to local directory with Ansible but fetch module allows me to copy only one file. I have many servers from which I need files (same directory each ...
3
votes
3answers
3k 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 ...