From 0935f2248bb0a8fea8701b7d8f7aa6e93618823d Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 6 Nov 2022 20:30:48 +0100 Subject: [PATCH] Removing broken molecule test --- .github/workflows/ansible-linting-check.yml | 6 +- .github/workflows/test.yml | 59 ------------------- molecule/default/molecule.yml | 26 -------- molecule/default/playbook.yml | 59 ------------------- molecule/default/test_restic/tasks/main.yml | 9 --- .../test_restic/tasks/test_access_files.yml | 18 ------ .../test_restic/tasks/test_backup_files.yml | 27 --------- .../test_restic/tasks/test_restic_link.yml | 9 --- molecule/default/verify.yml | 8 --- 9 files changed, 3 insertions(+), 218 deletions(-) delete mode 100644 .github/workflows/test.yml delete mode 100644 molecule/default/molecule.yml delete mode 100644 molecule/default/playbook.yml delete mode 100644 molecule/default/test_restic/tasks/main.yml delete mode 100644 molecule/default/test_restic/tasks/test_access_files.yml delete mode 100644 molecule/default/test_restic/tasks/test_backup_files.yml delete mode 100644 molecule/default/test_restic/tasks/test_restic_link.yml delete mode 100644 molecule/default/verify.yml diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml index 2dc2583..150e908 100644 --- a/.github/workflows/ansible-linting-check.yml +++ b/.github/workflows/ansible-linting-check.yml @@ -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: "" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 556bc9c..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -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.4 - 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 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml deleted file mode 100644 index d8c54b7..0000000 --- a/molecule/default/molecule.yml +++ /dev/null @@ -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 diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml deleted file mode 100644 index 9d261ab..0000000 --- a/molecule/default/playbook.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -- name: Converge - hosts: all - roles: - - {role: ansible_role_restic} - pre_tasks: - - name: install bzip2 - 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: ansible_role_restic - pre_tasks: - - name: install bzip2 - 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 diff --git a/molecule/default/test_restic/tasks/main.yml b/molecule/default/test_restic/tasks/main.yml deleted file mode 100644 index 21e1674..0000000 --- a/molecule/default/test_restic/tasks/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: "include tasks for testing backup files" - include_tasks: "test_backup_files.yml" - -- name: "include tasks for testing access files" - include_tasks: "test_access_files.yml" - -- name: "include tasks for testing restic link" - include_tasks: "test_restic_link.yml" diff --git a/molecule/default/test_restic/tasks/test_access_files.yml b/molecule/default/test_restic/tasks/test_access_files.yml deleted file mode 100644 index 4cb1fc5..0000000 --- a/molecule/default/test_restic/tasks/test_access_files.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Stat test access file - stat: - path: /opt/restic/access-test.sh - register: test_file -- name: Check that the test access file exists - assert: - that: - - test_file.stat.exists - -- name: Stat test_stdin access file - stat: - path: /opt/restic/access-test_stdin.sh - register: test_stdin_file -- name: Check that the test_stdin access file exists - assert: - that: - - test_stdin_file.stat.exists diff --git a/molecule/default/test_restic/tasks/test_backup_files.yml b/molecule/default/test_restic/tasks/test_backup_files.yml deleted file mode 100644 index c6fd0e8..0000000 --- a/molecule/default/test_restic/tasks/test_backup_files.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Stat test backup file - stat: - path: /opt/restic/backup-test.sh - register: test_file -- name: Check that the test backup file exists - assert: - that: - - test_file.stat.exists - -- name: Stat test_stdin backup file - stat: - path: /opt/restic/backup-test_stdin.sh - register: test_stdin_file -- name: Check that the test_stdin backup file exists - assert: - that: - - test_stdin_file.stat.exists - -- name: Run the backup scripts - shell: "./{{ item }}" - args: - chdir: /opt/restic/ - with_items: - - backup-dicttest.sh - - backup-test.sh - - backup-test_stdin.sh diff --git a/molecule/default/test_restic/tasks/test_restic_link.yml b/molecule/default/test_restic/tasks/test_restic_link.yml deleted file mode 100644 index eba08b2..0000000 --- a/molecule/default/test_restic/tasks/test_restic_link.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: Stat test restic link - stat: - path: ~/restic/restic - register: restic_link -- name: Check that the test restic link exists - assert: - that: - - restic_link.stat.exists diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml deleted file mode 100644 index b468d1f..0000000 --- a/molecule/default/verify.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# This is an example playbook to execute Ansible tests. -- name: Verify - hosts: all - tasks: - - name: "Include test_alpha-services" - include_role: - name: "test_restic"