Browse Source

Merge branch 'wip-icinga' into 'master'

icinga: upgrade to 2.12.0

Closes #212

See merge request main/infrastructure!250
keep-around/01d8bfb9652e904f8986fc4aa5c10477a805bd5a
Loïc Dachary 1 year ago
parent
commit
01d8bfb965
  1. 4
      playbooks/icinga/roles/icinga2/tasks/main.yml
  2. 2
      playbooks/icinga/roles/icinga2_client/tasks/main.yml
  3. 5
      playbooks/icinga/tests/test_icingaweb.py
  4. 8
      playbooks/icinga/tests/test_letsencrypt.py

4
playbooks/icinga/roles/icinga2/tasks/main.yml

@ -29,8 +29,8 @@
- name: apt-get install icinga2
apt:
name:
- icinga2=2.11.4-1.buster
- icinga2-ido-mysql=2.11.4-1.buster
- icinga2=2.12.0-1.buster
- icinga2-ido-mysql=2.12.0-1.buster
state: present
- name: apt-get install monitoring plugins

2
playbooks/icinga/roles/icinga2_client/tasks/main.yml

@ -11,7 +11,7 @@
- name: apt-get install icinga2
apt:
name: icinga2=2.11.4-1.buster
name: icinga2=2.12.0-1.buster
state: present
- name: apt-get install monitoring plugins

5
playbooks/icinga/tests/test_icingaweb.py

@ -18,10 +18,9 @@ def test_icingaweb2_login_screen(host, pytestconfig):
address = get_address(pytestconfig.getoption("--ansible-inventory"))
proto_srv = f"https://{address}"
s = requests.Session()
s.verify = 'certs'
r = s.get(proto_srv+'/icingaweb2/authentication/login', timeout=5)
r = s.get(proto_srv+'/icingaweb2/authentication/login', timeout=20, verify='certs')
cookies = dict(r.cookies)
r = s.get(proto_srv+'/icingaweb2/authentication/login?_checkCookie=1',
cookies=cookies, timeout=5)
cookies=cookies, timeout=5, verify='certs')
r.raise_for_status()
assert 'Icinga Web 2 Login' in r.text

8
playbooks/icinga/tests/test_letsencrypt.py

@ -16,16 +16,14 @@ def test_icingaweb2_login_screen(host, pytestconfig):
if get_driver() == 'docker':
pytest.skip("no letsencrypt when running docker")
address = get_address(pytestconfig.getoption("--ansible-inventory"))
print(f'https://{address}/icingaweb2/authentication/login')
s = requests.Session()
r = s.get(f'http://{address}/icingaweb2/authentication/login',
timeout=5, allow_redirects=False)
r.status_code = 302
s.verify = 'certs'
assert r.status_code == 301
r = s.get(f'https://{address}/icingaweb2/authentication/login',
timeout=5)
timeout=5, verify='certs')
cookies = dict(r.cookies)
r = s.get(f'https://{address}/icingaweb2/authentication/login?_checkCookie=1',
cookies=cookies, timeout=5)
cookies=cookies, timeout=5, verify='certs')
r.raise_for_status()
assert 'Icinga Web 2 Login' in r.text

Loading…
Cancel
Save