init-setup.yml 738 B

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