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
1 vote
1 answer
37 views

Are there serious problems with an EC2 auto-scaling AMI that automatically downloads newest server from git?

I'm converting some servers from manual scaling (with a load balancer) to auto-scaling. I'm currently using an Ansible script to manage upgrades, and I wouldn't want an automatically created instance ...
piojo's user avatar
  • 161
1 vote
1 answer
120 views

Snake bites its tail problem automating configuration of Certbot with Ansible

I have a public web-site with Nginx in front of it. We use free Letsencrypt certificates to set up https. These are acquired and renewed by Certbot program. I want to implement entire servers ...
Gherman's user avatar
  • 63
0 votes
1 answer
1k views

Installing ingress controller, services and pods on K8s via Ansible

I've 3 Debian-10 VMs on a bare metal Proxmox host in my network and installed via Ansible the roles geerlingguy.docker and geerlingguy.kubernetes with complete default settings. The kubeadm on the ...
TRW's user avatar
  • 313
1 vote
1 answer
528 views

Include pre- and post_tasks transparently for all Ansible roles

I am looking for a way to execute some actions before and after each role has run. pre_tasks and post_tasks look like a good candidate, but I have found no way to include them transparently for all ...
random_dude's user avatar
1 vote
2 answers
980 views

How to log native commands run by Ansible Playbook [closed]

Ansible internally uses SSH Commands to run on the target machine . Is there a way to log the commands that are being executed ?
sashank's user avatar
  • 111
2 votes
3 answers
2k views

How to automate the key exchange in WireGuard when you deploy a cluster of machines?

Let's assume you want to deploy a cluster of machines on Hetzer Cloud. For simplicity let's call them worker1, worker2, worker3. They need to communicate with a server called master, which will be ...
Philipp Claßen's user avatar
2 votes
1 answer
48 views

Improving deployment process of agent software

I'm a developer on an agent software team, researching ways to streamline the mass deployment of our agent on clients' machines. Currently the process involves running a script to determine the exact ...
Itamar G's user avatar
  • 123
2 votes
1 answer
60 views

Clarification about Operational Support System

I just started my career as a BA. As the first task, I have to study about operational support systems like ansible tower. I could not find any references to study about this. What are the similar ...
hansinee nawanjana's user avatar
4 votes
2 answers
5k views

how to set a variable from an ini file in ansible?

I would like to set a variable value in a playbook reading it from an ini file, possibly failing the play if the file is not found or the value is missing in the file. I have found the ini lookup ...
a1an's user avatar
  • 201
-1 votes
2 answers
80 views

A tool to orchestrate cloud server (virtual machine) instances

Whenever I use search keywords such as "orchestration" or "server clusters" or "iaas" I'll always end up in hundreds of results that are going to talk about containers ...
Mike's user avatar
  • 99
3 votes
1 answer
131 views

Tying playbooks together

Say, i have written bunch of ansible roles and playbooks, configured my playbooks structure and now i'm trying to tie them to one playbook which will do its thing depending on tags or inventory file ...
bob-the-builder's user avatar
2 votes
1 answer
84 views

How do a flaten a list mixed with nested dict in ansible playbook?

I have a variable named packages as showed below, it is not a plain list, I have some nested dict in it like browsers. --- packages: - apt-file - axel - ibus-rime - rofi - i3 - ffmpeg -...
Roy's user avatar
  • 31
2 votes
1 answer
695 views

straight python alternative to ansible

Can anyone recommend an alternative to Ansible that lets one write straight Python code? In my group, we're finding that expressing pretty simple logic in Ansible ends up being too time-consuming and ...
Mike's user avatar
  • 123
1 vote
1 answer
623 views

How to sort displayed tasks in the order they were run rather than by the time it took each task to run?

I've configured ansible.cfg to display the steps it has done during a playbook run and it looks like so: =============================================================================== common : ...
Itai Ganot's user avatar
1 vote
1 answer
343 views

Ansible: how to display the name of the currently running included_tasks playbook file?

I wrote an Ansible role which does lots of things, it's called "common" and all Ansible hosts are using it. The directory structure is as follows: ./common │   ├── ./common/README.md │   ├── ./...
Itai Ganot's user avatar
1 vote
3 answers
291 views

Run integration test with ansible playbook using terraform provisioning

Ok so I am totally new to devops! I am an experienced developer, but at my new job I have been tasked to automate CI/CD. Non-existing so far. Only CI with Travis. So the ideal workflow is: Push to CI ...
transient_loop's user avatar
5 votes
1 answer
983 views

Ansible: Use inventory_hostname variable in lineinfile module

I'm using Ansible 2.7.9 and I'm having trouble with the regex definition in the lineinfile module. My file has the following line: host.example.com = /path/to/a/directory I want to remove that line. ...
Jonas Hüsser's user avatar
1 vote
2 answers
184 views

