Библиотека ansible плейбуков на разные случаи
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.yml 1.0KB

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: Install app.py
  3. copy:
  4. src: files/app.py
  5. dest: /opt/app.py
  6. owner: root
  7. group: root
  8. mode: 0644
  9. - name: Install child_process.py
  10. copy:
  11. src: files/child_process.py
  12. dest: /opt/child_process.py
  13. owner: root
  14. group: root
  15. mode: 0644
  16. - name: Create service file for upstart Ubuntu versions
  17. template: src=upstart-service.template.j2 dest=/etc/init/{{service_name}}.conf backup=no mode=0644
  18. when: ansible_distribution == 'Ubuntu' and (ansible_distribution_version == "14.04" or ansible_distribution_version == "12.04")
  19. - name: Create service file for systemd Ubuntu versions
  20. template: src=systemd-service.template.j2 dest=/etc/systemd/system/{{service_name}}.service backup=no mode=0644
  21. when: ansible_distribution == 'Ubuntu' and (ansible_distribution_version == "16.04" or ansible_distribution_version == "18.04")
  22. - name: Enable service {{ service_name }}
  23. service: name={{ service_name }} enabled=yes
  24. - name: Start service {{ service_name }}
  25. service: name={{ service_name }} state=restarted