Re: [ansible-project] Unable to get remote target hostname when using delegate_to

2020-03-26 Thread Kai Stian Olstad
On Wed, Mar 25, 2020 at 10:41:35PM -0700, Shifa Shaikh wrote: > --- > hosts: remote_hosts > tasks: > - name: Generate JSON data > lineinfile: > path: "{{ playbook_dir }}/tmpfiles/stats.yml" > line: "{{ inventory_hostname }}_{{ item.mount }}: {{ (100 * >

[ansible-project] Unable to get remote target hostname when using delegate_to

2020-03-25 Thread Shifa Shaikh
Below playbook gets the disk usage percentage of '/tmp' from a list of remote_hosts [20 remote servers] and stores it locally (delegate_to) in a file {{ playbook_dir }}/tmpfiles/stats.yml --- hosts: remote_hosts tasks: - name: Generate JSON data lineinfile: path: "{{