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.

27 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
523 views

Is there any way of getting code coverage with molecule?

I'm currently working on testing Ansible roles with Molecule. I have one role with 2 scenarios that are executed in Jenkins but just before that, those are submitted to a SonarQube analysis. So I ...
2
votes
0answers
54 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 ...
1
vote
1answer
26 views

How can I add an apt-key without using the hardcoded url in an ansible playbook?

I am completely new to ansible this is my second day working with ansible, What I'm ultimately trying to do is configure a kubernetes cluster which has a master node and one worker node. But my ...
1
vote
0answers
25 views

Power on AWS EC2 hosts by specifying their ansible hostnames

I have inventoried my AWS EC2 hosts using the ansible Ec2 inventory plugin. I would like to be able to power on hosts that are currently powered off, by specifying hostname patterns in ad-hoc ansible ...
1
vote
0answers
88 views

Docker mount volume on SELinux enabled server

I'm trying to run Nginx as the docker container on SELinux enabled server with mounted configuration as -v /host/path/nginx.conf:/etc/nginx/nginx.conf:Z That works fine till I will deploy updated ...
1
vote
0answers
15 views

Redirected `ansible-doc -s` output gets weirdly formatted

I'm preparing for Ansible certification, and I decided that ansible-doc -s may be useful to speed up creation of playbooks. It dumps a snippet of configuration of the requested module, with all ...
1
vote
0answers
342 views

Ansible/AWS dynamic inventory — How to create groups based on tags?

I am trying to create custom groups, based on tags. I am using this doc as a reference: https://docs.ansible.com/ansible/latest/plugins/inventory.html#inventory-plugins As a baseline, in my aws_ec2....
1
vote
3answers
527 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 ...
1
vote
2answers
507 views

Ansible fetch all vars files from a directory to generate a combined vars file

What I'm looking for is a task (or tasks) to read whatever .yml files exist in a specified folder and combine them into a file containing all the variables. For example: pets/steves_pets.yml: cats: ...
0
votes
0answers
6 views

How to ignore missing modules if they aren't needed?

Running with a tag that doesn't require most of the roles. ansible-playbook --tags=mytag ... But some unused role has dependencies which gives an error: ERROR! couldn't resolve module/action '...
0
votes
0answers
11 views

/wsman (Caused by SSLError(SSLError(\“bad handshake: Error([('SSL routines', 'ssl_choose_client_version', 'unsupported protocol')])\”)))"

I'm trying to ping to windows server 2008 via ansible from ubuntu. my host file is [win] 192.168.10.6 [win:vars] ansible_user=Administrator ansible_password="password" ansible_port=5986 ...
0
votes
0answers
24 views

Kubernetes deploy workflow

I have an application (Django web app alongside couple of microservices) and have done deployment previously via Ansible tasks. Playbook was invoked from Ansible Tower and essentially breaks down into ...
0
votes
0answers
3 views

end and disable a windows scheduled task for the duration of playbook execution

While deploying an application with Ansible, I need to make sure a related scheduled task (Windows) is not running and does not start. After deployment, the task should be re-enabled. One option is to ...
0
votes
0answers
15 views

Specifying cmd_args in containers.podman.podman_container

I am automating registration of gitlab runners to a podman v3.1.2 instance using ansible v2.10.9. Regardless of how I craft the cmd_args: parameter, I get a Python Class conversion error. The somewhat ...
0
votes
0answers
12 views

ansible linode inventory module not letting ansible or ansible-playbook use linodes' ipv4 addresses, despite getting them from linode api calls

Instead, when I run ansible or ansible-playbook, ansible tries to resolve the linode tag name assigned to the host as inventory_hostname in ansible inventory, instead of actually using the ipv4 ...
0
votes
0answers
24 views

Ansible does not send Email

I have 2 Ansible jobs. Both of them compare files to find their differences. One of them is for crontab and the other one is for users. They are run first of each month and send their report via Email....
0
votes
0answers
124 views

How to clone or remote pull-through galaxy.ansible.com with GalaxyNG

I setup a GalaxyNG server (which is a Pulp Project plugin) to act as an Ansible Galaxy repository on an isolated network. The server will periodically have internet access to sync with it's upstream ...
0
votes
0answers
17 views

How to integrate Certbot with Ansible managed NGINX config?

I'm using Ansible to manage NGINX server configurations, i.e., my playbooks contain some roles that roll out NGINX server config templates. This is my first contact with the topic SSL and I've been ...
0
votes
0answers
95 views

Error passing multiple EXTRA_VARS to Ansible playbook

DISCLAIMER: My question is NOT a duplicate of this question. I am trying to run a playbook with two vars passed to it. Here's the playbook: [ andriim@mtr-vdi-273 ~/work/NFSoRDMA ] $ cat ansible/...
0
votes
1answer
32 views

Error 502 before execute Ansible playbook

I execute an Ansible playbook with an ansible user. The playbook executes properly, with no errors in the application log, no errors in the Ansible log. This .war usually deploys with user "...
0
votes
0answers
165 views

Handling configuration drift with Ansible

A criticism of Ansible being that it's not declarative, in that, if it's used to spin up n number VM's, and then need an additional one, it's not n+1 but just 1. Referencing: Playbooks and ...
0
votes
0answers
16 views

Online help for playbook keywords

Ansible has a pretty decent online documentation using the command ansible-doc; using -t and -l, one can even learn some new stuff that Ansible is capable of, with that command. However, I can't find ...
0
votes
1answer
2k views

Ansible playbook error: “Connection timed out during banner exchange”

I am trying to connect to my bastion host and then tunnel that ssh connection to connect to a jenkins host but keep running into the connection timed out error. The error message in full is: fatal: [&...
0
votes
0answers
162 views

How to automate Asterisk on Kubernetes with Ansible?

From thirty-thousand-feet, how would I use an existing ansible playbook in the context of Asterisk using Kubernetes? Or, coming at this in a step-wise fashion, what's the smallest indivisible portion ...
-1
votes
0answers
25 views

deploying my public key to multiple ec2 instances

I wrote a playbook to deploy my ssh keys across multiple instances. This my playbook, but I am experiencing some problems with it. I already created my ssh keys from my local instance. Please see ...
-1
votes
0answers
156 views

Correct usage of community.aws.ec2_instance_info module in a playbook

I have successfully authenticated to AWS and pulled an inventory using the aws inventory plugin. I'm interested in getting facts about instances. The documentation says that this playbook should get ...
-2
votes
0answers
18 views

Ansible with azure cli to create vm with azure password and user ID

I have followed this article https://docs.ansible.com/ansible/2.3/guide_azure.html. IN this when I used service principal it works fine but when I tried using [default] ad_user=XXXXX password=YYYYY ...