How do we move to a modern CICD approach

This may also be a general pulse; but here lies the issue We use EKS, we have Jenkins, we have Ansible, we have Terraform, we have BitBucket; but none of these really form a pipeline and I'm stuck ...
c0rruptbytes's user avatar
4 votes
1 answer
5k views

Doing map and filter of a list of dictionaries in ansible

Given a list of users: # Python Syntax users = [{'name': 'alice', 'sudo': True}, {'name': 'bob'}, {'name': 'charlie'}] # YAML Syntax users: - name: alice sudo: yes - name: bob - name: ...
RincewindWizzard's user avatar
2 votes
3 answers
548 views

Ansible event driven capacity

I've been using SaltStack a lot in my previous job, and loved its event driven model. Now, in my new job, we are using Ansible, and definitely not in an event driven model. I was wondering if there ...
Pier's user avatar
  • 344
3 votes
2 answers
38 views

Install apache on awa ec2 from locally installed ansible server on my laptop

I would like to install apache2 remotely on aws ec2 instance from my locally installed ansible server on my laptop. I have also the. pem key of the instance. Now what Ip need to put in /etc/ansible/...
Rajesh k's user avatar
3 votes
2 answers
4k views

Combine Lists of Objects in Ansible

I'm really trying to merge lists of objects along with defaults so I can loop over them and create resources in kubernetes. I've gotten it down to a simple(ish) playbook and will post it here. - ...
David Brown's user avatar
1 vote
2 answers
1k views

How to sync two directories on same host using Ansible?

I am using the below playbook for mounting partitions on another EBS volumes while provisioning instance on AWS --- - name: Mounting necessary partitions hosts: localhost become: ...
Santosh Garole's user avatar
1 vote
1 answer
419 views

Ansible seems to execute infinite loop

