mirror of
https://github.com/roles-ansible/ansible_role_restic/
synced 2024-12-13 05:10:18 +01:00
Merge pull request #90 from roles-ansible/lint
Removing broken molecule test
This commit is contained in:
commit
dfef3cc26c
10 changed files with 3 additions and 226 deletions
6
.github/workflows/ansible-linting-check.yml
vendored
6
.github/workflows/ansible-linting-check.yml
vendored
|
@ -14,10 +14,10 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: 'checkout git repo'
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Lint Ansible Playbook
|
||||
- name: 'Lint Ansible Playbook'
|
||||
uses: ansible/ansible-lint-action@v6
|
||||
with:
|
||||
targets: "."
|
||||
args: ""
|
||||
|
|
59
.github/workflows/test.yml
vendored
59
.github/workflows/test.yml
vendored
|
@ -1,59 +0,0 @@
|
|||
---
|
||||
name: 🎭 Tests
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- defaults/**
|
||||
- handlers/**
|
||||
- meta/**
|
||||
- molecule/**
|
||||
- tasks/**
|
||||
- templates/**
|
||||
- vars/**
|
||||
- .github/**
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: 📝 Linting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# Full git history is needed to get a proper list of changed files within `super-linter`
|
||||
fetch-depth: 0
|
||||
- name: Lint Code Base
|
||||
uses: github/super-linter@v4.9.7
|
||||
env:
|
||||
VALIDATE_ALL_CODEBASE: false
|
||||
VALIDATE_ANSIBLE: true
|
||||
ANSIBLE_DIRECTORY: './'
|
||||
DEFAULT_BRANCH: main
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
molecule:
|
||||
name: 🧪 Molecule test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
distro:
|
||||
- ubuntu1804
|
||||
- ubuntu2004
|
||||
- ubuntu2204
|
||||
- debian9
|
||||
- debian10
|
||||
- debian11
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: "${{ github.repository }}"
|
||||
- name: molecule
|
||||
uses: robertdebock/molecule-action@4.0.9
|
||||
env:
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
with:
|
||||
image: ubuntu
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
> **Beta:** This role is in beta status.
|
||||
|
||||
[![🎭 Tests](https://github.com/roles-ansible/ansible_role_restic/actions/workflows/test.yml/badge.svg)](https://github.com/roles-ansible/ansible_role_restic/actions/workflows/test.yml)
|
||||
[![license](https://raw.githubusercontent.com/roles-ansible/ansible_role_restic/main/.github/license.svg)](https://github.com/roles-ansible/ansible_role_restic/blob/main/LICENSE)
|
||||
[![Ansible Galaxy](https://raw.githubusercontent.com/roles-ansible/ansible_role_restic/main/.github/galaxy.svg)](https://galaxy.ansible.com/do1jlr/restic)
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
# lint: |
|
||||
# set -e
|
||||
# yamllint .
|
||||
platforms:
|
||||
- name: instance
|
||||
image: 'geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest'
|
||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
# lint:
|
||||
# name: ansible-lint
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
|
||||
scenario:
|
||||
name: default
|
||||
verifier:
|
||||
name: ansible
|
|
@ -1,59 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
roles:
|
||||
- {role: ../../}
|
||||
pre_tasks:
|
||||
- name: Install bzip2
|
||||
ansible.builtin.package:
|
||||
name: bzip2
|
||||
state: present
|
||||
vars:
|
||||
restic_download_path: ~/restic
|
||||
restic_install_path: ~/restic
|
||||
restic_repos:
|
||||
local:
|
||||
location: /backup
|
||||
password: securepassword1
|
||||
init: true
|
||||
restic_backups:
|
||||
- name: test
|
||||
src: /home
|
||||
repo: local
|
||||
keep_last: 4
|
||||
keep_tag: deployment
|
||||
- name: test_stdin
|
||||
repo: local
|
||||
stdin: true
|
||||
stdin_cmd: echo "this comes from stdin"
|
||||
stdin_filename: stdin.txt
|
||||
keep_last: 2
|
||||
keep_hourly: 24
|
||||
keep_daily: 7
|
||||
keep_monthly: 12
|
||||
keep_yearly: 5
|
||||
|
||||
- name: Converge with dict
|
||||
hosts: all
|
||||
roles:
|
||||
- {role: ../../}
|
||||
pre_tasks:
|
||||
- name: Install bzip2
|
||||
ansible.builtin.package:
|
||||
name: bzip2
|
||||
state: present
|
||||
vars:
|
||||
restic_download_path: ~/restic
|
||||
restic_install_path: ~/restic
|
||||
restic_repos:
|
||||
local:
|
||||
location: /backup
|
||||
password: securepassword1
|
||||
init: true
|
||||
restic_backups:
|
||||
dicttest:
|
||||
name: dicttest
|
||||
src: /home
|
||||
repo: local
|
||||
keep_last: 4
|
||||
keep_tag: deployment
|
|
@ -1,9 +0,0 @@
|
|||
---
|
||||
- name: "Include tasks for testing backup files"
|
||||
ansible.builtin.include_tasks: "test_backup_files.yml"
|
||||
|
||||
- name: "Include tasks for testing access files"
|
||||
ansible.builtin.include_tasks: "test_access_files.yml"
|
||||
|
||||
- name: "Include tasks for testing restic link"
|
||||
ansible.builtin.include_tasks: "test_restic_link.yml"
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
- name: Stat test access file
|
||||
ansible.builtin.stat:
|
||||
path: /opt/restic/access-test.sh
|
||||
register: test_file
|
||||
|
||||
- name: Check that the test access file exists
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- test_file.stat.exists
|
||||
|
||||
- name: Stat test_stdin access file
|
||||
ansible.builtin.stat:
|
||||
path: /opt/restic/access-test_stdin.sh
|
||||
register: test_stdin_file
|
||||
|
||||
- name: Check that the test_stdin access file exists
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- test_stdin_file.stat.exists
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
- name: Stat test backup file
|
||||
ansible.builtin.stat:
|
||||
path: /opt/restic/backup-test.sh
|
||||
register: test_file
|
||||
|
||||
- name: Check that the test backup file exists
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- test_file.stat.exists
|
||||
|
||||
- name: Stat test_stdin backup file
|
||||
ansible.builtin.stat:
|
||||
path: /opt/restic/backup-test_stdin.sh
|
||||
register: test_stdin_file
|
||||
|
||||
- name: Check that the test_stdin backup file exists
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- test_stdin_file.stat.exists
|
||||
|
||||
- name: Run the backup scripts
|
||||
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
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
- name: Stat test restic link
|
||||
ansible.builtin.stat:
|
||||
path: ~/restic/restic
|
||||
register: restic_link
|
||||
|
||||
- name: Check that the test restic link exists
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- restic_link.stat.exists
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
# This is an example playbook to execute Ansible tests.
|
||||
- name: Verify
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include test_alpha-services"
|
||||
ansible.builtin.include_role:
|
||||
name: "test_restic"
|
Loading…
Reference in a new issue