您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

87 行
1.5KB

  1. ---
  2. - name: debian packages
  3. apt:
  4. pkg: "{{item}}"
  5. with_items:
  6. - ca-certificates
  7. - git
  8. - golang
  9. - name: download gitea
  10. get_url:
  11. url: "{{ gitea_download_url }}"
  12. dest: /usr/local/bin/gitea
  13. checksum: "{{ gitea_download_checksum }}"
  14. - name: gitea executable
  15. file:
  16. path: /usr/local/bin/gitea
  17. mode: u=rwx,g=rx,o=rx
  18. # - name: allow gitea executable to bind on privileged port
  19. # capabilities:
  20. # path: /usr/local/bin/gitea
  21. # capability: cap_sys_chroot+eip
  22. # state: present
  23. - name: git user
  24. user:
  25. name: git
  26. system: yes
  27. home: /srv/git
  28. - name: gitea home directory
  29. file:
  30. path: /srv/git
  31. mode: u=rwx,g=rx,o=rx
  32. owner: git
  33. group: git
  34. state: directory
  35. - name: gitea repos directory
  36. file:
  37. path: /srv/git/repos
  38. mode: u=rwx,g=rx,o=rx
  39. owner: git
  40. group: git
  41. state: directory
  42. - name: gitea work directory
  43. file:
  44. path: /var/lib/gitea
  45. mode: u=rwx,g=rx,o=rx
  46. owner: git
  47. group: git
  48. state: directory
  49. - name: gitea config directory
  50. file:
  51. path: /etc/gitea
  52. mode: u=rwx,g=rx,o=rx
  53. owner: git
  54. group: git
  55. state: directory
  56. - name: gitea log directory
  57. file:
  58. path: /var/log/gitea
  59. mode: u=rwx,g=rx,o=rx
  60. owner: git
  61. group: git
  62. state: directory
  63. - import_tasks: config.yml
  64. - name: systemd service unit
  65. template:
  66. src: systemd.service.j2
  67. dest: /etc/systemd/system/gitea.service
  68. notify:
  69. - systemd daemon-reload
  70. - restart gitea
  71. - name: gitea started
  72. systemd:
  73. name: gitea.service
  74. state: started