diff options
author | binary <me@rgoncalves.se> | 2021-03-03 14:56:44 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2021-03-03 14:56:44 +0100 |
commit | 3147612e821c234c8df7a82760b66a6c373f799a (patch) | |
tree | 8aaac15c5d6f195df717e13f21a9be579550cb7b /roles/cgit | |
parent | 87a20622103d74eca59003ae2adac81bd6ffee9b (diff) | |
download | infrastructure-3147612e821c234c8df7a82760b66a6c373f799a.tar.gz |
Add nfs to git with correct permissions
Diffstat (limited to 'roles/cgit')
-rw-r--r-- | roles/cgit/tasks/main.yml | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml index f84e7e8..286ffab 100644 --- a/roles/cgit/tasks/main.yml +++ b/roles/cgit/tasks/main.yml @@ -43,49 +43,21 @@ group: "{{ group_root }}" mode: 0755 -- name: unmount potential existing filesystem in target directory - shell: "umount /var/www/{{ cgit_git_dir_chroot }}" - register: result - failed_when: result.rc != 0 and "not currently mounted" not in result.stderr - - name: ensure cgit web directory exists file: path: /var/www/{{ cgit_git_dir_chroot }} owner: www group: daemon - mode: 0644 + mode: 0655 state: directory -- name: enable shared git directory in /etc/exports - lineinfile: - path: /etc/exports - regexp: "^{{ cgit_git_dir }}" - line: "{{ cgit_git_dir }} -mapall=root -alldirs -network=127.0.0.1 -mask=255.255.255.255 -ro" - owner: "{{ user_root }}" - group: "{{ group_root }}" - mode: 0644 - create: true - -- name: enable shared git directory in /etc/exports - lineinfile: - path: /etc/fstab - regexp: "^localhost:{{ cgit_git_dir }}" - line: "localhost:{{ cgit_git_dir }} /var/www/{{ cgit_git_dir_chroot }} nfs rw,nodev,nosuid,soft,intr 0 0" - -- name: start and enable share directory - service: - name: "{{ item }}" - state: restarted - enabled: true - loop: - - "portmap" - - "nfsd" - -- name: start and enable mountd - shell: | - rcctl enable mountd - pkill -9 mountd - rcctl start mountd +- name: include nfsclient for remote dir + include_role: + name: nfsclient + vars: + nfsclient_dir: "/var/www/{{ cgit_git_dir_chroot }}" + nfsclient_server_dir: "{{ global.nfs_server_dir }}/{{ ansible_host }}/git" + #nfsclient_server: "{{ global.nfs_server }}" - name: ensure nfs volume is mounted shell: mount -A |