Make Scriptorium configuration ownership configurable
This commit is contained in:
16
README.md
16
README.md
@@ -16,6 +16,10 @@ scriptorium_manage_build_dependencies: true
|
|||||||
scriptorium_go_snap_channel: 1.26/stable
|
scriptorium_go_snap_channel: 1.26/stable
|
||||||
scriptorium_go_binary: /snap/bin/go
|
scriptorium_go_binary: /snap/bin/go
|
||||||
scriptorium_config_path: /usr/local/etc/scriptorium/config.yml
|
scriptorium_config_path: /usr/local/etc/scriptorium/config.yml
|
||||||
|
scriptorium_config_owner: root
|
||||||
|
scriptorium_config_group: root
|
||||||
|
scriptorium_config_directory_mode: "0755"
|
||||||
|
scriptorium_config_file_mode: "0644"
|
||||||
scriptorium_prompt_dir: null
|
scriptorium_prompt_dir: null
|
||||||
scriptorium_profile_dir: null
|
scriptorium_profile_dir: null
|
||||||
scriptorium_schema_dir: null
|
scriptorium_schema_dir: null
|
||||||
@@ -40,10 +44,14 @@ binary is `root:root` mode `0755`.
|
|||||||
Every application configuration variable defaults to `null`, so it and any
|
Every application configuration variable defaults to `null`, so it and any
|
||||||
empty parent section are omitted and Scriptorium retains ownership of its
|
empty parent section are omitted and Scriptorium retains ownership of its
|
||||||
built-in defaults. When no values are selected, the role writes `{}` to
|
built-in defaults. When no values are selected, the role writes `{}` to
|
||||||
`scriptorium_config_path` as `root:root` mode `0644`. Non-null falsey values
|
`scriptorium_config_path`. It manages that file and its parent directory with
|
||||||
are retained. `scriptorium_backends` is the native mapping supplied by the
|
`scriptorium_config_owner`, `scriptorium_config_group`,
|
||||||
caller; the role does not merge or rewrite it. For example, inventory can
|
`scriptorium_config_directory_mode`, and `scriptorium_config_file_mode`. The
|
||||||
compose fragments in the ordinary way:
|
standalone defaults are `root:root`, directory mode `0755`, and file mode
|
||||||
|
`0644`; composing roles may override this generic configuration interface.
|
||||||
|
Non-null falsey values are retained. `scriptorium_backends` 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
|
||||||
scriptorium_backends: "{{ scriptorium_local_backends | combine(scriptorium_remote_backends) }}"
|
scriptorium_backends: "{{ scriptorium_local_backends | combine(scriptorium_remote_backends) }}"
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ scriptorium_manage_build_dependencies: true
|
|||||||
scriptorium_go_snap_channel: 1.26/stable
|
scriptorium_go_snap_channel: 1.26/stable
|
||||||
scriptorium_go_binary: /snap/bin/go
|
scriptorium_go_binary: /snap/bin/go
|
||||||
scriptorium_config_path: /usr/local/etc/scriptorium/config.yml
|
scriptorium_config_path: /usr/local/etc/scriptorium/config.yml
|
||||||
|
scriptorium_config_owner: root
|
||||||
|
scriptorium_config_group: root
|
||||||
|
scriptorium_config_directory_mode: "0755"
|
||||||
|
scriptorium_config_file_mode: "0644"
|
||||||
scriptorium_prompt_dir: null
|
scriptorium_prompt_dir: null
|
||||||
scriptorium_profile_dir: null
|
scriptorium_profile_dir: null
|
||||||
scriptorium_schema_dir: null
|
scriptorium_schema_dir: null
|
||||||
|
|||||||
@@ -27,6 +27,18 @@ argument_specs:
|
|||||||
scriptorium_config_path:
|
scriptorium_config_path:
|
||||||
type: path
|
type: path
|
||||||
required: true
|
required: true
|
||||||
|
scriptorium_config_owner:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
scriptorium_config_group:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
scriptorium_config_directory_mode:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
scriptorium_config_file_mode:
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
scriptorium_prompt_dir:
|
scriptorium_prompt_dir:
|
||||||
type: path
|
type: path
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@@ -36,7 +36,15 @@
|
|||||||
loop:
|
loop:
|
||||||
- "{{ scriptorium_source_dir | dirname }}"
|
- "{{ scriptorium_source_dir | dirname }}"
|
||||||
- "{{ scriptorium_binary_path | dirname }}"
|
- "{{ scriptorium_binary_path | dirname }}"
|
||||||
- "{{ scriptorium_config_path | dirname }}"
|
|
||||||
|
- name: Create the Scriptorium configuration directory
|
||||||
|
become: true
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ scriptorium_config_path | dirname }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ scriptorium_config_owner }}"
|
||||||
|
group: "{{ scriptorium_config_group }}"
|
||||||
|
mode: "{{ scriptorium_config_directory_mode }}"
|
||||||
|
|
||||||
- name: Check out Scriptorium source
|
- name: Check out Scriptorium source
|
||||||
become: true
|
become: true
|
||||||
@@ -96,6 +104,6 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: config.yml.j2
|
src: config.yml.j2
|
||||||
dest: "{{ scriptorium_config_path }}"
|
dest: "{{ scriptorium_config_path }}"
|
||||||
owner: root
|
owner: "{{ scriptorium_config_owner }}"
|
||||||
group: root
|
group: "{{ scriptorium_config_group }}"
|
||||||
mode: "0644"
|
mode: "{{ scriptorium_config_file_mode }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user