Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/#12 #15

Merged
merged 6 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"image": "ghcr.io/ansible/creator-ee:v0.13.0",
"image": "ghcr.io/ansible/community-ansible-dev-tools:v24.7.2",
"customizations": {
"vscode": {
"extensions": [
"redhat.ansible",
"streetsidesoftware.code-spell-checker",
"github.copilot",
"yzhang.markdown-all-in-one",
"eamodio.gitlens"
"yzhang.markdown-all-in-one"
]
}
},
Expand Down
5 changes: 0 additions & 5 deletions .gitpod.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Daniel Brennand
Copyright (c) 2024 Daniel Brennand

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Ansible Role: dbrennand.autorestic

[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/dbrennand/ansible-role-autorestic)
![Ansible-Lint](https://github.com/dbrennand/ansible-role-autorestic/actions/workflows/ansible-lint.yml/badge.svg)
![Molecule](https://github.com/dbrennand/ansible-role-autorestic/actions/workflows/molecule.yml/badge.svg)
![Ansible-Release](https://github.com/dbrennand/ansible-role-autorestic/actions/workflows/ansible-release.yml/badge.svg)
Expand Down Expand Up @@ -64,6 +63,12 @@ autorestic_config:

See the [autorestic documentation](https://autorestic.vercel.app/config) for details on the YAML configuration.

```yaml
autorestic_config_template: autorestic.yml.j2
```

The [`autorestic.yml.j2`](templates/autorestic.yml.j2) template to use for the autorestic YAML configuration. By default the content of `autorestic_config` is templated. This can be overridden to use a custom template. See [#14](https://github.com/dbrennand/ansible-role-autorestic/issues/14#issuecomment-2198394106) for an example.

```yaml
autorestic_config_file: ~/.autorestic.yml
```
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
when: autorestic_architecture is defined

- name: Create autorestic configuration file
ansible.builtin.copy:
content: "{{ autorestic_config | to_yaml }}"
ansible.builtin.template:
src: "{{ autorestic_config_template }}"
dest: "{{ autorestic_config_file }}"
mode: "0600"

Expand Down
1 change: 1 addition & 0 deletions templates/autorestic.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ autorestic_config | to_nice_yaml }}