Библиотека ansible плейбуков на разные случаи
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

31 lignes
1.0 KiB

  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