main.yml 819 B

1234567891011121314151617181920212223242526272829303132333435
  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. - "{{ status_services_extra }}"
  8. - name: Install statusservices script
  9. template:
  10. src: statusservices.j2
  11. dest: /usr/local/bin/statusservices
  12. owner: root
  13. group: root
  14. mode: '0755'
  15. when:
  16. - service_list is defined
  17. - name: Ensure root .bash_profile.local exists
  18. ansible.builtin.file:
  19. path: /root/.bash_profile.local
  20. state: touch
  21. owner: root
  22. group: root
  23. mode: '0640'
  24. changed_when: false
  25. - name: Add statusservices to .bash_profile.local
  26. lineinfile:
  27. path: /root/.bash_profile.local
  28. line: '/usr/local/bin/statusservices'
  29. state: present
  30. when:
  31. - service_list is defined