Browse Source

wereport: delete (it is the same as cloud)

keep-around/dd63815d26ea1666aac6056b83e50a5b3ad0d0f0
Loïc Dachary 1 year ago
committed by Loic Dachary
parent
commit
ab695cb428
Signed by: dachary GPG Key ID: 992D23B392F9E4F2
  1. 1
      enough-playbook.yml
  2. 1
      inventory/02-all.yml
  3. 4
      inventory/host_vars/wereport-host/provision.yml
  4. 1
      molecule/wereport/create.yml
  5. 1
      molecule/wereport/destroy.yml
  6. 43
      molecule/wereport/molecule.yml
  7. 10
      molecule/wereport/playbook.yml
  8. 2
      molecule/wereport/roles/wereport/tasks/main.yml
  9. 1
      molecule/wereport/roles/wereport/tasks/wereport.yml
  10. 14
      molecule/wereport/tests/test_icinga.py
  11. 25
      molecule/wereport/tests/test_nextcloud.py
  12. 8
      molecule/wereport/wereport-playbook.yml

1
enough-playbook.yml

@ -23,7 +23,6 @@
- import_playbook: "{{ '$SHARE_DIR/molecule/enough/enough-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/cloud/cloud-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/jmm/jmm-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/wereport/wereport-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/website/website-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/forum/forum-playbook.yml' | expandvars }}"
- import_playbook: "{{ '$SHARE_DIR/molecule/api/api-playbook.yml' | expandvars }}"

1
inventory/02-all.yml

@ -13,7 +13,6 @@ pets:
enough:
hosts:
cloud-host:
wereport-host:
gitlab:
hosts:

4
inventory/host_vars/wereport-host/provision.yml

@ -1,4 +0,0 @@
---
openstack_volumes:
- name: wereport-volume
size: 10

1
molecule/wereport/create.yml

@ -1 +0,0 @@
../infrastructure/create.yml

1
molecule/wereport/destroy.yml

@ -1 +0,0 @@
../infrastructure/destroy.yml

43
molecule/wereport/molecule.yml

@ -1,43 +0,0 @@
---
driver:
name: delegated
lint:
name: yamllint
platforms:
- name: bind-host
- name: postfix-host
- name: icinga-host
- name: wereport-host
# remove when https://github.com/ansible/molecule/issues/1650 is resolved
groups:
- enough
- firewall_ssh_server_group
- firewall_web_server_group
provisioner:
name: ansible
options:
i: ../../development-inventory
limit: bind-host,postfix-host,icinga-host,wereport-host,localhost
lint:
name: ansible-lint
env:
ANSIBLE_ROLES_PATH: roles:../infrastructure/roles:../firewall/roles:../postfix/roles:../bind/roles:../icinga/roles:../jdauphant.nginx/roles:../enough-nginx/roles:../certificate/roles:../enough/roles
inventory:
links:
group_vars: ../../inventory/group_vars
host_vars: ../../inventory/host_vars
scenario:
name: wereport
test_sequence:
- destroy
- create
- converge
- verify
- destroy
verifier:
name: testinfra
options:
v: True
s: True
lint:
name: flake8

10
molecule/wereport/playbook.yml

@ -1,10 +0,0 @@
---
- import_playbook: ../infrastructure/buster-playbook.yml
- import_playbook: ../firewall/firewall-playbook.yml
- import_playbook: ../icinga/test-icinga-playbook.yml
- import_playbook: ../bind/bind-playbook.yml
- import_playbook: ../bind/bind-client-playbook.yml
- import_playbook: ../icinga/icinga-playbook.yml
- import_playbook: ../postfix/postfix-playbook.yml
- import_playbook: ../enough/enough-playbook.yml
- import_playbook: wereport-playbook.yml

2
molecule/wereport/roles/wereport/tasks/main.yml

@ -1,2 +0,0 @@
---
- import_tasks: wereport.yml

1
molecule/wereport/roles/wereport/tasks/wereport.yml

@ -1 +0,0 @@
---

14
molecule/wereport/tests/test_icinga.py

@ -1,14 +0,0 @@
from tests.icinga_helper import IcingaHelper
testinfra_hosts = ['icinga-host']
class TestChecks(IcingaHelper):
def test_host(self):
r = self.get_client().objects.get('Host', 'wereport-host')
assert r['attrs']['name'] == 'wereport-host'
def test_service(self, host):
assert self.is_service_ok('wereport-host!wereport-host')
assert self.is_service_ok('wereport-host!wereport-host over Tor')

25
molecule/wereport/tests/test_nextcloud.py

@ -1,25 +0,0 @@
testinfra_hosts = ['wereport-host']
def test_nextcloud(host):
cmd = host.run("""
set -xe
d=/dev/sdb
test -e /dev/sdb || d=/dev/vda
mount | grep $d | grep /var/lib/docker
curl --silent https://wereport.$(hostname -d)/login | grep --quiet 'Forgot pass'
""")
print(cmd.stdout)
print(cmd.stderr)
assert 0 == cmd.rc
def test_nextcloud_via_tor(host):
cmd = host.run("""
set -xe
hostname=$(sudo cat /var/lib/tor/services/cloud/hostname)
torsocks curl --silent http://$hostname/login | grep --quiet 'Forgot pass'
""")
print(cmd.stdout)
print(cmd.stderr)
assert 0 == cmd.rc

8
molecule/wereport/wereport-playbook.yml

@ -1,8 +0,0 @@
---
- name: prepare cloud environment
hosts: wereport-host
roles:
- { role: wereport }
become: True
Loading…
Cancel
Save