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
1answer
4 views

Ansible template or lineinfile for Docker defaults?

We're hosting our own internal Docker registry and using Ansible to configure the Jenkins slave that will build/upload the containers. Because our registery is non-SSL, we have to add: "$DOCKER_OPTS ...
0
votes
0answers
10 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 ...
1
vote
0answers
11 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 ...
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 ...
2
votes
1answer
32 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
20 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 ...
0
votes
1answer
16 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
1
vote
1answer
19 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 ...
2
votes
1answer
100 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 ...
1
vote
0answers
57 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: ...
2
votes
1answer
62 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 ...
0
votes
1answer
51 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
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 ...
0
votes
2answers
28 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
50 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 ...
0
votes
2answers
74 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 ...
1
vote
1answer
92 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 ...
2
votes
2answers
76 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
83 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
88 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?
0
votes
2answers
56 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: ...
5
votes
1answer
179 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 ...
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 ...
2
votes
2answers
43 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 ...
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
74 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
97 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 ...
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.
2
votes
1answer
77 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
123 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 ...
2
votes
2answers
889 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 ...
-1
votes
1answer
74 views

Need help configuring Ansible for the first time [closed]

Summary: I'm trying to install Ansible on an Ubuntu 14.x server. I'm trying to follow these steps: http://docs.ansible.com/intro_installation.html I have a problem with this command when I issued it ...
2
votes
1answer
72 views

ansible to create vpc asking for hosts

I'm pretty new to ansible and from reading things what I'm doing should work. I have the following file called aws.yml --- - hosts: localhost connection: local gather_facts: no vars: ...
0
votes
1answer
27 views

How should I check an existing system value with Ansible?

I have an Ansible task where I set the version of Ruby used globally on my system. - name: Set Ruby global version shell: /usr/local/bin/rbenv global 2.2.1 The problem is that this task always ...
0
votes
1answer
93 views

Stuck on gathering facts

I'm trying to run an Ansible playbook, but it seems to be freezing on 'Gathering facts'. This is the output: GATHERING FACTS *************************************************************** ...
1
vote
2answers
137 views

Ansible command line retriving ssh password from vault

I am trying to setup Ansible to manage Linux boxes from different customers and here are what we have to work with. No Pub key authentication - I wanted it as much as you do but it won't happen any ...
0
votes
0answers
47 views

Fire multiple instances of a handler in Ansible

(Related to Callbacks or hooks, and reusable series of tasks, in Ansible roles): Is there any way to have one notification in Ansible fire multiple handlers? Consider a webserver where each app ...
1
vote
2answers
143 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 ...
1
vote
0answers
39 views

Immediate handler, or flushing just one handler, in Ansible

(Related to Callbacks or hooks, and reusable series of tasks, in Ansible roles): Does Ansible provide a way to flush notifications for just one handler? Like meta: flush_handlers, but for a single ...
1
vote
1answer
97 views

Callbacks or hooks, and reusable series of tasks, in Ansible roles

I'm struggling with making my Ansible roles somewhat composeable and re-usable. I have a role that performs several series of steps. Depending on the other roles being applied to a host, other roles ...
2
votes
1answer
37 views

Ansible Playbook With Inventory-based Tasks

Is it possible to use the content of the inventory file (or a dynamic inventory) to create tasks? For instance, let's say I wanted to configure a monit server dynamically to remotely monitor N ...
1
vote
0answers
91 views

Ansible 'include' statements and autopath

My ansible's 'include' statement was working fine, but recently after including ymls in subfolder, it somehow brokes the role's path. Here's the tree of my role: . ├── site.yml ├── inventory.ini ...
7
votes
1answer
106 views

Configure SSH credentials per environment

I'm trying to figure out how to configure the SSH credentials separately for a production and staging environment with Ansible. I understand that you can configure the server IP addresses and ...
0
votes
1answer
62 views

Ansible EC2 Hosts Script Missing Instance

For some reason, ansible's ec2 hosts is missing instances. ec2-describe-instances returns the correct instances, but /etc/ansible/hosts does not: [root@or-manage ec2-user]# ec2-describe-instances | ...
0
votes
2answers
64 views

Managing thousands of machines with approval controls [closed]

We are a startup that is just getting up to speed and running into the problem of managing hundreds of machines, and having to do nightly and weekly releases to all of them as well as managing their ...
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 ...