hi guys, the below playbook seems to work ok except when the ouput gets 
written to the local file, it only shows the output of one host instead of 
2 that I was expecting.

What needs to change so that I can have the output for both hosts in perf.

---
- name: Get various nginx configuration information
  hosts: perf
  become: yes
  become_user: nginx
  vars:
    dest_file: /root/johnc/nginx-servers/yamloutputfile.txt

  tasks:
  - name: Get nginx config information
    shell: |
       hostname
       cat /etc/logrotate.d/nginx
       cat /etc/logrotate.conf
       ls -al /etc/cron.daily/logrotate
       cat /var/lib/logrotate/logrotate.status
    register: output


  - name: Save the output to a local file
    become: yes
    become_user: root
    local_action: copy content="{{ output.stdout_lines|join('\n') }}" 
dest="{{ dest_file }}"

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fae6d8d3-3a46-41ef-adaf-b4ad6b641441n%40googlegroups.com.

Reply via email to