1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00

update molecule linting

This commit is contained in:
L3D 2022-10-06 15:06:46 +02:00
parent e3732c72c3
commit ec841d18a5
Signed by: l3d
GPG key ID: CD08445BFF4313D1
7 changed files with 32 additions and 25 deletions

View file

@ -2,10 +2,10 @@
- name: Converge
hosts: all
roles:
- {role: ansible_role_restic}
- {role: ../../}
pre_tasks:
- name: install bzip2
package:
- name: Install bzip2
ansible.builtin.package:
name: bzip2
state: present
vars:
@ -36,10 +36,10 @@
- name: Converge with dict
hosts: all
roles:
- role: ansible_role_restic
- {role: ../../}
pre_tasks:
- name: install bzip2
package:
- name: Install bzip2
ansible.builtin.package:
name: bzip2
state: present
vars:

View file

@ -1,9 +1,9 @@
---
- name: "include tasks for testing backup files"
include_tasks: "test_backup_files.yml"
- name: "Include tasks for testing backup files"
ansible.builtin.include_tasks: "test_backup_files.yml"
- name: "include tasks for testing access files"
include_tasks: "test_access_files.yml"
- name: "Include tasks for testing access files"
ansible.builtin.include_tasks: "test_access_files.yml"
- name: "include tasks for testing restic link"
include_tasks: "test_restic_link.yml"
- name: "Include tasks for testing restic link"
ansible.builtin.include_tasks: "test_restic_link.yml"

View file

@ -1,18 +1,20 @@
---
- name: Stat test access file
stat:
ansible.builtin.stat:
path: /opt/restic/access-test.sh
register: test_file
- name: Check that the test access file exists
assert:
ansible.builtin.assert:
that:
- test_file.stat.exists
- name: Stat test_stdin access file
stat:
ansible.builtin.stat:
path: /opt/restic/access-test_stdin.sh
register: test_stdin_file
- name: Check that the test_stdin access file exists
assert:
ansible.builtin.assert:
that:
- test_stdin_file.stat.exists

View file

@ -1,27 +1,31 @@
---
- name: Stat test backup file
stat:
ansible.builtin.stat:
path: /opt/restic/backup-test.sh
register: test_file
- name: Check that the test backup file exists
assert:
ansible.builtin.assert:
that:
- test_file.stat.exists
- name: Stat test_stdin backup file
stat:
ansible.builtin.stat:
path: /opt/restic/backup-test_stdin.sh
register: test_stdin_file
- name: Check that the test_stdin backup file exists
assert:
ansible.builtin.assert:
that:
- test_stdin_file.stat.exists
- name: Run the backup scripts
shell: "./{{ item }}"
ansible.builtin.shell: "./{{ item }}"
args:
chdir: /opt/restic/
with_items:
- backup-dicttest.sh
- backup-test.sh
- backup-test_stdin.sh
changed_when: true
tags: skip_ansible_lint_rule_command-instead-of-shell

View file

@ -1,9 +1,10 @@
---
- name: Stat test restic link
stat:
ansible.builtin.stat:
path: ~/restic/restic
register: restic_link
- name: Check that the test restic link exists
assert:
ansible.builtin.assert:
that:
- restic_link.stat.exists

View file

@ -4,5 +4,5 @@
hosts: all
tasks:
- name: "Include test_alpha-services"
include_role:
ansible.builtin.include_role:
name: "test_restic"

View file

@ -10,5 +10,5 @@ restic_os_variables:
paths:
- 'vars'
playbook_version_number: 25 # should be int
playbook_version_number: 26 # should be int
playbook_version_path: 'do1jlr.restic.version'