From f1aebe3adc2b68f240d9118ae95e9ff93671ab66 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Fri, 20 Jan 2023 10:21:10 -0800 Subject: bia: add nginx --- .../config/bia/ansible/roles/cgit/tasks/main.yaml | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 clarkzjw.cc/config/bia/ansible/roles/cgit/tasks/main.yaml (limited to 'clarkzjw.cc/config/bia/ansible/roles/cgit/tasks/main.yaml') diff --git a/clarkzjw.cc/config/bia/ansible/roles/cgit/tasks/main.yaml b/clarkzjw.cc/config/bia/ansible/roles/cgit/tasks/main.yaml new file mode 100644 index 0000000..872a43a --- /dev/null +++ b/clarkzjw.cc/config/bia/ansible/roles/cgit/tasks/main.yaml @@ -0,0 +1,41 @@ +- name: Install cgit, Nginx + pkgng: + state: present + name: + - cgit + - nginx + - fcgiwrap + - security/py-certbot-nginx + +- 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 file + template: + src: nginx.conf.j2 + dest: "/usr/local/etc/nginx/nginx.conf" + mode: 0644 + +- name: Render nginx config file + template: + src: cgit.conf.j2 + dest: "/usr/local/etc/nginx/conf.d/cgit.conf" + mode: 0644 + +# TODO +# create certbot https certificate +# test nginx conf +# reload nginx conf +# create git user +# git user permission -- cgit v1.2.3