Make Narratio configuration ownership configurable

This commit is contained in:
2026-09-14 14:04:54 +00:00
parent 7feff4728a
commit eeb1105590
4 changed files with 23 additions and 8 deletions

View File

@@ -18,6 +18,10 @@ narratio_go_binary: /snap/bin/go
narratio_user: narratio narratio_user: narratio
narratio_group: narratio narratio_group: narratio
narratio_config_path: /usr/local/etc/narratio/pipeline.yml narratio_config_path: /usr/local/etc/narratio/pipeline.yml
narratio_config_owner: root
narratio_config_group: narratio
narratio_config_directory_mode: "0750"
narratio_config_file_mode: "0640"
narratio_workspace_root: /var/lib/narratio narratio_workspace_root: /var/lib/narratio
narratio_campaigns_root: /usr/local/share/narratio/campaigns narratio_campaigns_root: /usr/local/share/narratio/campaigns
narratio_spool_root: /var/spool/narratio narratio_spool_root: /var/spool/narratio
@@ -117,8 +121,11 @@ rebuilds only when the checkout changes or the binary is absent.
The `narratio` account owns the workspace, spool, and cache roots, which are The `narratio` account owns the workspace, spool, and cache roots, which are
group-writable setgid directories. The campaign registry is `root:narratio` group-writable setgid directories. The campaign registry is `root:narratio`
and operator-readable; its content remains caller-managed. The configuration and operator-readable; its content remains caller-managed. Configuration
directory is `root:narratio` mode `0750`, and the pipeline is mode `0640`. ownership and modes are independently configurable: the standalone defaults
are `root:narratio`, mode `0750` for the directory and `0640` for the managed
pipeline file. Composing roles may override these inputs without changing the
writable-root policy.
Null pipeline values and their empty parent mappings are omitted; non-null Null pipeline values and their empty parent mappings are omitted; non-null
falsey values are preserved. `narratio_publish_outputs`, falsey values are preserved. `narratio_publish_outputs`,

View File

@@ -9,6 +9,10 @@ narratio_go_binary: /snap/bin/go
narratio_user: narratio narratio_user: narratio
narratio_group: narratio narratio_group: narratio
narratio_config_path: /usr/local/etc/narratio/pipeline.yml narratio_config_path: /usr/local/etc/narratio/pipeline.yml
narratio_config_owner: root
narratio_config_group: "{{ narratio_group }}"
narratio_config_directory_mode: "0750"
narratio_config_file_mode: "0640"
narratio_workspace_root: /var/lib/narratio narratio_workspace_root: /var/lib/narratio
narratio_campaigns_root: /usr/local/share/narratio/campaigns narratio_campaigns_root: /usr/local/share/narratio/campaigns
narratio_spool_root: /var/spool/narratio narratio_spool_root: /var/spool/narratio

View File

@@ -13,6 +13,10 @@ argument_specs:
narratio_user: {type: str, required: true} narratio_user: {type: str, required: true}
narratio_group: {type: str, required: true} narratio_group: {type: str, required: true}
narratio_config_path: {type: path, required: true} narratio_config_path: {type: path, required: true}
narratio_config_owner: {type: str, required: true}
narratio_config_group: {type: str, required: true}
narratio_config_directory_mode: {type: str, required: true}
narratio_config_file_mode: {type: str, required: true}
narratio_workspace_root: {type: path, required: true} narratio_workspace_root: {type: path, required: true}
narratio_campaigns_root: {type: path, required: true} narratio_campaigns_root: {type: path, required: true}
narratio_spool_root: {type: path, required: true} narratio_spool_root: {type: path, required: true}

View File

@@ -58,9 +58,9 @@
ansible.builtin.file: ansible.builtin.file:
path: "{{ narratio_config_path | dirname }}" path: "{{ narratio_config_path | dirname }}"
state: directory state: directory
owner: root owner: "{{ narratio_config_owner }}"
group: "{{ narratio_group }}" group: "{{ narratio_config_group }}"
mode: "0750" mode: "{{ narratio_config_directory_mode }}"
- name: Create mutable Narratio roots - name: Create mutable Narratio roots
become: true become: true
@@ -142,6 +142,6 @@
ansible.builtin.template: ansible.builtin.template:
src: pipeline.yml.j2 src: pipeline.yml.j2
dest: "{{ narratio_config_path }}" dest: "{{ narratio_config_path }}"
owner: root owner: "{{ narratio_config_owner }}"
group: "{{ narratio_group }}" group: "{{ narratio_config_group }}"
mode: "0640" mode: "{{ narratio_config_file_mode }}"