servicedeploy-playbook.yml 574 B

1234567891011121314151617181920212223242526
  1. ---
  2. - hosts: "{{ server }}"
  3. tasks:
  4. - name: create directory
  5. file:
  6. path: "{{ deploy_folder }}"
  7. state: directory
  8. - name: upload service to server
  9. synchronize:
  10. src: "{{ publish_folder }}/"
  11. dest: "{{ deploy_folder }}/"
  12. delete: yes
  13. archive: yes
  14. rsync_opts: --exclude=.git
  15. - name: write secure config
  16. shell: "echo dunno"
  17. - name: restart service
  18. systemd:
  19. name: "{{ service_name }}"
  20. state: restarted
  21. enabled: yes
  22. daemon_reload: yes
  23. become: yes