Skip to content

Commit

Permalink
Merge pull request #6 from FuzzyMistborn/config_path
Browse files Browse the repository at this point in the history
Set autorestic_config_directory and create directory
  • Loading branch information
FuzzyMistborn authored Jan 4, 2025
2 parents 6107754 + d735539 commit 3bb7a5d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Other variables that can be changed:
```yaml
autorestic_config_user: root
autorestic_config_yaml: CHANGEME # autorestic configuration in yaml
autorestic_config_path: "{{ autorestic_user_directory }}/.autorestic.yml"
autorestic_config_directory: /home/{{ autorestic_config_user }}/.config/autorestic
autorestic_config_path: "{{ autorestic_config_directory }}/.autorestic.yml"
autorestic_config_mode: 0600
autorestic_config_owner: "{{ autorestic_config_user }}"
autorestic_config_group: "{{ autorestic_config_user }}"
Expand Down
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ autorestic_install_path: "{{ autorestic_install_directory }}/autorestic"
### Autorestic Config
autorestic_config_user: root
autorestic_config_yaml: CHANGEME # autorestic configuration in yaml
autorestic_config_path: "{{ autorestic_user_directory }}/.autorestic.yml"
autorestic_config_directory: /home/{{ autorestic_config_user }}/.config/autorestic
autorestic_config_path: "{{ autorestic_config_directory }}/.autorestic.yml"
autorestic_config_mode: "0600"
autorestic_config_owner: "{{ autorestic_config_user }}"
autorestic_config_group: "{{ autorestic_config_user }}"
Expand Down
8 changes: 8 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
ansible.builtin.set_fact:
autorestic_user_directory: "{{ autorestic_user_register.home }}"

- name: Create autorestic_config_path
ansible.builtin.file:
path: "{{ autorestic_config_directory }}"
owner: "{{ autorestic_config_owner }}"
group: "{{ autorestic_config_group }}"
state: directory
mode: "0755"

- name: Copy autorestic config file
ansible.builtin.copy:
content: "{{ autorestic_config_yaml | to_json(vault_to_text=True) | from_json | to_nice_yaml }}"
Expand Down

0 comments on commit 3bb7a5d

Please sign in to comment.