init-setup.yml 683 B

12345678910111213141516171819202122
  1. ---
  2. - name: Make Gogs init script executable.
  3. file:
  4. path: "{{ gogs_user_home }}/{{ gogs_init_script_path }}"
  5. mode: 0755
  6. - name: Set path to Gogs in init script.
  7. lineinfile:
  8. dest: "{{ gogs_user_home }}/{{ gogs_init_script_path }}"
  9. line: "WORKINGDIR={{ gogs_user_home }}/gogs"
  10. regexp: "^WORKINGDIR=.*"
  11. notify: restart gogs
  12. - name: Symlink Gogs binary and startup scripts.
  13. file:
  14. src: "{{ item.src }}"
  15. dest: "{{ item.dest }}"
  16. state: link
  17. with_items:
  18. - { src: "{{ gogs_user_home }}/gogs/gogs", dest: "/usr/local/bin/gogs" }
  19. - { src: "{{ gogs_user_home }}/{{ gogs_init_script_path }}" , dest: "/etc/init.d/gogs" }
  20. notify: restart gogs