Skip to content

Commit

Permalink
add sneakers_workers tests and role to molecule3
Browse files Browse the repository at this point in the history
  • Loading branch information
kayiwa committed Dec 7, 2020
1 parent e0ab82c commit a4108d0
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 99 deletions.
1 change: 1 addition & 0 deletions .github/workflows/molecule_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
- subversion
- figgy
- sidekiq_worker
- sneakers_worker
steps:
- name: Checkout branch
run: |
Expand Down
1 change: 1 addition & 0 deletions roles/sneakers_worker/.yamllint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
extends: default

rules:
Expand Down
14 changes: 0 additions & 14 deletions roles/sneakers_worker/molecule/default/Dockerfile.j2

This file was deleted.

15 changes: 15 additions & 0 deletions roles/sneakers_worker/molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Converge
hosts: all
vars:
- running_on_server: false
become: true
pre_tasks:
- name: update cache
apt:
update_cache: true
cache_valid_time: 600
tasks:
- name: "Include sneakers_worker"
include_role:
name: sneakers_worker
26 changes: 8 additions & 18 deletions roles/sneakers_worker/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,20 @@ scenario:
name: default
driver:
name: docker
lint: |
set -e
yamllint .
ansible-lint
platforms:
- name: instance
image: "pulibrary/puldocker-${MOLECULE_DISTRO:-ubuntu1804}-ansible:latest"
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
playbooks:
converge: playbook.yml
log: true
dependency:
name: galaxy
enabled: false
lint:
name: yamllint
options:
config-file: molecule/default/yaml-lint.yml
verifier:
name: testinfra
env:
PYTHONWARNINGS: "ignore:.*U.*mode is deprecated:DeprecationWarning"
lint:
name: flake8
options:
# show which tests where executed in test output
v: 1
directory: ./tests/
name: ansible
7 changes: 0 additions & 7 deletions roles/sneakers_worker/molecule/default/playbook.yml

This file was deleted.

This file was deleted.

18 changes: 18 additions & 0 deletions roles/sneakers_worker/molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: test for deploy user on sudoers
lineinfile:
path: "/etc/sudoers"
line: "{{ item }}"
state: present
loop:
- "deploy ALL=(ALL) NOPASSWD: /usr/sbin/service sneakers status"
- "deploy ALL=(ALL) NOPASSWD: /usr/sbin/service sneakers restart"
- "deploy ALL=(ALL) NOPASSWD: /usr/sbin/service sneakers start"
check_mode: true
register: present
failed_when:
- present is changed
46 changes: 0 additions & 46 deletions roles/sneakers_worker/molecule/default/yaml-lint.yml

This file was deleted.

0 comments on commit a4108d0

Please sign in to comment.