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
1answer
40 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 "...
21
votes
3answers
26k 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 ...
0
votes
2answers
517 views
+100

How are ansible playbooks supposed to be imported into a collection?

I'm trying to develop a reusable collection of playbooks that I can run from docker containers. I don't want to share duplicate code between containers and I don't want to have containers that run ...
0
votes
1answer
17 views

Why does Ansible ignore tasks after failing?

My ansible playbook has a task named 'Copy the build script to the system and run it'. It is prone to errors, so I've created a debug task to debug it: - name: Copy the build script to the system and ...
1
vote
1answer
25 views

ansible Unsupported parameters for (command) module:

I'm trying to run a shell command in an ansible task but I keep getting an error. This is the task item and the shell command I want to run: - name: Set File Watch Limit ansible.builtin.shell: ...
0
votes
1answer
13 views

Testing for EL with Ansible facts; distribution or os_family?

Sometimes in an Ansible playbook, you'll want to condition running a task on whether or not the distribution is CentOS, RHEL, etc, or if it's something else. A very common example is when a package is ...
1
vote
0answers
12 views

Ansible : 'NetworkManagementClient' object has no attribute 'private_endpoints'

I try to deploy a private endpoint for a storage account with Ansible. I am using azure.azcollection.azure_rm_privateendpoint. My playbook code is as below: - name: Create PE hosts: localhost ...
0
votes
0answers
11 views

Github deploy keys - success with Curl, failure with Ansible

I'm trying to learn Ansible. One of my tasks is to have Ansible add deploy keys to github for a project. This command runs perfectly fine from bash command line: # replace blahblahblah with ...
0
votes
1answer
8 views

Ansible user_module exit with "rc: -25" if UID is large

Ansible user_module exit with rc: -25 if trying to create user with UID provided from Active Directory (AD) domain controller (DC). main.yml - name: Configure local user for example.com user: ...
0
votes
0answers
33 views

Ansible Tower on a Free Linux Distro?

Red Hat's Ansible Tower's documentation states that it can only be run on Red Hat Enterprise Linux. I can see once upon a time it could be run on other distros, such as Ubuntu. Is there a free Linux ...
0
votes
1answer
27 views

How to check the status of Ethernet port using ansible?

I want to check status of Ethernet port whether it is up or down on remote server using Ansible?
0
votes
1answer
27 views

How can I detect if an Ansible playbook is executed by ansible-pull rather than ansible-playbook?

I am looking for a when condition which is fullfilled when the playbook is executed by ansible-pull.
2
votes
1answer
57 views

What do skipped, rescued, and ignored results mean in ANSIBLE playbook execution?

What do skipped, rescued, and ignored results mean in an Ansible playbook execution? What would be a possible scenario where these results would be different from 0? PLAY RECAP ************************...
1
vote
2answers
45 views

Dynamic environments per client, which is the best approach, if any?

I don't know how to explain this problem better, but I'll try to explain it clearly: Where I work our customers are companies, with lots of users We offer a SaaS solution for them to manage stuff For ...
1
vote
1answer
78 views

Ansible with OpenSUSE transactional server

When using an OpenSUSE transactional server, transactional-update must be used instead of Zypper. Is there any way of doing this with Ansible?
1
vote
1answer
39 views

Can not install mysql client and server using a playbook Ansible

Do you know how I can fix this error? I'm getting 404 response from my node machibe when I'm trying to install default-mysql-client and server using Ansible-playbook apt module or shel. Facts I do ...
1
vote
1answer
67 views

How to add a string to a line when it doesn't exist?

I'm trying to solve a problem where I want to add a setting 'pci=noaer' to all kernel definitions in /boot/grub/grub.conf, but only if the setting doesn't exist. I've managed to get the basic ...
1
vote
2answers
678 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: ...
1
vote
1answer
50 views

Ansible cli_command loop register issues

I can't seem to get the register to works with cli_command and looping of multiples commands. Any suggestions? - name: Run show commands hosts: - all connection: network_cli gather_facts: ...
1
vote
1answer
36 views

Root ssh key for ansible control node

Scenario: Deploy 30 VMs using terraform and then run ansible - how many ssh keys do you generate? Virtual machine definition in terraform requires administrator ssh key or password provided. Do you ...
1
vote
1answer
51 views

Ansible: Does the `hosts: all` pattern in a play only match hosts specified in inventory, or does it also match playbook `add_host` hosts?

I know "all" doesn't match the implicit localhost; the title succinctly expresses my question. Motivation: I have a playbook that needs to be run on cloud hosts generated dynamically and ...
1
vote
1answer
41 views

Strategies for sharing Ansible vaults with root/administrator credentials?

Historically we've been a one man devops team and stored all our passwords in Ansible vaults - including things like domain admin passwords and root account passwords. However we're now growing and ...
2
votes
1answer
72 views

Using ansible to update remote Ubuntu servers that have no external internet access

