[ansible-project] hostname in chroot

2024-03-14 Thread Michael DiDomenico
i have a series of playbooks that use ansible_hostname to determine whether tasks should run. on a host these work fine as one would expect, but when running ansible inside a chroot environment with /proc,sys,dev mounted. ansible pulls the hostname from the host outside of the chroot into ansible_

Re: [ansible-project] interpolation of loop variables

2024-03-14 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
In the first loop assert is evaluating that 'item' itself is defined. In the second loop assert is evaluating whether a variable who's name is stored in 'item' is defined. % cat foo.yml --- - hosts: localhost gather_facts: no become: no tasks: - name: without templating asser

Re: [ansible-project] interpolation of loop variables

2024-03-14 Thread Rob Wagner
Hey Todd - apologies, I don't understand your comment. Hey Walter - yes, you are correct. To elaborate on the use case. FIrst task in my playbooks confirms the user provided all the expected/required variables. I iterate over the list of variables and make sure they are defined with assert. Th

Re: [ansible-project] interpolation of loop variables

2024-03-14 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
I sense that "with templating" does as expected? % ansible --version ansible [core 2.16.4] config file = None configured module search path = ['/Users/wrowe/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /opt/homebrew/lib/python3.11/s