aboutsummaryrefslogtreecommitdiff
blob: 51f17eb05077792b37807c58383fc11a158c28d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
- name: Install cgit, Nginx
  pkgng:
    state: present
    name:
      - cgit
      - git
      - nginx
      - fcgiwrap
      - security/py-certbot-nginx
      - py39-virtualenv
      - py39-docutils
      - py39-markdown
      - py39-pygments
      - python39
      - gitolite

- name: Create git directory
  file:
    path: /opt/git
    state: directory
    owner: www
    group: www
    recurse: yes

- name: Create Nginx conf directory
  file:
    path: /usr/local/etc/nginx/conf.d
    state: directory
    recurse: yes

- name: Render Nginx config files
  template:
    src: nginx.conf.j2
    dest: "/usr/local/etc/nginx/nginx.conf"
    mode: 0644

- name: Rendier cgit nginx config
  template:
    src: cgit.conf.j2
    dest: "/usr/local/etc/nginx/conf.d/cgit.conf"
    mode: 0644

- name: Enable SysRC values
  community.general.sysrc:
    name: sshd_enable
    state: present
    value: "YES"

- name: Enable SysRC values
  community.general.sysrc:
    name: nginx_enable
    state: present
    value: "YES"

- name: Enable SysRC values
  community.general.sysrc:
    name: fcgiwrap_enable
    state: present
    value: "YES"

- name: Enable SysRC values
  community.general.sysrc:
    name: fcgiwrap_user
    state: present
    value: "www"

- name: Enable SysRC values
  community.general.sysrc:
    name: fcgiwrap_group
    state: present
    value: "www"

- name: Enable SysRC values
  community.general.sysrc:
    name: fcgiwrap_socket_owner
    state: present
    value: "www"

- name: Enable SysRC values
  community.general.sysrc:
    name: fcgiwrap_socket_group
    state: present
    value: "www"

- name: Create git group
  group:
    name: git
    state: present

- name: Add git user
  user:
    name: git
    group: git
    home: /opt/git

# TODO
# create certbot https certificate
# test nginx conf
# reload nginx conf
# gitolite config
# cgit filters
Powered by cgit v1.2.3 (git 2.41.0)