octoprint: allow additional user configuration of octoprint
Signed-off-by: Thomas Schmid <tom@lfence.de>
This commit is contained in:
parent
3dfff93c0e
commit
f4b6192bc1
@ -52,11 +52,16 @@
|
|||||||
|
|
||||||
- name: Default octoprint config
|
- name: Default octoprint config
|
||||||
set_fact:
|
set_fact:
|
||||||
octoprint_config: "{{ lookup('template', 'config.yaml.j2') | from_yaml }}"
|
octoprint_default_config: "{{ lookup('template', 'config.yaml.j2') | from_yaml }}"
|
||||||
|
|
||||||
|
- name: Apply user config
|
||||||
|
set_fact:
|
||||||
|
octoprint_config_combined: "{{ octoprint_default_config | combine(octoprint_config, recursive=True)}}"
|
||||||
|
when: octoprint_config is defined
|
||||||
|
|
||||||
- name: Initial configuration of octoprint
|
- name: Initial configuration of octoprint
|
||||||
copy:
|
copy:
|
||||||
content: "{{ octoprint_config | to_nice_yaml }}"
|
content: "{{ octoprint_config_combined | to_nice_yaml }}"
|
||||||
dest: "/home/{{ octoprint_user }}/.octoprint/config.yaml"
|
dest: "/home/{{ octoprint_user }}/.octoprint/config.yaml"
|
||||||
when: not octoprint_register_config_stat.stat.exists
|
when: not octoprint_register_config_stat.stat.exists
|
||||||
|
|
||||||
@ -73,7 +78,7 @@
|
|||||||
|
|
||||||
- name: Write updated octoprint configuration
|
- name: Write updated octoprint configuration
|
||||||
copy:
|
copy:
|
||||||
content: "{{ octoprint_config | combine(current_octoprint_config, recursive=True) | to_nice_yaml}}"
|
content: "{{ current_octoprint_config | combine(octoprint_config_combined, recursive=True) | to_nice_yaml}}"
|
||||||
dest: "/home/{{octoprint_user}}/.octoprint/config.yaml"
|
dest: "/home/{{octoprint_user}}/.octoprint/config.yaml"
|
||||||
notify: Restart octoprint
|
notify: Restart octoprint
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user