diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2021-12-12 14:51:24 +0000 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2021-12-12 14:54:58 +0000 |
commit | 4a16c10dd3b870ce62fdae9b590ff207e30a2bdd (patch) | |
tree | 9ea91aaaa456de8dcfd3b1193aa643fed85986d0 | |
parent | d67fb68e5fcd240c6c0e8e7c6e7e804da6f6238b (diff) | |
download | rules-4a16c10dd3b870ce62fdae9b590ff207e30a2bdd.tar.gz |
roles/cgit: Move lowdown + dependencies to chroot
-rw-r--r-- | host_vars/stack0-dc1.yml | 3 | ||||
-rw-r--r-- | roles/cgit/files/about-filter.sh | 2 | ||||
-rw-r--r-- | roles/cgit/tasks/dependencies.yml | 31 | ||||
-rw-r--r-- | roles/cgit/tasks/main.yml | 12 |
4 files changed, 37 insertions, 11 deletions
diff --git a/host_vars/stack0-dc1.yml b/host_vars/stack0-dc1.yml index c681bc0..30ec3e4 100644 --- a/host_vars/stack0-dc1.yml +++ b/host_vars/stack0-dc1.yml @@ -1,3 +1,6 @@ +cgit_authenticate: true +cgit__root_desc: private - development hub + __is_vm: true __ip: diff --git a/roles/cgit/files/about-filter.sh b/roles/cgit/files/about-filter.sh index 6193824..2262dc9 100644 --- a/roles/cgit/files/about-filter.sh +++ b/roles/cgit/files/about-filter.sh @@ -1,3 +1,3 @@ #!/bin/sh -cat - +lowdown - diff --git a/roles/cgit/tasks/dependencies.yml b/roles/cgit/tasks/dependencies.yml new file mode 100644 index 0000000..41f0884 --- /dev/null +++ b/roles/cgit/tasks/dependencies.yml @@ -0,0 +1,31 @@ +- name: retrieve dependencies for lowdown + shell: ldd /usr/local/bin/lowdown | tr -s " " | grep "0 1 0" | cut -d " " -f 7 + register: result + +- name: create dependencies directories in chroot + file: + path: "{{ cgit_chroot_dir }}{{ item | dirname }}" + owner: 0 + group: 0 + mode: 0755 + state: directory + loop: "{{ result.stdout_lines }}" + +- name: copy dependencies for lowdown + copy: + src: "{{ item }}" + dest: "{{ cgit_chroot_dir }}/{{ item }}" + mode: preserve + remote_src: true + loop: "{{ result.stdout_lines }}" + +- name: copy utilities in httpd chroot + copy: + src: "{{ item }}" + dest: "{{ cgit_chroot_dir }}/bin" + mode: preserve + remote_src: true + loop: + - /bin/sh + - /bin/cat + - /usr/local/bin/lowdown diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml index 6040ecf..0f51d0c 100644 --- a/roles/cgit/tasks/main.yml +++ b/roles/cgit/tasks/main.yml @@ -20,16 +20,8 @@ - template: httpd.conf.j2 file: /etc/httpd.d/cgit.conf -- name: copy utilities in httpd chroot - copy: - src: "{{ item }}" - dest: "{{ cgit_chroot_dir }}/bin" - mode: preserve - remote_src: true - loop: - - /bin/sh - - /bin/cat - - /usr/local/bin/lowdown +- name: include dependencies for lowdown + include_tasks: dependencies.yml - name: copy about-filter generator copy: |