Skip to main content
0 votes
0 answers
17 views

Finding all objects matching a neighboring key in XML

I have a playbook I am working on in Ansible that will allow me to identify a specific set of firewalls, and then update them to a higher version of software. However, I need to take the existing ...
Moridn's user avatar
  • 43
0 votes
0 answers
38 views

Ansible playbook fails on Windows environment

I have made some Ansible playbooks that retrieve information from hostvars to build a host inventory and upload it to a mariaDB database. It runs on our AWX server, myawxserver, a Linux machine. The ...
dr_'s user avatar
  • 2,315
0 votes
0 answers
44 views

Ansible playbook running a command on a server that's not in the host file [duplicate]

From within an Ansible playbook, after reading a file, I have retrieve two host names that are not in the host inventory file. On the two retrieve host names, I want to execute a UNIX shell command ...
John's user avatar
  • 1
2 votes
1 answer
86 views

How to parse multiple email addresses from json data in Ansible via map(regex_search) filter

I've been trying to parse email addresses from the below json data: "msg": [ { "fqdn": "www.westero.local", "function": "", ...
pilipeet's user avatar
-1 votes
1 answer
46 views

How to make Ansible templates ignore certain changes

We use Ansible to maintain a large distributed application, which keeps various credentials scattered among multiple configuration-files (in different formats, too!) These credentials aren't known to ...
Mikhail T.'s user avatar
  • 4,226
1 vote
1 answer
62 views

In Ansible YAML, how do I pass different variables to an include_tasks to make it reusable?

I have a workflow where I download a file, do some stuff to it, upload it, and then download it again to verify that the changes took place. I want my download logic to be in a reusable YAML file that ...
The Lemon's user avatar
  • 1,457
1 vote
1 answer
80 views

Ansible Automation Platform: How to pass variable into Python script?

In a Bash script we need to write $1 instead the variable, remove the read command, define the survey in the AAP to execute the Bash file, and add the arguments in the shell module. It works. Now, how ...
picgon's user avatar
  • 11
0 votes
1 answer
66 views

Why is a JSON list parsed by Ansible Jinja not an iterable [closed]

I am attempting to write an ansible playbook that will need to iterate over items returned from an API. I am getting a JSON response from the ansible.builtin.uri module which includes a JSON list. ...
albgus's user avatar
  • 23
2 votes
2 answers
76 views

How can I transform a list of dictionaries containing two keys into a string?

I created an Ansible role that is setting up cron jobs for a user in a wide variety of Linux distros and versions. The cron jobs to be set up are defined in crontab_entries variable. Also there are ...
Trifo's user avatar
  • 306
1 vote
1 answer
105 views

How to sum up numbers across inventory?

CSV files on each host contain certain figures and I need to add them all up. To that end, I find the matching files first, and invoke awk to parse the CSV content and output the per-host total. Where ...
Mikhail T.'s user avatar
  • 4,226
0 votes
2 answers
109 views

Ansible (Jinja2) Case Insensitive selectattr

I am looking to perform a case insensitive comparison in Ansible with selectattr. The below works, but does not guarantee a case insensitive comparison. __app_pools_info.app_pools | selectattr('...
Kimmel's user avatar
  • 667
2 votes
1 answer
54 views

Ansible code using with_sequence with when condition applied

- name: ABC block: - include_tasks: abc.yaml with_sequence: start={{ (x | int) + 1 }} end={{ y | default(1, true) | int }} loop_control: loop_var: item when: - (y | ...
Dodla Nirenitha's user avatar
3 votes
2 answers
92 views

Can an ansible collection query its own metadata?

Assuming an ansible collection with the following galaxy.yml file: namespace: my-company name: test version: "1.0.0" ... is there a way from a task in my collection to find the 1.0.0 in the ...
Wouter Verhelst's user avatar
1 vote
1 answer
78 views

Ansible `from_yaml` on a value from a vault

I am trying to use the from_yaml filter on a value stored in an Ansible vault. The exact same value works just fine when it is not stored in a vault value. - hosts: all vars: unenc_yaml: "...
Erik Ogan's user avatar
1 vote
1 answer
68 views

Ansible script is not generating a text document

I wrote a script to try and create a .txt document with a list of local user accounts across the enterprise. I'm not getting any errors, but it doesn't seem to create the document at the end with the ...
Will Burnside's user avatar

15 30 50 per page
1
2 3 4 5
1533