diff --git a/defaults/main.yml b/defaults/main.yml index 685a068..92882c0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,6 +21,7 @@ autorestic_config: env: B2_ACCOUNT_ID: ID B2_ACCOUNT_KEY: Key +autorestic_config_template: autorestic.yml.j2 autorestic_config_file: ~/.autorestic.yml autorestic_info: false autorestic_check: false diff --git a/tasks/main.yml b/tasks/main.yml index 99283c2..acff862 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -46,8 +46,8 @@ when: autorestic_architecture is defined - name: Create autorestic configuration file - ansible.builtin.copy: - content: "{{ autorestic_config | to_nice_yaml(default_style='\"') }}" + ansible.builtin.template: + src: "{{ autorestic_config_template }}" dest: "{{ autorestic_config_file }}" mode: "0600" diff --git a/templates/autorestic.yml.j2 b/templates/autorestic.yml.j2 new file mode 100644 index 0000000..40a0fd6 --- /dev/null +++ b/templates/autorestic.yml.j2 @@ -0,0 +1 @@ +{{ autorestic_config | to_nice_yaml }}