init-setup.yml 734 B

1234567891011121314151617181920
  1. ---
  2. - name: Make Gogs init script executable.
  3. file:
  4. path: "{{ gogs_user_home }}/{{ gogs_init_script_path }}"
  5. mode: 0755
  6. - name: Symlink Gogs binary and startup scripts.
  7. file:
  8. src: "{{ item.src }}"
  9. dest: "{{ item.dest }}"
  10. state: link
  11. register: gogs_file_symlinks
  12. with_items:
  13. - { src: "{{ gogs_user_home }}/gogs/gogs", dest: "/usr/local/bin/gogs" }
  14. - { src: "{{ gogs_user_home }}/{{ gogs_init_script_path }}" , dest: "/etc/init.d/gogs" }
  15. # SEE: https://github.com/ansible/ansible-modules-core/issues/191
  16. - name: Restart systemctl daemon on systemd systems.
  17. shell: systemctl daemon-reload
  18. when: gogs_file_symlinks.changed and ansible_os_family == "RedHat" and ansible_lsb.major_release|int == 7