1,863 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
82
views
After python and ansible upgrade getting error "/bin/sh: /bin/env python: No such file or directory"
I upgraded python and ansible on an env after which started getting error "/bin/sh: /bin/env python: No such file or directory" in ansible-playbook execution, below are the upgraded versions
...
0
votes
2
answers
997
views
Use ansible-dev-tools with uvx
When installing ansible-dev-tools into venv with
python -m venv .venv
source .venv/bin/activate
pip install ansible-dev-tools
All the provided executables are located at .venv/bin and are executable ...
1
vote
0
answers
263
views
access to attribute 'update' of '_AnsibleLazyTemplateDict' object is unsafe after update to 2.19.0b4
I have the following ansible file:
---
- hosts: all
roles:
- exclude_duplicates
tasks:
- name: Update apt repo and cache on all Debian/Ubuntu boxes
apt: update_cache=yes ...
0
votes
0
answers
40
views
ansible.builtin.git: diff mode together with check mode not showing diff if version is set to commit sha
I have cloned the repository in $HOME using git clone --depth=1 https://github.com/gauravpathak/zynq-zc706-buildroot-webserver.git
I have this directory structure of files for one ansible playbook:
.
├...
-1
votes
1
answer
67
views
How to get corresponding _facts in Ansible Custom Module?
I'm creating some Custom Modules to help with setting up conan.
I've got a conan_remote_facts module which gets some facts about the current conan setup and I'm working on a corresponding conan_remote ...
0
votes
3
answers
63
views
Why does the result from the shell module in Ansible contain the dictionary twice when I print result?
I'm trying to execute a shell script on a localhost using Ansible and display the output of the script. I've registered the output of the command using the shell module and stored it in the result ...
0
votes
1
answer
95
views
Redirecting selected logs
Is it possible to selectively redirect some of the console logs to file?
E.g.,
- name: "Installing service1" // This msg should go to CONSOLE and file.
host: localhost
tasks:
- ...
1
vote
1
answer
47
views
ansible playbook uses group_vars default values instead of the ones defined in the vault
I have the following structure:
|- group_vars/
|- local/
|- local.yml
|- roles/
|- myrole/
|- vars/
|- main.yml
groups_vars/local/local.yml:
myvar: <FIXME>
roles/...
1
vote
0
answers
119
views
How to pass a ansible vault password file while using ansible_runner in a python script
I have a very simple Python script to run an Ansible playbook (A post call to get an access token from the OAuth2 authorization server and save it in a .txt file).
I have secrets stored in ansible-...
0
votes
1
answer
76
views
Can't get jinja2 template working in URI module
I try to pass a json to the module uri to make an API call.
If I put the full json in the body parameter, it works well:
body_format: json
body:
authorization_enabled: true
...
2
votes
1
answer
80
views
How to concatenate variable and the string inside filter?
I'm trying to write a role that finds difference between records in DN servers and records in Git. Some of them were added manually via Web interface.
For that purpose in my Ansible playbook I ...
0
votes
1
answer
270
views
Create an ansible collection and use it on a playbook from gitlab
I created an ansible collection with 2 roles for deploy node_explorer and configure firewall. I'm on ansible 2.12
This is the root directory in the gitlab repository where it's stock (generate with ...
1
vote
1
answer
328
views
Managing Nginx vHost Conf Files with Ansible
I'm new to the automation world and I'm stuck trying to figure out how I can automate and maintain Nginx conf files for the vhost I manage using Ansible.
For example, normally I would create a conf ...
0
votes
1
answer
137
views
How to run a role on a host dynamically determined at runtime
I'm looking to migrate app config from one host to another. The tasks to be ran on either host differ significantly that they warrant their own roles. Ideally, I'm looking for the target host to be ...
2
votes
1
answer
64
views
Ansible: Regex not working as expected for multiline string
I am working on an Ansible playbook for iOS flash files backup, which shows the flash: of a Cisco router and tries to pick all the filenames from the multiline string into a list. Later it will create ...