Questions tagged [ansible]

Use this tag for questions about Ansible, an open-source automation engine, related to using Ansible for topics such as cloud provisioning, configuration management, application deployment, etc.

Filter by
Sorted by
Tagged with
48
votes
5answers
13k views

How is Ansible different from simply running a provisioning bash shell in Vagrant?

A team of IT sysadmins that have exprience using shell scripting to solve their problems, are contemplating to start using Ansible instead. Are there substantial differences and good reasons to start ...
36
votes
5answers
6k views

How to test provisioning and configuration in Ansible setup?

Looking at trying to build some resilience into our Ansible setup which deals with provisioning and configuration. I understand a few methods of testing on the configuration side of things but I'm ...
33
votes
3answers
55k views

Can I bypass host key checking in Ansible?

I'm running an Ansible playbook with a subtle hack to work on an arbitrary port forwarded port (so I can use one machine with no direct access to lots of machines). I've got a pre-task to change ...
31
votes
5answers
18k views

Where to put ansible-vault password

We are planning to use ansible vault in our project to prevent leaking passwords or keys in git. The idea is to put all our sensitive data into a plain file then encrypt this file with ansible-vault ...
20
votes
3answers
44k views

Execute multiple Ansible tasks with the same list of items

I am using an ansible playbook to configure Apache for a list of sites. The playbook has to copy the virtual host configuration template for each site into place, and then enable each site using ...
20
votes
1answer
772 views

Git clean/smudge filters for ansible vault secrets

I am trying to setup clean/smudge filter in git to have automatic encrypting and decrypting of files containing secrets thru ansible-vault command. Peculiarity of the ansible-vault command is that it ...
18
votes
3answers
2k views

What are the limitations of Puppet in comparison to Ansible?

I would like to understand the differences between Puppet and Ansible, especially what kind of Puppet limitations has in comparison to Ansible. Are there any things you cannot do it in Puppet, but ...
18
votes
3answers
25k views

Is there a way to run with_items loops in parallel in Ansible?

I'm running Ansible 2.2, but can upgrade if it helps. I saw this and was pretty excited, but it doesn't seem to be in this (or any) version of Ansible documentation. The problem I'm trying to solve ...
17
votes
4answers
30k views

Ansible: Other option available for telnet check of open ports?

I'm new to Ansible. Here's my task ... I have 400+ hosts, and I need to verify if 5 different ports are open from their end to our web server. Individually, I could log in and run: telnet ...
16
votes
2answers
5k views

How do I run ansible on one host at a time and break on a failure

I've got an Ansible playbook where I want to update a number of flaky devices in sequence. I can use serial:1, but I want to stop the playbook altogether if I get a failure so I can fix it before ...
16
votes
2answers
8k views

What is Ansible's config equivalent of `--vault-password-file`?

According the help of ansible-playbook one could use --user=REMOTE_USER to define the ssh user, but one could also define ansible_ssh_user: REMOTE_USER in either the host- or group_vars. Question ...
14
votes
3answers
21k views

How do I configure SSH keys in a Vagrant multi-machine setup?

I have 4 VMs in my Vagrantfile - 3 application servers and an Ansible control host. I only use Vagrant to create the VMs as I provision them manually from the ansible control host because I am still ...
14
votes
1answer
665 views

How do you manage your inventory of spot instances on AWS with Ansible

I am new to Ansible, with some experience in Chef. I am considering learn and use Ansible to manage environments. I was wondering, what would be the best practice to manage inventory of AWS spot ...
13
votes
2answers
3k views

How do I run Ansible Azure playbooks while avoiding storing credentials in files?

Background We use Ansible to provision and manage Azure infrastructure. At the moment we run Ansible "manually" i.e. we manually execute playbooks for various automated tasks. No CI infrastructure. ...
13
votes
2answers
3k views

What is ansible-runner about?

I've read the README file from the github repository as well as the documentation site of ansible-runner (from the official ansible project) but I don't understand what is ansible-runner about and in ...
12
votes
5answers
1k views

Are configuration management tools appropriate to use as deployment tools?

Off the back of my answer to the question: How can DevOps help to improve Software Escrow procedures? Tensibai had the question: What would necessitate Capistrano on top of puppet or chef? My ...
12
votes
1answer
3k views

How to keep configuration files automatically during apt-get upgrade or install?

