From 760230354386f543ea783b50c95fdbc14a4a0300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Jonas=20S=C3=A4mann?= Date: Wed, 9 Sep 2020 18:12:45 +0200 Subject: [PATCH] [role/netbox] Add recursive chown task Recursively update group-/ownership of netbox directory after unpacking the source and requiering modules into venv --- roles/netbox/tasks/main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/netbox/tasks/main.yml b/roles/netbox/tasks/main.yml index 45a2023..23c63e4 100644 --- a/roles/netbox/tasks/main.yml +++ b/roles/netbox/tasks/main.yml @@ -55,8 +55,6 @@ remote_src: yes creates: '/opt/netbox-{{ netbox_version }}' -# TODO user/group/chown? - - name: Configure netbox template: src: configuration.py.j2 @@ -70,6 +68,16 @@ virtualenv: '/opt/netbox-{{ netbox_version }}/venv' virtualenv_command: '/usr/bin/python3 -m venv' +- name: Netbox file permissions + file: + path: '/opt/netbox-{{ netbox_version }}' + owner: '{{ netbox_user }}' + group: '{{ netbox_group }}' + mode: preserve + state: directory + recursive: yes + create: no + # TODO - still manual work # * Run Database Migrations # * Create a Super User