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
6
votes
2answers
9k views

How to log outcome from multiple hosts in Ansible?

I've a playbook that runs EOS commands against multiple devices. Currently the whole thing is done in bash, creates one massive text file log and an engineer compares each day's log to the previous ...
5
votes
1answer
200 views

Approaching user adds and edits with Ansible

I am going to be attached to a small project that basically organizes the users in a cluster of AWS Linux servers. The servers users assigned have different UIDS and maybe different GUIDs. I am hoping ...
2
votes
1answer
429 views

Deploying to VSphere with Packer and/or Terraform?

Scenario: Creating multiple VMs and deploying them to VSphere. Current development uses Packer and Ansible to provision a Fusion VM, with the aim of using Terraform to deploy to VSphere. Issue: I'...
4
votes
1answer
1k views

Multiple gradle builds with docker

I have a multi-branch setup on Jenkins for my Gradle project. I would like to be efficient in terms of performance and cost as well (money!). Meaning, if would like to build my project many times, for ...
2
votes
1answer
136 views

Error Vagrant Provisioning with Virtual Box on Fedora

I'm Provisioning Vagrant Box with Virtual-box on Fedora 26. $ vagrant -v Vagrant 1.9.1 $ virtualbox -v virtualbox 5.1 Below is the error; muhammadtaqi@localhost etc]$ vagrant up Bringing machine '...
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
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 ...
4
votes
2answers
2k views

How to create ansible host file on mac?

When I try to create ansible host file as follows: sudo vi /usr/local/etc/ansible/hosts When I try to save the file I get following error: "/usr/local/etc/ansible/hosts" E212: Can't open file for ...
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 ...
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 ...
5
votes
1answer
71 views

Storing Meta Data for Apps/tools

Have created a number of images via packer and soon coming to the conclusion that binaries/images soon rack up in qty and need to find away to store config data. We are going to use ansible to hold ...
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, ...
-4
votes
2answers
2k views

How to get Ansible playbook ouput in one line?

In Ansible we are running a playbook using ansible-playbook playbookname.yaml. The output will be multiple lines (like below). I need output in single line. How can I get that? PLAY [localhost] *****...
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 ...
6
votes
1answer
276 views

Six repositories as a single deployment Docker+CircleCI

I need some help and be pointed in the correct direction. I have 6 git repositories that together combine a bigger application (3 Node.js API, 2 React web apps and one repository for Ansible and ...
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 ...
1
vote
1answer
212 views

When setting up Foreman should this be setup on the same server as my puppet ro ansible master?

I am trying to setup Foreman to interface with my Puppet Master and Ansible installation. Do I need to have this on the same server or can it be by itself and make API/port calls? I am new to this ...
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/...
5
votes
1answer
3k views

Is it possible to combine jinja templates in ansible like this is possible with erbs in puppet?

It is possible to include a subtemplate in another Puppet template. <%= scope.function_template("subtemplate.erb") %>
2
votes
1answer
2k views

Ansible tmp files created with odd permissions

I have an ansible playbook which can be simplified to this: - name: Provision server hosts: all_hosts become: yes ...
5
votes
2answers
196 views

Decoupling data of devops tools eg jenkins nexus

Building devops pipe with tools such as Jenkins, Nexus, Hashicorp etc.. Deploying via terraform ansible & packer. Intending to use load balancers in front of each tool, want to deploy tools listed ...
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 ...
4
votes
2answers
1k views

How to detect what interface has private IP in Ansible

I plan to reconfigure iptables on our servers (mostly CentOS 7, some CentOS 6) with different network configurations, some on 1Gbit interface, some on 10Gbit, some with VLANs and some with configured ...
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 ...
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 ...
3
votes
1answer
358 views

How to ensure that removed allowed ports will be removed using Ansible's UFW module?

The UFW module document has been read, but it is unclear how to let ansible remove ports that are not defined anymore. It works to add new ports, but now 5 ports have been removed and I do not want ...
5
votes
2answers
2k views

Connecting to a Windows machine with Ansible

I'm trying to simply connect to a machine and run the win_ping module. There are several tutorials online that outline a few key steps: Create a directory ./windows Create a file hosts in ./windows ...
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 ...
5
votes
3answers
582 views

Baking Immutable Images

I am working on a project and we are trying to bake immutable images on containers as IaC. These images can have J2EE, .NET or Python apps on it. All OS patches should be applied to this image ...
2
votes
1answer
82 views

What Puppet modules do include best practices regarding CI and rspec-puppet like Geerlingguy's Ansible roles?

It is possible to test Puppet code using rspec-puppet, but modules that are supported by the community like NTP do not seem to run test regularly like is done for all Geerlingguy's Ansible roles, e.g. ...
5
votes
1answer
1k views

How do I dynamically take variables from previous plays in Ansible?

Example, I have 3 tasks, which are registered ec21, ec22 and ec23. ec22 runs when ec21 fails, and ec23 runs when ec22 fails. Now, I have another task below it which is : - name: Add new instance to ...
4
votes
1answer
741 views

Execute the whole Playbook serially

Adding serial: 1 to a Play will execute that one Play one host at a time. Is there something similar for the whole playbook? That is, all plays will execute only in one host, and when they are ...
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
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 ...
1
vote
1answer
82 views

Windows network share application deployment automation

We have a historically grown setup of interface applications that needs to be inventorized and cleaned up. Afterwards deployment should be automated and application versions somehow documented. My ...
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 ...
5
votes
2answers
519 views

Running Ansible no-op's faster with a dynamic inventory and cached facts files

I've got an ever expanding playbook that patches a few hundred machines to the latest version, I just add the same role with different parameters. Obviously, the playbook is taking longer and ...
5
votes
1answer
4k views

Ansible expected paths error

I have a webserver playbook containing the following: - hosts: webserver become: true roles: - apache2 - { role: demo_app, db_user: demo, db_pass: demo, db_name: demo } My folder ...
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 ...
1
vote
1answer
2k views

Why is ansible not sending the correct sudo password?

What does it mean when this: EXEC sshpass -d29 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no\ -...
32
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
12
votes
3answers
382 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 ...
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 ...

1
4 5 6
7
8