main.yml 574 B

123456789101112131415161718192021222324
  1. ---
  2. - name: Combine service lists for bash script
  3. set_fact:
  4. service_list: "{{ service_list | default('') +'\"' + item + '\" ' }}"
  5. with_items:
  6. - "{{ status_services }}"
  7. - name: Install statusservices script
  8. template:
  9. src: statusservices.j2
  10. dest: /usr/local/bin/statusservices
  11. owner: root
  12. group: root
  13. mode: '0755'
  14. when:
  15. - service_list is defined
  16. - name: Add statusservices to .bash_profile
  17. lineinfile:
  18. path: /root/.bash_profile
  19. line: '/usr/local/bin/statusservices'
  20. state: present
  21. when:
  22. - service_list is defined