On Thu, 26 Nov 2020 20:58:48 -0800 (PST)
blue fox <
foxb...@gmail.com> wrote:
> I would to copy each time running playbook each host in file.txt
Is this what you're looking for ?
- shell: "echo {{ item }} >> file.txt"
loop: "{{ ansible_play_hosts_all }}"
run_once: true
delegate_to: localhost
FWIW, you can improve the log by prepending the date
- block:
- command: date
register: result
- shell: "echo {{ result.stdout}} {{ item }} >> file.txt"
loop: "{{ ansible_play_hosts_all }}"
run_once: true
delegate_to: localhost
--
Vladimir Botka