Add more role tests

This commit is contained in:
David Stephens 2022-09-12 23:27:44 +01:00
parent 4bf13d78fe
commit 10b69f33f0
44 changed files with 586 additions and 0 deletions

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
cloudcmd_enabled: true

View 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:
cloudcmd_enabled: false

View 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: "{{ cloudcmd_container_name }}"
register: result
- name: Check Cloudcmd is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Cloudcmd
docker_container:
name: "{{ cloudcmd_container_name }}"
state: absent
register: result
- name: Check Cloudcmd is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
cloudflare_ddns_enabled: true

View 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:
cloudflare_ddns_enabled: false

View 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: "{{ cloudflare_container_name }}"
register: result
- name: Check Cloudflare DDNS is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Cloudflare DDNS
docker_container:
name: "{{ cloudflare_container_name }}"
state: absent
register: result
- name: Check Cloudflare DDNS is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
code_server_enabled: true

View 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:
code_server_enabled: false

View 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: "{{ code_server_container_name }}"
register: result
- name: Check Code Server is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Code Server
docker_container:
name: "{{ code_server_container_name }}"
state: absent
register: result
- name: Check Code Server is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
couchpotato_enabled: true

View 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:
couchpotato_enabled: false

View 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: "{{ couchpotato_container_name }}"
register: result
- name: Check Couchpotato is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Couchpotato
docker_container:
name: "{{ couchpotato_container_name }}"
state: absent
register: result
- name: Check Couchpotato is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
dashy_enabled: true

View 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:
dashy_enabled: false

View 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: "{{ dashy_container_name }}"
register: result
- name: Check Dashy is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Dashy
docker_container:
name: "{{ dashy_container_name }}"
state: absent
register: result
- name: Check Dashy is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
deluge_enabled: true

View 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:
deluge_enabled: false

View 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: "{{ deluge_container_name }}"
register: result
- name: Check Deluge is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Deluge
docker_container:
name: "{{ deluge_container_name }}"
state: absent
register: result
- name: Check Deluge is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
dokuwiki_enabled: true

View 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:
dokuwiki_enabled: false

View 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: "{{ dokuwiki_container_name }}"
register: result
- name: Check Dokuwiki is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Dokuwiki
docker_container:
name: "{{ dokuwiki_container_name }}"
state: absent
register: result
- name: Check Dokuwiki is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
duplicacy_enabled: true

View 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:
duplicacy_enabled: false

View 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: "{{ duplicacy_container_name }}"
register: result
- name: Check Duplicacy is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Duplicacy
docker_container:
name: "{{ duplicacy_container_name }}"
state: absent
register: result
- name: Check Duplicacy is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
emby_enabled: true

View 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:
emby_enabled: false

View 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: "{{ emby_container_name }}"
register: result
- name: Check Emby is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 Emby
docker_container:
name: "{{ emby_container_name }}"
state: absent
register: result
- name: Check Emby is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
esphome_enabled: true

View 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:
esphome_enabled: false

View 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: "{{ esphome_container_name }}"
register: result
- name: Check EspHome is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View 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 EspHome
docker_container:
name: "{{ esphome_container_name }}"
state: absent
register: result
- name: Check EspHome is stopped
assert:
that:
- not result.changed

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
firefly_enabled: true

View 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:
firefly_enabled: false

View file

@ -0,0 +1,25 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
name: "{{ firefly_container_name }}"
register: result
- name: Get container state
docker_container_info:
name: "{{ firefly_mysql_container_name }}"
register: result_mysql
- name: Check Firefly is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false
- result_mysql.container['State']['Status'] == "running"
- result_mysql.container['State']['Restarting'] == false

View file

@ -0,0 +1,25 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Firefly
docker_container:
name: "{{ firefly_container_name }}"
state: absent
register: result
- name: Try and stop and remove Firefly MySql
docker_container:
name: "{{ firefly_mysql_container_name }}"
state: absent
register: result_mysql
- name: Check Firefly is stopped
assert:
that:
- not result.changed
- not result_mysql.changed