Make Notarius configuration ownership configurable
This commit is contained in:
17
README.md
17
README.md
@@ -16,6 +16,10 @@ notarius_manage_build_dependencies: true
|
|||||||
notarius_go_snap_channel: 1.26/stable
|
notarius_go_snap_channel: 1.26/stable
|
||||||
notarius_go_binary: /snap/bin/go
|
notarius_go_binary: /snap/bin/go
|
||||||
notarius_config_path: /usr/local/etc/notarius/config.yml
|
notarius_config_path: /usr/local/etc/notarius/config.yml
|
||||||
|
notarius_config_owner: root
|
||||||
|
notarius_config_group: root
|
||||||
|
notarius_config_directory_mode: "0755"
|
||||||
|
notarius_config_file_mode: "0644"
|
||||||
notarius_config_version: 4
|
notarius_config_version: 4
|
||||||
notarius_promptkit_profile_dir: null
|
notarius_promptkit_profile_dir: null
|
||||||
notarius_promptkit_profile_file: null
|
notarius_promptkit_profile_file: null
|
||||||
@@ -43,10 +47,15 @@ the binary is `root:root` mode `0755`.
|
|||||||
Configuration variables map directly to Notarius's versioned YAML fields.
|
Configuration variables map directly to Notarius's versioned YAML fields.
|
||||||
Every optional value defaults to `null`, so it and any empty parent section are
|
Every optional value defaults to `null`, so it and any empty parent section are
|
||||||
omitted and Notarius retains ownership of its built-in defaults. The role always
|
omitted and Notarius retains ownership of its built-in defaults. The role always
|
||||||
emits `notarius_config_version` as `version` and writes the file as `root:root`
|
emits `notarius_config_version` as `version`. It manages
|
||||||
mode `0644`. `notarius_pipelines` is the native mapping supplied by the caller;
|
`notarius_config_path | dirname` and the resulting file with
|
||||||
the role does not merge or rewrite it. For example, inventory can compose
|
`notarius_config_owner`, `notarius_config_group`,
|
||||||
fragments in the ordinary way:
|
`notarius_config_directory_mode`, and `notarius_config_file_mode`. The
|
||||||
|
standalone defaults are `root:root`, directory mode `0755`, and file mode
|
||||||
|
`0644`; composing roles may override this generic configuration interface.
|
||||||
|
`notarius_pipelines` is the native mapping supplied by the caller; the role
|
||||||
|
does not merge or rewrite it. For example, inventory can compose fragments in
|
||||||
|
the ordinary way:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
notarius_pipelines: "{{ notarius_pipeline_group_one | combine(notarius_pipeline_group_two) }}"
|
notarius_pipelines: "{{ notarius_pipeline_group_one | combine(notarius_pipeline_group_two) }}"
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ notarius_manage_build_dependencies: true
|
|||||||
notarius_go_snap_channel: 1.26/stable
|
notarius_go_snap_channel: 1.26/stable
|
||||||
notarius_go_binary: /snap/bin/go
|
notarius_go_binary: /snap/bin/go
|
||||||
notarius_config_path: /usr/local/etc/notarius/config.yml
|
notarius_config_path: /usr/local/etc/notarius/config.yml
|
||||||
|
notarius_config_owner: root
|
||||||
|
notarius_config_group: root
|
||||||
|
notarius_config_directory_mode: "0755"
|
||||||
|
notarius_config_file_mode: "0644"
|
||||||
notarius_config_version: 4
|
notarius_config_version: 4
|
||||||
notarius_promptkit_profile_dir: null
|
notarius_promptkit_profile_dir: null
|
||||||
notarius_promptkit_profile_file: null
|
notarius_promptkit_profile_file: null
|
||||||
|
|||||||
@@ -27,6 +27,18 @@ argument_specs:
|
|||||||
notarius_config_path:
|
notarius_config_path:
|
||||||
type: path
|
type: path
|
||||||
required: true
|
required: true
|
||||||
|
notarius_config_owner:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
notarius_config_group:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
notarius_config_directory_mode:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
notarius_config_file_mode:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
notarius_config_version:
|
notarius_config_version:
|
||||||
type: int
|
type: int
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
@@ -36,7 +36,15 @@
|
|||||||
loop:
|
loop:
|
||||||
- "{{ notarius_source_dir | dirname }}"
|
- "{{ notarius_source_dir | dirname }}"
|
||||||
- "{{ notarius_binary_path | dirname }}"
|
- "{{ notarius_binary_path | dirname }}"
|
||||||
- "{{ notarius_config_path | dirname }}"
|
|
||||||
|
- name: Create the Notarius configuration directory
|
||||||
|
become: true
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ notarius_config_path | dirname }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ notarius_config_owner }}"
|
||||||
|
group: "{{ notarius_config_group }}"
|
||||||
|
mode: "{{ notarius_config_directory_mode }}"
|
||||||
|
|
||||||
- name: Check out Notarius source
|
- name: Check out Notarius source
|
||||||
become: true
|
become: true
|
||||||
@@ -96,6 +104,6 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: config.yml.j2
|
src: config.yml.j2
|
||||||
dest: "{{ notarius_config_path }}"
|
dest: "{{ notarius_config_path }}"
|
||||||
owner: root
|
owner: "{{ notarius_config_owner }}"
|
||||||
group: root
|
group: "{{ notarius_config_group }}"
|
||||||
mode: "0644"
|
mode: "{{ notarius_config_file_mode }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user