When performing and apt-get update; apt-get upgrade -y on a server I encountered the message: Setting up sudo (1.8.16-0ubuntu1.5) ... Configuration file '/etc/sudoers' ==> Modified (by you or by ...
12
votes
3answers
383 views

How to safeguard Ansible deployment to mitigate accidents?

Recently the Amazon S3 had a major outage in the us-east-1 region. It looks like it was likely caused by a spelling error when running a maintenance playbook in Ansible or a similar tool. You can put ...
12
votes
1answer
771 views

How to deterministic and reproducibly assign increasing port numbers in Ansible?

I am new to Ansible, but I have to maintain a set of playbooks, which correspond to services to be setup in a given environment. They need to be assigned a port, certificates, etc. This results in ...
11
votes
4answers
3k views

How to structure DevOps related code and configs in a code repository?

We've been growing as a company, our products are expanding and our DevOps related activities and efforts are growing as well - we've switched from Bamboo to a more flexible and configurable Jenkins, ...
11
votes
1answer
6k views

Ansible: What's the difference between task, role, play and playbook?

Ansible has tasks, roles, plays and playbooks. Are those just names for different levels in a playbook organization? If not, how, exactly, do they differ from and relate to each other?
11
votes
2answers
1k views

How should I store my environment variables?

This is a very broad question about methods and advice regarding environment variables / structure. But ultimately I'm looking for answers for the very specific question of 'How should I store my ...
11
votes
2answers
2k views

Ansible Dynamic Inventory - generate inventory with ip addresses under specific tag with underscore instead of dot

I am new to Ansible. When I am using ec2.py dynamic inventory to generate inventory, after the playbook is finished to run, the results are shown as list of IP addresses under specific tag with ...
11
votes
1answer
2k views

How to automatically remove a dead node from RabbitMQ cluster

I am planning to create RabbitMQ cluster using Ansible on AWS VPC with Amazon internal load balancer as the frontend to point connections to it. Any suggestion how to remove a dead node from RabbitMQ ...
10
votes
7answers
60k views

How Do I Log Task Output To A File?

One of my ansible tasks imports an Oracle database using impdp. This generates a lot of output to the console so I have set no_log: True. However, when this fails I want to see the log! How can I ...
10
votes
2answers
230 views

Deploying VMs using roles and hosts in Ansible based on operating system

I'm having issues working out how to best apply hosts/roles to different operating systems in Ansible. I'm currently using Ansible to generate Windows/Mac/Linux VMs, and each of the VMs have ...
9
votes
4answers
17k views

Playbook without relative path to vars

I had already bunch of playbooks, so I started to organize them in playbooks dir. It cause there must be relative paths to vars files. Actual playbook: --- - hosts: aws_instance.jenkins-agents ...
9
votes
2answers
18k views

How to run Ansible with sudo no password commands with become syntax

When I run ansible against a host machine that has some commands I need to run as root, I can't run these with "become" because it runs the commands as root instead of just running them with sudo. ...
9
votes
2answers
10k views

Modify sudoers file with ansible playbook template

I am trying to create a sudoers file with ansible template. The sudoers file should look like below: Cmnd_Alias LS = /bin/ls Cmnd_Alias LESS = /usr/bin/less Cmnd_Alias DU = /usr/bin/du %support1 ALL=...
8
votes
3answers
1k views

Questions about Ansible connection to remote hosts

I want to ask some questions about working of Ansible. 1 - Which shell Ansible uses when logging to remote host ? https://askubuntu.com/questions/937354/track-logins-made-via-non-interactive-shells/...
8
votes
3answers
7k views

Is there an ansible module that check whether a port is not in LISTEN state?

The Ansible module index has been consulted, but no module was found that checks whether a port is available? Is there a module that supports this? What does available mean? Available means that a ...
8
votes
1answer
2k views

How to organize infrastructure as code projects?

I have completed an Infrastructure-as-Code project using Terraform and Ansible. Currently, I organize my project as follows: Project1 Terraform ec2.tf rds.tf … variables....
8
votes
1answer
2k views

Referencing current variable in Ansible conditional statement?

I'm using the willshersystems.users role from ansible galaxy for creating users on ubuntu servers. Now that I've got it working consistently, I'm trying to set the state attribute based on whether the ...
8
votes
1answer
600 views

Vagrantfile change with Ansible playbook to control file permission on Vagrant synced folder for Trellis

I use Trellis for my WordPress development. It works great, except I'm finding it hard to change file (or directory) permission within the synced folder. Generally I'm OK with the default permission ...
8
votes
2answers
1k views

Ansible sporadic errors with Windows machines

I'm running into some on and off issues when using windows hosts in my Ansible playbooks. I'm running Ansible 2.3 with pywinrm 0.2.2 installed. I'm using basic authentication with the local ...
8
votes
1answer
295 views

Ansible playbook for configuring runit to supervise an uberjar?

We are using Ansible 1.9 for deploying Spring Boot microservices. We are using CentOS 6 and the services are packaged as rpms. We intend to configure the executable jar files to be supervised by ...
8
votes
1answer
957 views

What are best practices of deploying docker-compose using Ansible?

Ansible is used to deploy docker-compose on a system and subsequently start the container. When ansible runs from the local system, the docker-compose file is deployed using Ansible. When the code ...
7
votes
2answers
6k views

Artifactory vs Git for Infrastructure Version Control / Configuration Management

I'm trying to understand the difference between managing configuration files for the purposes of simplifying automated deployment. We have 5 environments to build. So far 2 have been built with no ...
7
votes
3answers
1k views

Re-using Python virtual environments on a build server

Currently, every time we run a build through Jenkins+Ansible, we are re-creating a virtual environment and re-installing all the dependencies listed inside the requirements.txt file. This is very ...
7
votes
4answers
2k views

Ansible - private git repositories - SSH agent forwarding vs copying private SSH key

I recently started playing around with Ansible and it seems very nice. I don't have much experience in DevOps stuff and never really had to handle any complex scenarios. I started creating my Ansible ...
7
votes
1answer
433 views

How does Vagrant differ from Ansible and Docker?

I understand that Ansible is a Configuration Management (CM) tool for orchestrating, deploying (and continuously upgrading) software and conf via a special YAML format created for that software, and ...
7
votes
2answers
13k views

Ansible Playbook Localhost Invocation Working Directory

I want to run an ansible playbook locally (host is localhost, like -i "localhost,") and inside the Playbook obtain the working directory from which the ansible-playbook command was invoked. However, ...
7
votes
2answers
950 views

How to solve "E405: Remote package tasks should have a retry" in Ansible?

E405 v4.0.0 Remote package tasks should have a retry Package operations are unreliable as they require network communication and the availability of remote servers. To mitigate the potential ...
7
votes
1answer
766 views

Are there any best practices and/or tools for 'nohup' monitoring?

I use nohup for starting Ansible playbooks inside the Master which is spawned via boto3 from AWS Lambda. This playbook creates multiple workers, make them do some tasks, and terminates them. So, I ...
7
votes
1answer
720 views

How to implement Continuous Deployment in Angular, PHP API and Ansible projects?

I am working on an Angular2 project with Yii2 (PHP/MySQL) as its API point. We will need to deploy the Angular app in different languages for different customers (using AOT compilation from angular-...
7
votes
1answer
372 views

Does Ansible have component akin to PuppetDB?

I know Puppet from (limited) experience and have noticed that in configuration management there is now a strong trend towards Ansible. On the one hand, I understand that Ansible does not require an ...
7
votes
1answer
2k views

How to notate ipv6 addresses in inventory file?

I have a machine, that is accessible via ipv6 only. It is setup for ssh with rsa key. Now I'd like to manage it with ansible. Unfortunately, this is not covered in the inventory documentation. So I ...
7
votes
2answers
357 views

Three solutions to structure a deployment with Ansible?

I am currently deploying a new product and came across some problems to structure my Playbook and Roles. I have three different solutions and hope to get some input which path might be the best. The ...
7
votes
1answer
320 views

How to Versionize Ansible (Tower) with GitHUB

I have configured Ansible Tower with Centos 7.2 and I am able to see my Tower dashboard. My major concern is how to do versioninzation in Ansible Tower as given in this link with Github. Since I ...
7
votes
3answers
94 views

What are some clear benefits of running master/agent configuration management?

Ansible seems to have a clear advantage over competition like chef and puppet because it is agent-less and saves a certain degree of overhead. I have read several comparisons of the various ...

1
2 3 4 5
8