init-setup.yml 876 B

1234567891011121314151617181920212223242526272829
  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: Set user in Gogs init script.
  13. lineinfile:
  14. dest: "{{ gogs_user_home }}/{{ gogs_init_script_path }}"
  15. line: "USER={{ gogs_user }}"
  16. regexp: "^USER=.*"
  17. notify: restart gogs
  18. - name: Symlink Gogs binary and startup scripts.
  19. file:
  20. src: "{{ item.src }}"
  21. dest: "{{ item.dest }}"
  22. state: link
  23. with_items:
  24. - { src: "{{ gogs_user_home }}/gogs/gogs", dest: "/usr/local/bin/gogs" }
  25. - { src: "{{ gogs_user_home }}/{{ gogs_init_script_path }}" , dest: "/etc/init.d/gogs" }
  26. notify: restart gogs