Comments (4)
please show the -vvv
output of the error
from ansible.
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the component bot command.
from ansible.
Also note that this fails the same way with this:
vars:
ansible_user: “{{ item.user }}”
from ansible.
Closing this as it is a duplicate of at least #16776. Sorry to be of any trouble. Thank you for reaching out @bcoca. This is working as designed, and I found a solution to my specific problem to accommodate existing org ansible structure (as in, within a task file called in a one-entry-point playbook:
# assume I have created a list of {user: some_user, host: some_host} dicts
- name: "use inventory to get mirror hosts"
ansible.builtin.add_host:
ansible_ssh_host: "{{ item.host }}"
ansible_ssh_user: "{{ item.user }}"
inventory_hostname: "{{ item.host }}"
groups: "mirror_hosts"
name: "{{ item.host }}"
loop:
"{{ mirror_config }}"
# run_once is called because this is a task in a playbook using N hosts
- name: "do something with group"
ansible.builtin.file:
path: "/home/{{ ansible_ssh_user }}/touchfile.txt"
state: "touch"
mode: "0644"
loop:
"{{ groups['mirror_hosts'] }}"
run_once: true
delegate_to: "{{ item }}"
A colleague also sent this to me this morning: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_delegation.html#templating-in-delegation-context
from ansible.
Related Issues (20)
- Unexpected behaviour when applying `copy` to vaulted variable HOT 2
- ansible_pkg_mgr on Rocky 8 having issues determining the correct yum/dnf HOT 5
- debconf module fails to correctly handle bool values HOT 1
- interpreter_python setting in ansible.cfg not honored for Alpine Linux remote hosts HOT 5
- Issue with RHEL 8 system Python for DNF HOT 5
- validate-modules test: does not notice if alias is added to the wrong option in documentation HOT 2
- git shortlog not working with async shell HOT 2
- `/usr/bin/env python3: not found` when using as a Shebang in a module HOT 7
- group module with local=true can be very slow when machine is joined to an LDAP domain HOT 1
- ansible.builtin.apt apt-get upgrade output differs from expected in Ubuntu 22.04LTS when LANGUAGE=en_GB: set, causing 'changed' to always be set to 'true' HOT 2
- GALAXY_TOKEN_PATH config does not work HOT 3
- keyed_groups in inventory HOT 1
- ansible.builtin.dnf: missing list updates/available functionality like in rpm module HOT 1
- FileNotFoundError when executing chmod on directory HOT 2
- Loop label and register: issue with skipped items HOT 3
- ansible_fail_result is undefined HOT 1
- Unable to configure url credentials for private collection installed by url HOT 3
- Not able to run the win_update task on Windows server when Trellix Threat prevention enabled with Ansible version 2.16.6 HOT 2
- apt autoremove diff mode doesn't work in check mode HOT 1
- Add ability to include comments in jinja2 conditional blocks or a way to suppress "[WARNING]: conditional statements should not include jinja2 templating delimiters" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible.