aurbis access to /opt
This commit is contained in:
1 parent
26449924b8
commit
2dc4b4443a
7 files changed
+70
-23
No files matched your search
@@ -0,0 +1,41 @@
|
||||
# Service data below the top level stays with whatever uid its container runs as.
|
||||
- name: Let aurbis create services in /opt
|
||||
file:
|
||||
path: /opt
|
||||
state: directory
|
||||
owner: root
|
||||
group: aurbis
|
||||
mode: "02775"
|
||||
- name: Give aurbis every /opt service directory
|
||||
ansible.builtin.command:
|
||||
argv: [find, /opt, -mindepth, "1", -maxdepth, "1", -type, d, "!", -name, containerd,
|
||||
"!", "(", -group, aurbis, -perm, "-2070", ")",
|
||||
-print, -exec, chgrp, aurbis, "{}", "+", -exec, chmod, g+rwxs, "{}", "+"]
|
||||
register: aurbis_opt_dirs
|
||||
changed_when: aurbis_opt_dirs.stdout != ""
|
||||
- name: Give aurbis the top-level files of every /opt service
|
||||
ansible.builtin.command:
|
||||
argv: [find, /opt, -mindepth, "2", -maxdepth, "2", -type, f, "!", -path, "/opt/containerd/*",
|
||||
"!", "(", -group, aurbis, -perm, -g+rw, ")",
|
||||
-print, -exec, chgrp, aurbis, "{}", "+", -exec, chmod, g+rw, "{}", "+"]
|
||||
register: aurbis_opt_files
|
||||
changed_when: aurbis_opt_files.stdout != ""
|
||||
- name: Keep /opt .env files from other users
|
||||
ansible.builtin.command:
|
||||
argv: [find, /opt, -mindepth, "2", -maxdepth, "2", -type, f, -name, .env, -perm, /o+rwx,
|
||||
-print, -exec, chmod, o-rwx, "{}", "+"]
|
||||
register: aurbis_opt_env
|
||||
changed_when: aurbis_opt_env.stdout != ""
|
||||
|
||||
- name: Look up the docker group
|
||||
getent:
|
||||
database: group
|
||||
key: docker
|
||||
fail_key: false
|
||||
- name: Let aurbis members run docker
|
||||
user:
|
||||
name: "{{ item }}"
|
||||
groups: docker
|
||||
append: true
|
||||
loop: "{{ users | default([]) }}"
|
||||
when: ansible_facts.getent_group.docker is not none
|
||||
@@ -0,0 +1,12 @@
|
||||
- name: Give aurbis write access to {{ tree_path }}
|
||||
file:
|
||||
path: "{{ tree_path }}"
|
||||
state: directory
|
||||
recurse: true
|
||||
group: aurbis
|
||||
mode: g+rwX
|
||||
- name: Make {{ tree_path }} directories hand their group to new files
|
||||
ansible.builtin.command:
|
||||
cmd: "find {{ tree_path }} -type d ! -perm -g+s -print -exec chmod g+s {} +"
|
||||
register: aurbis_tree_setgid
|
||||
changed_when: aurbis_tree_setgid.stdout != ""
|
||||
@@ -10,7 +10,7 @@
|
||||
state: directory
|
||||
owner: root
|
||||
group: "{{ service_group | default('aurbis') }}"
|
||||
mode: "0775"
|
||||
mode: "02775"
|
||||
- name: Copy docker-compose file
|
||||
template:
|
||||
src: "{{ service_name }}/docker-compose.yml.j2"
|
||||
|
||||
@@ -46,15 +46,6 @@
|
||||
register: checkout_pull
|
||||
changed_when: "'updated' in checkout_pull.stdout"
|
||||
when: checkout_update | default(true)
|
||||
- name: Give aurbis write access to {{ checkout_repo }}
|
||||
file:
|
||||
path: "{{ checkout_dest }}"
|
||||
state: directory
|
||||
recurse: true
|
||||
group: aurbis
|
||||
mode: g+rwX
|
||||
- name: Make {{ checkout_repo }} directories hand their group to new files
|
||||
ansible.builtin.command:
|
||||
cmd: "find {{ checkout_dest }} -type d ! -perm -g+s -print -exec chmod g+s {} +"
|
||||
register: checkout_setgid
|
||||
changed_when: checkout_setgid.stdout != ""
|
||||
- import_tasks: aurbis_tree.yml
|
||||
vars:
|
||||
tree_path: "{{ checkout_dest }}"
|
||||
@@ -4,7 +4,7 @@
|
||||
state: directory
|
||||
owner: root
|
||||
group: aurbis
|
||||
mode: "0775"
|
||||
mode: "02775"
|
||||
|
||||
- name: Create mosquitto config directory
|
||||
file:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
state: directory
|
||||
owner: root
|
||||
group: aurbis
|
||||
mode: "0775"
|
||||
mode: "02775"
|
||||
|
||||
# Song library. Read-only for nightingale.
|
||||
# Keep this in sync with the /karaoke mount in nextcloud
|
||||
|
||||
Reference in new issue
Block a user