aboutsummaryrefslogtreecommitdiffstats
path: root/roles/cgit/tasks
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2024-05-12 17:33:39 +0200
committerRomain Gonçalves <me@rgoncalves.se>2024-05-12 17:36:32 +0200
commitfdd5293dd05890434c5b1660bfc44d493a4f4056 (patch)
tree204e3a16a6d301c957aa3126d7fcf0ea188b2f32 /roles/cgit/tasks
parenta355ee21c15e915f394952abe76703d7865c991b (diff)
downloadrules-fdd5293dd05890434c5b1660bfc44d493a4f4056.tar.gz
feat(roles/cgit): new variables structure
Diffstat (limited to 'roles/cgit/tasks')
-rw-r--r--roles/cgit/tasks/main.yml37
1 files changed, 19 insertions, 18 deletions
diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml
index ce9ecbe..5e0a0a3 100644
--- a/roles/cgit/tasks/main.yml
+++ b/roles/cgit/tasks/main.yml
@@ -2,18 +2,19 @@
- name: install cgit packages
ansible.builtin.package:
- name:
- - cgit
- - lowdown
+ name: "{{ cgit__packages }}"
state: present
-- name: create cgit cache directory
+- name: create cgit data directories
ansible.builtin.file:
- path: "{{ cgit_chroot_dir }}/{{ cgit_cache_dir }}"
- owner: "{{ cgit_user }}"
- group: "{{ cgit_group }}"
+ path: "{{ item }}"
+ owner: "{{ cgit__user }}"
+ group: "{{ cgit__group }}"
mode: "0750"
state: directory
+ loop:
+ - "{{ cgit__cache_dir }}"
+ - "{{ cgit__repositories_dir }}"
- name: generate cgit configuration files
ansible.builtin.template:
@@ -24,48 +25,48 @@
mode: "0644"
loop:
- src: cgitrc.j2
- dest: "{{ cgit_chroot_dir }}/conf/cgitrc"
+ dest: "{{ cgit__chroot_dir }}/conf/cgitrc"
- src: footer.html.j2
- dest: "{{ cgit_chroot_dir }}/conf/footer.html"
+ dest: "{{ cgit__footer_file }}"
- src: httpd.conf.j2
- dest: /etc/httpd.d/cgit.conf
+ dest: "{{ httpd_pre__configuration_dir }}/cgit.conf"
- name: retrieve dependencies for lowdown
ansible.builtin.shell: |
set -o pipefail
ldd $(command -v lowdown) | tr -s " " | grep "0 1 0" | cut -d " " -f 7
- register: cgit_result_lowdown_dependencies
+ register: cgit__result_lowdown_dependencies
changed_when: false
- name: create dependencies directories in chroot
ansible.builtin.file:
- path: "{{ cgit_chroot_dir }}{{ item | dirname }}"
+ path: "{{ cgit__chroot_dir }}{{ item | dirname }}"
owner: 0
group: 0
mode: "0755"
state: directory
- loop: "{{ cgit_result_lowdown_dependencies.stdout_lines }}"
+ loop: "{{ cgit__result_lowdown_dependencies.stdout_lines }}"
- name: copy dependencies for lowdown
ansible.builtin.copy:
src: "{{ item }}"
- dest: "{{ cgit_chroot_dir }}/{{ item }}"
+ dest: "{{ cgit__chroot_dir }}/{{ item }}"
mode: preserve
remote_src: true
- loop: "{{ cgit_result_lowdown_dependencies.stdout_lines }}"
+ loop: "{{ cgit__result_lowdown_dependencies.stdout_lines }}"
- name: copy utilities in httpd chroot
ansible.builtin.copy:
src: "{{ item }}"
- dest: "{{ cgit_chroot_dir }}/bin"
+ dest: "{{ cgit__chroot_dir }}/bin"
mode: preserve
remote_src: true
- loop: "{{ cgit_chroot_required_files }}"
+ loop: "{{ cgit__chroot_required_files }}"
- name: copy about-filter generator
ansible.builtin.copy:
src: about-filter.sh
- dest: "{{ cgit_chroot_dir }}/bin/about-filter.sh"
+ dest: "{{ cgit__chroot_dir }}/bin/about-filter.sh"
owner: 0
group: 0
mode: "0755"
remember that computers suck.