playbook.yml 435 B

1234567891011121314151617
  1. ---
  2. - name: Converge
  3. hosts: all
  4. pre_tasks:
  5. - name: All ansible hostname to sensu_masters group
  6. add_host:
  7. name: "{{ item }}"
  8. groups: sensu_masters
  9. loop: "{{ ansible_play_hosts }}"
  10. changed_when: false
  11. - name: Ensure container hostnames are correct
  12. hostname:
  13. name: "{{ inventory_hostname }}"
  14. when: inventory_hostname != 'amazonlinux-1'
  15. roles:
  16. - role: sensu-ansible