This repository has been archived by the owner on Jun 12, 2020. It is now read-only.
forked from donat-b/ansible-restic
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate changes from cloudalchemy roles (#52)
* more efficient checksum handling; clearer CPU architecture management * align test-requirements with cloudalchemy/skeleton * do not change default user and group in default test scenario * add "latest" test scenario * add tags * specify which parts need elevated privileges * fix tests * [minor] release
- Loading branch information
1 parent
b264be2
commit 71b368d
Showing
13 changed files
with
113 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then | ||
tox -- molecule test --all | ||
else | ||
tox -- molecule test -s default --destroy always | ||
tox -- molecule test -s alternative --destroy never | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
lint: | ||
name: yamllint | ||
platforms: | ||
- name: stretch | ||
image: paulfantom/debian-molecule:9 | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
- name: fedora | ||
image: paulfantom/fedora-molecule:27 | ||
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" | ||
privileged: true | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
provisioner: | ||
name: ansible | ||
lint: | ||
name: ansible-lint | ||
playbooks: | ||
create: ../default/create.yml | ||
prepare: ../default/prepare.yml | ||
converge: playbook.yml | ||
destroy: ../default/destroy.yml | ||
scenario: | ||
name: latest | ||
verifier: | ||
name: testinfra | ||
lint: | ||
name: flake8 | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
- name: Default use-case scenario | ||
hosts: all | ||
any_errors_fatal: true | ||
roles: | ||
- ansible-restic | ||
vars: | ||
restic_version: latest | ||
restic_user: restic | ||
restic_group: restic | ||
restic_repos: | ||
- name: local-example | ||
url: "/tmp/restic" | ||
password: "correcthorsebatterystaple" | ||
jobs: | ||
- command: 'restic backup /srv' | ||
at: '0 1 * * *' | ||
retention_time: '17 5 * * *' | ||
retention: | ||
last: 2 | ||
hourly: 4 | ||
weekly: 9 | ||
monthly: 3 | ||
yearly: 10 | ||
tags: | ||
- special | ||
- test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
import testinfra.utils.ansible_runner | ||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') | ||
|
||
|
||
def test_binary(host): | ||
binary = host.file("/usr/local/bin/restic") | ||
assert binary.exists | ||
assert binary.is_file | ||
assert binary.mode == 0o750 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
--- | ||
- include: preflight.yml | ||
tags: | ||
- restic_install | ||
- restic_configure | ||
|
||
- include: install.yml | ||
become: true | ||
tags: | ||
- restic_install | ||
|
||
- include: configure.yml | ||
become: true | ||
tags: | ||
- restic_configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
ansible-lint>=3.4.0 | ||
docker | ||
jmespath | ||
molecule>=2.15.0 | ||
pytest==3.9.3 | ||
docker | ||
ansible-lint>=3.4.0 | ||
testinfra>=1.7.0 | ||
jmespath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters