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
0
votes
0answers
8 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 ...
0
votes
1answer
29 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 ...
0
votes
1answer
27 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 ...
0
votes
0answers
7 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 ...
0
votes
0answers
9 views

How to log native commands run by Ansible Playbook

Ansible internally uses SSH Commands to run on the target machine . Is there a way to log the commands that are being executed ?
0
votes
0answers
18 views

HAProxy container, created with Ansible, is not responding although container is running

I have a playbook which deploys one HAProxy container and 2 Apache containers. Moreover, I also mapped ports and volumes in order to distribute client requests with HAProxy to Apache servers, but ...
0
votes
0answers
6 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 ...
2
votes
1answer
39 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 ...
2
votes
1answer
33 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 ...
0
votes
0answers
13 views

How to resolve template variables with values defined not in global level

I need to resolve variables in my jinja2 templates with variables defined in an inventory file NOT in global definition level: --- all: hosts: default: ... vars: objects: obj1: ...
0
votes
0answers
15 views

Ansible does not send multi email

i want to send a report to bunch of emails. when i have only one email address it works but when i want to send to multi email addresses it does not send anything. here is the code in playbook: - ...
0
votes
2answers
50 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 ...
-1
votes
2answers
38 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 ...
3
votes
1answer
34 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 ...
2
votes
1answer
18 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 -...
1
vote
0answers
39 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 ...
1
vote
1answer
21 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 : ...
1
vote
1answer
24 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 │   ├── ./...
1
vote
3answers
40 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 ...
5
votes
1answer
52 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. ...
1
vote
2answers
94 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 ...
2
votes
1answer
150 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: ...
2
votes
1answer
64 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 ...
3
votes
2answers
24 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/...
2
votes
2answers
112 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. - ...
1
vote
2answers
51 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: ...
1
vote
1answer
36 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 (...
0
votes
2answers
413 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 '...
1
vote
1answer
73 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 ...
0
votes
2answers
2k 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 ...
2
votes
1answer
28 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. ...
2
votes
2answers
44 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. ...
1
vote
1answer
630 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-...
-1
votes
1answer
44 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 ...
1
vote
2answers
639 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....
1
vote
1answer
28 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. ...
3
votes
1answer
259 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 ...
0
votes
2answers
153 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, ...
1
vote
2answers
72 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'...
1
vote
1answer
839 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 ...
1
vote
1answer
60 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 ...
2
votes
2answers
953 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 ...
0
votes
2answers
47 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", ...
1
vote
1answer
26 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: ...
2
votes
1answer
362 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 ...
2
votes
2answers
103 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 ...
1
vote
1answer
54 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....
3
votes
1answer
41 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 ...
0
votes
2answers
33 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 ...
1
vote
1answer
103 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 long time making use of keys and other credentials stores to make a stellar ansible inventory file, problem ...

1
2 3 4 5
7