Set files owner and group

This commit is contained in:
phil 2023-07-14 16:10:28 +02:00
parent e5c7908e49
commit 6ee0e4cb78
3 changed files with 12 additions and 2 deletions

View file

@ -17,10 +17,12 @@ ansible-playbook playbooks/cmdb.yml --skip-tags install
## Variablen
| Variable Name | Function | Default value | File | Comment |
| ------------- | -------- | ------------- | ---- | ------- |
| Variable Name | Function | Default value | File |
| ------------- | -------- | ------------- | ---- |
| `cmdb` | Dictionary for dokuwiki server variables _(required)_ | -- | `group_vars/all/cmdb.yml` |
| `cmdb.wiki_server` | dokuwiki server _(required)_ | -- | `group_vars/all/cmdb.yml` |
| `cmdb.wiki_pages_path` | path for wiki pages on dokuwiki server _(required)_ | -- | `group_vars/all/cmdb.yml` |
| `cmdb.wiki_media_path` | path for media on dokuwiki server _(required)_ | -- | `group_vars/all/cmdb.yml` |
| `cmdb.wiki_meta_path` | path for metadata on dokuwiki server _(required)_ | -- | `group_vars/all/cmdb.yml` |
| `cmdb.wiki_owner` | File system owner of wiki files and directories _(required)_ | -- | `group_vars/all/cmdb.yml`|
| `cmdb.wiki_group` | File system group of wiki files and directories _(required)_ | -- | `group_vars/all/cmdb.yml`|

View file

@ -34,5 +34,7 @@
ansible.builtin.template:
src: hypervisor.txt.j2
dest: "{{ cmdb.wiki_pages_path }}/servers/hypervisor.txt"
owner: "{{ cmdb.wiki_owner }}"
group: "{{ cmdb.wiki_group }}"
mode: "0644"
delegate_to: "{{ cmdb.wiki_server }}"

View file

@ -3,17 +3,23 @@
ansible.builtin.template:
src: servers.txt.j2
dest: "{{ cmdb.wiki_pages_path }}/servers.txt"
owner: "{{ cmdb.wiki_owner }}"
group: "{{ cmdb.wiki_group }}"
mode: "0644"
- name: "Server | Write startpage for all servers"
ansible.builtin.template:
src: all.txt.j2
dest: "{{ cmdb.wiki_pages_path }}/servers/all.txt"
owner: "{{ cmdb.wiki_owner }}"
group: "{{ cmdb.wiki_group }}"
mode: "0644"
- name: "Server | Write server item"
ansible.builtin.template:
src: item.txt.j2
dest: "{{ cmdb.wiki_pages_path }}/servers/all/{{ inventory_hostname }}.txt"
owner: "{{ cmdb.wiki_owner }}"
group: "{{ cmdb.wiki_group }}"
mode: "0644"
tags: server_item