I am quite new to Ansible, and have to been able to use it to install packages on 80 remote Ubuntu servers that have no external internet access. Is it possible to use Ansible to update/patch these ...
3
votes
2answers
2k views

Ansible configure and compile in directory

So I have have an Ansible Task that extracts a programs sourcecode zip into a certain directory and is then supposed to compile and install it. The extraction of the zip works fine, but then I need to ...
1
vote
1answer
91 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 ...
0
votes
1answer
4k 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
1answer
49 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 ...
33
votes
3answers
56k 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 ...
0
votes
0answers
74 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 ...
1
vote
2answers
6k views

Waiting for privilege escalation prompt

I'm new with Ansible so hope to find answers here. I'm trying to run some playbook but getting an error: fatal: [10.65.30.117]: FAILED! => { "msg": "Timeout (12s) waiting for privilege ...
1
vote
1answer
198 views

Ansible - using facts from one host to perform actions on another host

In Ansible I'm trying to generate a variable from a task on one host and then use the variable to do something to another host. Specifically, I'm trying to create a Kubernetes cluster - On the control ...
1
vote
1answer
362 views

ansible-playbook: how to dynamically, conditionally set a large deployment environment (variable space) in a playbook?

I am using an ansible playbook to deploy a php web application in aws. The deployment is repeated many times, with a different environment, for each customer. The different scenarios range from ...
3
votes
1answer
1k views

How to get the device name of a specified mount point with ansible facts?

Using Ansible facts I can get the list of "ansible_mounts": "ansible_mounts": [ { "block_available": 423698, "block_size": 4096, "...
0
votes
3answers
3k views

Using `dig` Ansible module?

I am trying to look up the IPv4 address (a single one, which I will assert on!) for a given name using Ansible and use that as a fact "down the line". An MWE looks like this: --- # vim: set ...
0
votes
1answer
94 views

Unexpected type error in ansible community.aws.cloudfront_distribution: "origins" parameter: "'list' object has no attribute 'get'"

I get an unexpected type error, for what I assume to be the "origins" argument to the community.aws.cloudfront_distribution module: "Error validating distribution origins: 'list' object ...
2
votes
2answers
343 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 ...
5
votes
3answers
3k views

Validating certificates with get_url or yum on CentOS 7 using Ansible

I'm pretty new to Ansible, but it seemed a better tool than a bash script for installing programs from source on remote servers... Starting from my working-but-fragile bash script, I made an Ansible ...
1
vote
1answer
22 views

Are package facts getting invalidated automatically when I install remove packages?

In Ansible I can use a task such as: - name: Gather the package facts package_facts: manager: auto to gather the package facts and a condition such as: when: "'foobar' in ansible_facts....
3
votes
1answer
6k views

Traverse nested dictionary with keeping the keys in ansible

I'm not able to loop a list in a dict and keep the key of the original dict. Bellow an example of my data vars: nginx_users: 'instance1': roles: - product - ...
2
votes
1answer
99 views

Problem with Ansible Asynchronous actions

I'm trying to run two simple tasks Task A starts an Ipref3 server and waits for a client to connect Task B starts to run from host-1 until the given timeout once Task B (host-1) is over another Task B ...
1
vote
1answer
77 views

Ansible Playbook fails start Apache Cassandra

I have been tried ran a Ansible Playboo, but after change the cassandra.yml when the service tries start I received this error bellow: ● cassandra.service - LSB: distributed storage system for ...
2
votes
3answers
784 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
55 views

Ansible - Variable expansion inside hostvars declaration?

I have a hardcoded hostvars line, like so: node1_hostname={{ hostvars['192.168.0.162']['node1_hostname'] }} I have a set_fact variable from a previous play that I'd like to expand in the host section ...
2
votes
1answer
5k 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 ...
0
votes
1answer
396 views

Ansible multiple commands to a file

You can see bellow how it looks like my Ansible Script. My question is what i need to change to get output from multiple commands to a file.The problem is that i get output only from the first command....
1
vote
1answer
48 views

Ansible - Azure resource referencing

My aim is to have my vnet and subnet in a seperate resource group from the other parts of my infrastructure i.e Virtual Machines. I have a short playbook that creates the resource group for my network ...
1
vote
2answers
246 views

ansible & jinja2: How to reference JSON structure items whose keys are variables?

I am using ansible's community.aws.iam_server_certificate_info module to get information about a server certificate on aws ec2, and registering it as a variable "server_cert_info_result" ...
2
votes
3answers
424 views

Add item(s) to yaml array only if defined (ansible)

How do I write a yaml file such that it defines an array with a list of values, and it skips those values from being added to the yaml array if the given value is undefined? Specifically, I'm trying ...
0
votes
1answer
186 views

How can we prepare GitLab runners using Ansible deploys

Given We run an in-house GitLab server, with many projects (aka "repositories") We provision all servers using Ansible (and deploy projects using pip) We deploy to dev.project.example.com ...
1
vote
1answer
96 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. ...

1
2 3 4 5
8