4 name: ['cgit', 'apache2']
9 ansible.builtin.template:
12 - name: Configure apache2
14 - name: Enable cgit configuration
15 ansible.builtin.command:
16 argv: ['a2enconf', 'cgit.conf']
17 creates: /etc/apache2/conf-enabled/cgit.conf
20 - name: Disable default site
21 ansible.builtin.command:
22 argv: ['a2dissite', '000-default.conf']
23 removes: /etc/apache2/sites-enabled/000-default.conf
27 ansible.builtin.command:
28 argv: ['a2enmod', 'ssl']
29 creates: '/etc/apache2/mods-enabled/ssl.conf'
33 ansible.builtin.command:
34 argv: ['a2enmod', 'cgid']
35 creates: '/etc/apache2/mods-enabled/cgid.conf'
38 - name: Manage apache2 cgit site configuration
39 ansible.builtin.template:
41 dest: /etc/apache2/sites-available/cgit.conf
44 - name: Enable cgit site configuration
45 ansible.builtin.command:
46 argv: ['a2ensite', 'cgit.conf']
47 creates: /etc/apache2/sites-enabled/cgit.conf
50 - name: Install git-daemon
52 name: ['git-daemon-sysvinit']
53 - name: Create git-daemon base path
54 when: git_daemon_conf.GIT_DAEMON_BASE_PATH
56 path: "{{git_daemon_conf.GIT_DAEMON_BASE_PATH}}"
60 - name: Configure git-daemon
61 with_items: "{{git_daemon_conf|dict2items}}"
62 community.general.ini_file:
63 path: /etc/default/git-daemon
64 option: "{{item.key}}"
65 value: "{{item.value}}"
69 - name: Create git-daemon group
70 ansible.builtin.group:
73 - name: Add www-data to the git-daemon group
78 - name: Install grokmirror
80 - ansible.builtin.copy:
81 src: files/grokmirror_2.0.11-1_all.deb
82 dest: /root/grokmirror.deb
83 register: grokmirror_deb
84 - when: grokmirror_deb.changed
85 ansible.builtin.command:
86 argv: ['apt', 'install', '-y', '/root/grokmirror.deb']
87 - ansible.builtin.file:
90 - name: Create grokmirror log directory
93 dest: /var/log/grokmirror
97 - ansible.builtin.file:
99 dest: /storage/git-mirror/gitdaemon
102 - name: Create grokmirror configs
104 file: mirror_instance.yml
105 with_items: "{{grokmirror_instances|dict2items}}"
108 mirror: "{{item.value}}"
109 - name: Create legacy pull directory
110 ansible.builtin.file:
112 dest: /storage/git-mirror/gitdaemon/git
115 - name: Create legacy pull script
116 ansible.builtin.copy:
118 dest: /storage/git-mirror/gitdaemon/git/update.sh
125 - name: Manage legacy pull cron job
126 ansible.builtin.cron:
130 job: 'cd /storage/git-mirror/gitdaemon/git && ./update.sh >/dev/null 2>&1'
132 - name: Link cgit export directories
133 with_items: "{{cgit_export_links|dict2items}}"
134 ansible.builtin.file:
136 src: "{{item.value}}"
137 path: "/storage/git-mirror/gitdaemon/export/{{item.key}}"