mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-12 19:48:47 +00:00
Calibre testing
This commit is contained in:
parent
03454fd592
commit
4581e480c1
4 changed files with 52 additions and 0 deletions
6
roles/calibre/molecule/default/molecule.yml
Normal file
6
roles/calibre/molecule/default/molecule.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
provisioner:
|
||||||
|
inventory:
|
||||||
|
group_vars:
|
||||||
|
all:
|
||||||
|
calibre_enabled: true
|
10
roles/calibre/molecule/default/side_effect.yml
Normal file
10
roles/calibre/molecule/default/side_effect.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: Stop
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
|
||||||
|
include_role:
|
||||||
|
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
|
||||||
|
vars:
|
||||||
|
calibre_enabled: false
|
18
roles/calibre/molecule/default/verify.yml
Normal file
18
roles/calibre/molecule/default/verify.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
- name: Verify
|
||||||
|
hosts: all
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- include_vars:
|
||||||
|
file: ../../defaults/main.yml
|
||||||
|
|
||||||
|
- name: Get container state
|
||||||
|
docker_container_info:
|
||||||
|
name: "{{ calibre_container_name }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Check Calibre is running
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.container['State']['Status'] == "running"
|
||||||
|
- result.container['State']['Restarting'] == false
|
18
roles/calibre/molecule/default/verify_stopped.yml
Normal file
18
roles/calibre/molecule/default/verify_stopped.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
- name: Verify
|
||||||
|
hosts: all
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- include_vars:
|
||||||
|
file: ../../defaults/main.yml
|
||||||
|
|
||||||
|
- name: Try and stop and remove Calibre
|
||||||
|
docker_container:
|
||||||
|
name: "{{ calibre_container_name }}"
|
||||||
|
state: absent
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Check Calibre is stopped
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- not result.changed
|
Loading…
Reference in a new issue