diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 2e5bb10..b411cbf 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run ansible-lint - uses: ansible-community/ansible-lint-action@v6 + uses: ansible/ansible-lint@v24 diff --git a/.github/workflows/ansible-release.yml b/.github/workflows/ansible-release.yml index 397b4c8..fb2cde9 100644 --- a/.github/workflows/ansible-release.yml +++ b/.github/workflows/ansible-release.yml @@ -12,7 +12,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: path: "dbrennand.autorestic" @@ -22,9 +22,9 @@ jobs: - id: role_name run: echo "::set-output name=role_name::$(yq -r '.galaxy_info.role_name' meta/main.yml)" - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - run: pip3 install ansible-core diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index 8786af3..6b8d07d 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -9,7 +9,7 @@ jobs: molecule: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: path: dbrennand.autorestic - uses: gofrolist/molecule-action@v2 diff --git a/README.md b/README.md index e4a9b67..9c625f1 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,13 @@ autorestic_config: B2_ACCOUNT_KEY: Key ``` -The autorestic YAML configuration to be placed into the `~/.autorestic.yml` file. See the [autorestic documentation](https://autorestic.vercel.app/config) for details on the YAML configuration. +See the [autorestic documentation](https://autorestic.vercel.app/config) for details on the YAML configuration. + +```yaml +autorestic_config_file: ~/.autorestic.yml +``` + +The autorestic YAML configuration to be placed into the `~/.autorestic.yml` file. ```yaml autorestic_info: false @@ -125,3 +131,5 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) for [**PleaseStopAsking**](https://github.com/PleaseStopAsking) - *Contributor* [**markstos**](https://github.com/markstos) - *Contributor* + +[**micxer**](https://github.com/micxer) - *Contributor* diff --git a/defaults/main.yml b/defaults/main.yml index 821cc0d..685a068 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_file: ~/.autorestic.yml autorestic_info: false autorestic_check: false autorestic_cron: false diff --git a/tasks/main.yml b/tasks/main.yml index 5c9c708..4914a5a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -48,7 +48,7 @@ - name: Create autorestic configuration file ansible.builtin.copy: content: "{{ autorestic_config | to_yaml }}" - dest: ~/.autorestic.yml + dest: "{{ autorestic_config_file }}" mode: "0600" - name: Run autorestic info @@ -79,7 +79,7 @@ minute: "*/5" job: | {% if autorestic_cron_verbose == true %} - autorestic -c ~/.autorestic.yml --ci cron -vvvvv > /tmp/autorestic.log 2>&1 + autorestic -c {{ autorestic_config_file }} --ci cron -vvvvv > /tmp/autorestic.log 2>&1 {% else %} - autorestic -c ~/.autorestic.yml --ci cron > /tmp/autorestic.log 2>&1 + autorestic -c {{ autorestic_config_file }} --ci cron > /tmp/autorestic.log 2>&1 {% endif %} diff --git a/tasks/removal.yml b/tasks/removal.yml index 57ad6ea..ac5d1d1 100644 --- a/tasks/removal.yml +++ b/tasks/removal.yml @@ -11,7 +11,7 @@ - name: Remove autorestic configuration file ansible.builtin.file: - path: ~/.autorestic.yml + path: "{{ autorestic_config_file }}" state: absent - name: Remove restic binary @@ -37,5 +37,5 @@ ansible.builtin.cron: name: Configure autorestic crontab job minute: "*/5" - job: autorestic -c ~/.autorestic.yml --ci cron > /tmp/autorestic.log 2>&1 + job: autorestic -c {{ autorestic_config_file }} --ci cron > /tmp/autorestic.log 2>&1 state: absent