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
2
votes
1answer
17 views

Where does multi-role variable goes in Ansible?

There are multiple kind of variables in Ansible. And I find it overwhelming to wrap my head around them. Some of them are: The one we can write in roles//vars/main.yml The one we can write in the ...
-1
votes
0answers
14 views

if im correcting ansible-lint error then ansible-playbook showing error [closed]

ansible-lint error: ansible-lint ansible.yml [301] Commands should not change things if nothing needs doing ansible.yml:7 Task/Handler: ports [306] Shells that use pipes should set the pipefail option ...
0
votes
0answers
7 views

ansible network automation: log commands in checkmode, mutiple plays [closed]

How to gather all the lines executed each devices, using modules from multiple tasks and multiple plays ?
2
votes
1answer
65 views

Ansible playbook error: Collection' object is not callable

I am learning ansible on my local vagrant vm machine and I am setting up mongodb using ansible and I keep getting the error: An exception occurred during task execution. To see the full traceback, use ...
0
votes
1answer
27 views

Ansible to get AWS SSM Parameter Store value but fail to decrypt secure strings

I need to lookup a value from AWS SSM Parameter Store, but it needs to fail if the parameter type is secure string. I do NOT want secure string parameters to be decrypted, and I want to detect their ...
2
votes
1answer
88 views

How can I determine an Ansible client's IP address in an OS-independent manner?

I have an Ansible environment in which machines are listed by hostname in the inventories. Occasionally, it is necessary to determine the IP address of a target machine in a playbook (note: in this ...
2
votes
2answers
64 views

How to loop through json without an array

I am trying to work out how to iterate over some JSON that has repeated structures but have not used a list. I am using the ansible.posix.firewalld_info module and it returns a dictionary for each ...
0
votes
0answers
19 views

Filtering included data for specific criteria to run tasks

I have directory with yml files in there which set parameters for different instances of the software I'm to deploy. It looks something like this: instance1: ip: 127.0.0.3 servername: mycoolserver ...
0
votes
0answers
22 views

Ansible playbook - defining var based on condition

I want to create a var based on condition so I created the below : tasks: - name: set IN_PROGRESS backup folder set_fact: v_target_backup_folder_in_progress: >- {% if node_type == &...
2
votes
1answer
27 views

What are minimum permissions required for an IAM user to provision EC2 instances?

I want to provision an EC2 instance with Ansible. So for that purpose I want to create a separate IAM user to keep things clear. I can assign the full EC2 access to the user. But I don't want any ...
0
votes
0answers
25 views

Сontrol Windows-containers from Ansible directly through "docker" connection-plugin

Is it possible to control Windows-containers from Ansible with "docker" connection-plugin? I.e. with ansible_connection=docker in inventory-file? My current environment: Running dockerd -H ...
0
votes
1answer
38 views

Ansible Playbook always interactively asks for Become password, even though no become user is specified?

I have a simple ansible playbook that copies a script and executes a script on an EC2 instance. - name: Playbook Deploy jar hosts: all remote_user: ubuntu tasks: - name: Copy Provisioning ...
0
votes
0answers
97 views

Ansible in venv: how to pip install globally on localhost?

Ansible is installed and is running in a virtual environment: (env) ansible-playbook -vvvv -i localhost playbook.yml I'm trying to install a Python package globally, but it either installs in venv ...
1
vote
0answers
17 views

Filter jobs by inventory

I'm using Ansible AWX and I'd like to find all jobs that were done for a specific inventory , I can do that by going to the inventory and then in the "completed jobs" tab, but is there a way ...
0
votes
1answer
34 views

Copy and unarchive Ansible Module

I tried below ansible tasks with copy and unarchive modules and facing error - name: find and archive hosts: localhost tasks: - name: find the file copy: src: "{{ item }}&...
0
votes
1answer
16 views

How to prompt when win_service service exists?

I'm trying to figure out the steps needed to get when or other conditionals to react when service is present on hosts targeted on my task. With this I get report that service is on one of the nodes ...
1
vote
1answer
119 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
36 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 ...
2
votes
1answer
155 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
22 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
35 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
12 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
45 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
41 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?
2
votes
1answer
204 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
61 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 ...
0
votes
1answer
30 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.
1
vote
1answer
60 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
139 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
126 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
1answer
42 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
65 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
109 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: ...
2
votes
1answer
107 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 ...
1
vote
1answer
46 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 ...
0
votes
0answers
121 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
1answer
56 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 ...
1
vote
1answer
144 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
1answer
254 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
424 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 ...
1
vote
1answer
32 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....
1
vote
1answer
132 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 ...
0
votes
1answer
118 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
1answer
76 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
3answers
612 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 ...
2
votes
1answer
177 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
2answers
356 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" ...
1
vote
1answer
50 views

Looping an Array with Missing Keys in Ansible Tasks

I'm attempting to create an Ansible Role to create users... I want it to be able to accept a list of dicts and if a key is missing from the dict, it will fall back to Ansible's default. For example, ...
1
vote
1answer
69 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 ...
0
votes
1answer
254 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
2 3 4 5
8