Skip to content

Commit

Permalink
Merge pull request #1924 from pulibrary/1911_workers_molecule3
Browse files Browse the repository at this point in the history
1911 workers molecule3
  • Loading branch information
carolyncole authored Dec 7, 2020
2 parents c493aed + a4108d0 commit 96f7309
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 246 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/molecule_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
- subversion
- blacklight_app
- figgy
- sidekiq_worker
- sneakers_worker
steps:
- name: Checkout branch
run: |
Expand Down
3 changes: 3 additions & 0 deletions roles/sidekiq_worker/.ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
skip_list:
- '303'
- '306'
5 changes: 4 additions & 1 deletion roles/sidekiq_worker/.yamllint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
extends: default

rules:
Expand All @@ -8,4 +9,6 @@ rules:
max-spaces-inside: 1
level: error
line-length: disable
truthy: disable
# NOTE(retr0h): Templates no longer fail this lint rule.
# Uncomment if running old Molecule templates.
# truthy: disable
14 changes: 0 additions & 14 deletions roles/sidekiq_worker/molecule/default/Dockerfile.j2

This file was deleted.

4 changes: 2 additions & 2 deletions roles/sidekiq_worker/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
update_cache: true
cache_valid_time: 600
tasks:
- name: "Include example"
- name: "Include rails_app"
include_role:
name: example
name: sidekiq_worker
26 changes: 8 additions & 18 deletions roles/sidekiq_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
32 changes: 0 additions & 32 deletions roles/sidekiq_worker/molecule/default/molecule.yml-e

This file was deleted.

7 changes: 0 additions & 7 deletions roles/sidekiq_worker/molecule/default/playbook.yml

This file was deleted.

14 changes: 0 additions & 14 deletions roles/sidekiq_worker/molecule/default/tests/test_sidekiq_worker.py

This file was deleted.

24 changes: 11 additions & 13 deletions roles/sidekiq_worker/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@
hosts: all
gather_facts: false
tasks:
- name: check ruby package status
package:
name: "{{ item }}"
- name: test for deploy user on sudoers
lineinfile:
path: "/etc/sudoers"
line: "{{ item }}"
state: present
check_mode: true
register: pkg_status
loop:
- ruby-switch
- ruby2.6-dev
- ruby2.6

- name: test for ruby packages
assert:
that:
- not pkg_status.changed
- "deploy ALL=(ALL) NOPASSWD: /usr/sbin/service sidekiq-workers status"
- "deploy ALL=(ALL) NOPASSWD: /usr/sbin/service sidekiq-workers restart"
- "deploy ALL=(ALL) NOPASSWD: /usr/sbin/service sidekiq-workers start"
check_mode: true
register: present
failed_when:
- present is changed
46 changes: 0 additions & 46 deletions roles/sidekiq_worker/molecule/default/yaml-lint.yml

This file was deleted.

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 96f7309

Please sign in to comment.