Re: [ansible-project] Use of register variable in following play(s)

2024-05-21 Thread Dimitri Yioulos
Thank you, Dick! On Tuesday, May 21, 2024 at 4:07:19 PM UTC-4 Dick Visser wrote: > I would use the dedicated find task. Apply a depth filter just in case. > Something like this should do the trick: > > > - name: known hosts script play > hosts: all > become: true > gather_facts: false > >

Re: [ansible-project] Use of register variable in following play(s)

2024-05-21 Thread Dick Visser
I would use the dedicated find task. Apply a depth filter just in case. Something like this should do the trick: - name: known hosts script play hosts: all become: true gather_facts: false tasks: - name: Find known hosts ansible.builtin.find: paths: - /root

[ansible-project] Use of register variable in following play(s)

2024-05-21 Thread Dimitri Yioulos
Good day. I need to make changes in the know_hosts files of users on various hosts. I'll use a script to do the actual changes in known_hosts. I have the following simple playbook, so far. It identifies users with known_host files: * hosts: all gather_facts: false become: ye