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

Merge pull request #85 from roles-ansible/linting

update molecule linting
This commit is contained in:
L3D 2022-11-06 21:07:08 +01:00 committed by GitHub
commit e41e115291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 25 deletions

View file

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

View file

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

View file

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

View file

@ -1,27 +1,31 @@
--- ---
- name: Stat test backup file - name: Stat test backup file
stat: ansible.builtin.stat:
path: /opt/restic/backup-test.sh path: /opt/restic/backup-test.sh
register: test_file register: test_file
- name: Check that the test backup file exists - name: Check that the test backup file exists
assert: ansible.builtin.assert:
that: that:
- test_file.stat.exists - test_file.stat.exists
- name: Stat test_stdin backup file - name: Stat test_stdin backup file
stat: ansible.builtin.stat:
path: /opt/restic/backup-test_stdin.sh path: /opt/restic/backup-test_stdin.sh
register: test_stdin_file register: test_stdin_file
- name: Check that the test_stdin backup file exists - name: Check that the test_stdin backup file exists
assert: ansible.builtin.assert:
that: that:
- test_stdin_file.stat.exists - test_stdin_file.stat.exists
- name: Run the backup scripts - name: Run the backup scripts
shell: "./{{ item }}" ansible.builtin.shell: "./{{ item }}"
args: args:
chdir: /opt/restic/ chdir: /opt/restic/
with_items: with_items:
- backup-dicttest.sh - backup-dicttest.sh
- backup-test.sh - backup-test.sh
- backup-test_stdin.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 - name: Stat test restic link
stat: ansible.builtin.stat:
path: ~/restic/restic path: ~/restic/restic
register: restic_link register: restic_link
- name: Check that the test restic link exists - name: Check that the test restic link exists
assert: ansible.builtin.assert:
that: that:
- restic_link.stat.exists - restic_link.stat.exists

View file

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

View file

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