I wrote some roles for my home lab to setup a GlusterFS cluster. But when I run it on my 2 nodes, some tasks get executed over and over again and it seems that it never ends. Here is the log output (...
dfsg76's user avatar
  • 207
1 vote
2 answers
6k views

Ansible: When 'directory/file exists' in a loop

I have written some Ansible code to put users from the users.yaml file in the variable 'nexus_local_users' to be used by a role. When doing this a random password is created and written to the '...
Gijs Peerlings's user avatar
5 votes
2 answers
10k views

Ansible warning that host key has changed, even though I've taken multiple steps to prevent this warning

I've followed the recommendations I could find to prevent this from happening. I am using Vagrant, but once the boxes are spun, I'd like to do things with the ansible command sometimes. $ grep ...
Ken - Enough about Monica's user avatar
2 votes
2 answers
26k views

How to run multiple commands with command module in Ansible

I want to run couple of commands in ansible playbook I am trying below: - name: Running multiple cmds command: - | cmd2 cmd2 cmd3 cmd4 But i am getting an error on ...
Santosh Garole's user avatar
4 votes
1 answer
450 views

Creating ec2 instances and installing mongoDB using automation

I am trying to create a 3 node MongoDB replica set using automation (ansible or terraform) in AWS. I am able to do this in the management console of AWS, but I'm not sure how to approach it. ...
prim3's user avatar
  • 41
2 votes
2 answers
73 views

I don't fully understand how to use variables in Ansible roles

Original question: I want to roll out a partitioning layout for a home lab setup of GlusterFS and also want to do it using Ansible so I can re-use the configuration for a more stable setup later on. ...
dfsg76's user avatar
  • 207
7 votes
1 answer
5k views

Creating Keycloak Realm via Ansible

Currently there is no module to create a Keycloak realm with Ansible. There is a PR but it is stucked since half a year or so. So I though, there is a Keycloak REST API (https://www.keycloak.org/docs-...
TRW's user avatar
  • 313
-1 votes
1 answer
168 views

Can't ping client on ansible ,

$ ansible 192.168.254.150 -m ping [WARNING]: Unable to parse /etc/ansible/hosts enable callback plugins as an inventory source [WARNING]: Unable to parse /etc/ansible/they can output to stdout but ...
Tazhar Masood's user avatar
5 votes
2 answers
12k views

Custom inventory file failing to parse properly

I've got the following production inventory file (playbooks/production.yaml) for Ansible: all: children: control: moriarty.server.com toby.server.com managed: sherlock....
Lucky The Rabbit's user avatar
1 vote
1 answer
180 views

Provisioning raspbery pi sdcard

I was searching for a tool suitable for provisioning sdcard for raspberry pi. I've successfully managed to implement most of it using Ansible playbook. Need only some time for last polishing. ...
majkrzak's user avatar
4 votes
2 answers
2k views

Including vault-encrypted variables in a task

I just recently started to use Ansible, and am trying to deploy a configuration file that contains a secret key and email (for credentials to use with an API). I encrypted them with ansible-vault ...
Lucky The Rabbit's user avatar
1 vote
2 answers
4k views

ansible filter debug output

I have the following output resulted from a shell command which is run on ansible on every host from my inventory: TASK [debug] ok: [10.240.22.44] => { "msg": { "changed": true, ...
Bogdan Stoica's user avatar
4 votes
2 answers
20k views

Ansible temp dir change

Ansible version 2.9.2 Is it possible to change ansible temp dir for one playbook only? I have VMs with r/o root. So, the playbook fails. Even if I run my playbook under root user on target VM it can'...
Kirill Vakhrushev's user avatar
3 votes
1 answer
11k views

Ansible execute task on different hosts in order

Is it possible to use ansible to manage order of programs? Im trying to find an automated solution which will do the following steps: run a program on HostA run a command on HostB which requires ...
Richie G. Edward's user avatar
1 vote
1 answer
230 views

How to manage images versions via docker-compose with Ansible

I planned to use docker-compose and a few scripts to manage the deployment of my app on staging and production. My idea was to use one docker-compose.yml with one .env file for each environment. In ...
gervais.b's user avatar
  • 155
2 votes
2 answers
3k views

Ansible - Copy multiple files

I am trying to copy multiple files to the target like so: tasks: - name: "Copying files" copy: src: files/{{ item }} dest: /my/folder/ with_items: - file.txt The files ...
Kyu96's user avatar
  • 125
0 votes
2 answers
270 views

Cannot install Ansible

So I am creating a packer template for docker with the image php:7.0-apache. I added a shell provisioner where I try to install ansible so I can provision the image: { "type": "shell", ...
Kyu96's user avatar
  • 125
1 vote
1 answer
41 views

Ansible: Backing up variable value doesn't work as expected

Attempting to save a variable's value for backup before modifying it doesn't work. I have the following inventory file (note the custom ansible_port and user): all: hosts: test: ...
PaperTsar's user avatar
  • 113
2 votes
1 answer
3k views

Azure Powershell DSC or Ansible

I wanted to find out what are you using for Desired State Configuration on your end. I am thinking to start introducing Azure Powershell DSC or Ansible for DSC of our on-prem environment and cloud ...
bluehatgeek's user avatar
3 votes
2 answers
3k views

Ansible ad-hoc command to reboot servers in serial with a pause

How do I go through all hosts in an Ansible inventory in serial with an Ansible ad-hoc and reboot servers with a specified number of seconds in between each reboot? I am looking for something similar ...
David West's user avatar
  • 1,413
1 vote
1 answer
354 views

How to filter vmware_vm_facts

I'm trying to pull out the "uuid" from facts returned by ansible's vmware_vm_facts module. There is a solution to a similar question posted on Reddit, but when I try that, it fails with 'ansible....
richf's user avatar
  • 21
4 votes
1 answer
629 views

I'm trying to run `vagrant provision` on PowerShell Window for Ansible playbook

Here is what it replies: Windows is not officially supported for the Ansible Control Machine. Please check https://docs.ansible.com/intro_installation.html#control-machine-requirements What should I ...
Thi Nguyen Hoang's user avatar
0 votes
2 answers
82 views

How to run Ansible command to update imunify360 settings

How can I use Ansible to run the following CloudLinux Imunify360 commands properly on CloudLinux 7 (similar to CentOS7)? I tried different ways to "escape" the colons in the commands and it doesn't ...
jwalker's user avatar
  • 27
7 votes
3 answers
3k views

Using SSH to open interactive session in ansible

Is there a semi-easy way to use Ansible to open an interactive session? I've spent a good amount of time making use of keys and other credentials stores to make a stellar ansible inventory file. ...
Peter Turner's user avatar
  • 1,376
2 votes
2 answers
1k views

Configure VPC for ECR access

I am creating my infrastructure with Ansible. I create a VPC and an ECS cluster where I use Fargate to run my docker containers. When the tasks are started I am prompted that the task was not able to ...
Kyu96's user avatar
  • 125
2 votes
1 answer
79 views

How to test production Ansible execution without having to provision target

We use ansible for our day to day operation and so far so good. We have been looking for a way to run local test etc just like chef guys and found molecule that we use with testinfra/vagrant. While I ...
black sensei's user avatar
3 votes
2 answers
229 views

What is the most used tool for Cloud Infrastructure deployment Ansible vs Puppet vs Terraform?

I have some time for research at work right now, and I was thinking on expanding my knowledge on my favorite subject, which is DevOps (love you all). I have some advanced experience with Ansible, as ...
jasper's user avatar
  • 55

1 2 3
4
5
9