From 1864112c6ad27e99550c6a974138708047bdcfc7 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sun, 29 May 2016 01:55:13 +0200 Subject: [PATCH 01/36] Add tests for debops.checkmk_server --- ansible-checkmk_server/inventory/hosts | 1 + ansible-checkmk_server/playbooks/test.yml | 14 +++++++++++ ansible-checkmk_server/test | 30 +++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 ansible-checkmk_server/inventory/hosts create mode 100644 ansible-checkmk_server/playbooks/test.yml create mode 100644 ansible-checkmk_server/test diff --git a/ansible-checkmk_server/inventory/hosts b/ansible-checkmk_server/inventory/hosts new file mode 100644 index 0000000..6f3df79 --- /dev/null +++ b/ansible-checkmk_server/inventory/hosts @@ -0,0 +1 @@ +placeholder_fqdn diff --git a/ansible-checkmk_server/playbooks/test.yml b/ansible-checkmk_server/playbooks/test.yml new file mode 100644 index 0000000..3f61523 --- /dev/null +++ b/ansible-checkmk_server/playbooks/test.yml @@ -0,0 +1,14 @@ +--- + +- hosts: 'placeholder_fqdn' + become: True + + roles: + + - role: debops.ferm + tags: [ 'role::ferm' ] + ferm__dependent_rules: '{{ checkmk_server__ferm_dependent_rules }}' + when: checkmk_server__dependencies | bool + + - role: ansible-checkmk_server + tags: [ 'role::checkmk_server' ] diff --git a/ansible-checkmk_server/test b/ansible-checkmk_server/test new file mode 100644 index 0000000..4516c9a --- /dev/null +++ b/ansible-checkmk_server/test @@ -0,0 +1,30 @@ +#!/bin/bash + +# test: Test debops.checkmk_server +# Copyright (C) 2014 Nick Janetakis +# Part of the DebOps project - http://debops.org/ + + +. "${ROLESPEC_LIB}/main" +. "${ROLESPEC_TEST}/../defaults.conf" + + +install_ansible ${test_ansible_version} +ansible_plugins + +ansible-galaxy -f install debops.ferm + +assert_playbook_check_runs +assert_playbook_idempotent + + +assert_path '/omd/sites/debops' +assert_path '/omd/sites/debops/etc/check_mk/conf.d/wato/global.mk' +assert_path '/omd/sites/debops/etc/check_mk/conf.d/wato/rules.mk' + +assert_running 'apache2' +assert_running 'icinga' + +assert_url 'http://localhost/debops/' '(200|302)' + +assert_docs From 7f63450ab8e750e792a9163efa7f62e91352f667 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sun, 29 May 2016 02:23:42 +0200 Subject: [PATCH 02/36] Make test script executable --- ansible-checkmk_server/test | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ansible-checkmk_server/test diff --git a/ansible-checkmk_server/test b/ansible-checkmk_server/test old mode 100644 new mode 100755 From a3926a1b06ddd129e63f42d2bab5f8bf2d1ccec1 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sun, 29 May 2016 13:37:56 +0200 Subject: [PATCH 03/36] Use stable version to avoid Ansible bugs --- ansible-checkmk_server/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-checkmk_server/test b/ansible-checkmk_server/test index 4516c9a..c0c7043 100755 --- a/ansible-checkmk_server/test +++ b/ansible-checkmk_server/test @@ -9,7 +9,7 @@ . "${ROLESPEC_TEST}/../defaults.conf" -install_ansible ${test_ansible_version} +install_ansible stable-2.1 ansible_plugins ansible-galaxy -f install debops.ferm From 964bb16c277173269d78dc1a260bfe571f57bcd0 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sun, 29 May 2016 15:29:17 +0200 Subject: [PATCH 04/36] Switch back to stable-2.0 branch due to 'apt' module bug See ansible/ansible-modules-core#3752 --- ansible-checkmk_server/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-checkmk_server/test b/ansible-checkmk_server/test index c0c7043..b39c0c7 100755 --- a/ansible-checkmk_server/test +++ b/ansible-checkmk_server/test @@ -9,7 +9,7 @@ . "${ROLESPEC_TEST}/../defaults.conf" -install_ansible stable-2.1 +install_ansible stable-2.0 ansible_plugins ansible-galaxy -f install debops.ferm From 96ac31d20d4b81c8e22935482f5708808cac9e0a Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sun, 29 May 2016 22:37:41 +0200 Subject: [PATCH 05/36] Add tests for debops.checkmk_agent --- ansible-checkmk_agent/inventory/hosts | 1 + ansible-checkmk_agent/playbooks/test.yml | 22 +++++++++++++++++++ ansible-checkmk_agent/test | 27 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 ansible-checkmk_agent/inventory/hosts create mode 100644 ansible-checkmk_agent/playbooks/test.yml create mode 100755 ansible-checkmk_agent/test diff --git a/ansible-checkmk_agent/inventory/hosts b/ansible-checkmk_agent/inventory/hosts new file mode 100644 index 0000000..6f3df79 --- /dev/null +++ b/ansible-checkmk_agent/inventory/hosts @@ -0,0 +1 @@ +placeholder_fqdn diff --git a/ansible-checkmk_agent/playbooks/test.yml b/ansible-checkmk_agent/playbooks/test.yml new file mode 100644 index 0000000..acbafc9 --- /dev/null +++ b/ansible-checkmk_agent/playbooks/test.yml @@ -0,0 +1,22 @@ +--- + +- hosts: 'placeholder_fqdn' + become: True + + roles: + + - role: debops.etc_services + tags: [ 'role::etc_services' ] + etc_services__dependent_list: + - name: 'check-mk-agent' + port: '{{ checkmk_agent_port }}' + comment: 'Check_MK agent (via xinetd)' + when: (checkmk_agent|d() and 'xinetd' in checkmk_agent) + + - role: debops.ferm + tags: [ 'role::ferm' ] + ferm__dependent_rules: '{{ checkmk_agent_ferm_dependent_rules }}' + when: (checkmk_agent|d() and 'xinetd' in checkmk_agent) + + - role: ansible-checkmk_agent + tags: [ 'role::checkmk_agent' ] diff --git a/ansible-checkmk_agent/test b/ansible-checkmk_agent/test new file mode 100755 index 0000000..2644969 --- /dev/null +++ b/ansible-checkmk_agent/test @@ -0,0 +1,27 @@ +#!/bin/bash + +# test: Test debops.checkmk_server +# Copyright (C) 2014 Nick Janetakis +# Part of the DebOps project - http://debops.org/ + + +. "${ROLESPEC_LIB}/main" +. "${ROLESPEC_TEST}/../defaults.conf" + + +install_ansible ${test_ansible_version} +ansible_plugins + +ansible-galaxy -f install debops.etc_services +ansible-galaxy -f install debops.ferm + +assert_playbook_check_runs +assert_playbook_idempotent + + +assert_path '/etc/check_mk' +assert_path '/usr/bin/check_mk_agent' + +assert_running 'xinetd' + +assert_docs From 46fe6efa58e1ff504db308393d1b70d3f5cd5628 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Mon, 30 May 2016 07:36:00 +0200 Subject: [PATCH 06/36] Adjust variable namespacing to role changes --- ansible-checkmk_agent/playbooks/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible-checkmk_agent/playbooks/test.yml b/ansible-checkmk_agent/playbooks/test.yml index acbafc9..e3a11c9 100644 --- a/ansible-checkmk_agent/playbooks/test.yml +++ b/ansible-checkmk_agent/playbooks/test.yml @@ -9,13 +9,13 @@ tags: [ 'role::etc_services' ] etc_services__dependent_list: - name: 'check-mk-agent' - port: '{{ checkmk_agent_port }}' + port: '{{ checkmk_agent__port }}' comment: 'Check_MK agent (via xinetd)' when: (checkmk_agent|d() and 'xinetd' in checkmk_agent) - role: debops.ferm tags: [ 'role::ferm' ] - ferm__dependent_rules: '{{ checkmk_agent_ferm_dependent_rules }}' + ferm__dependent_rules: '{{ checkmk_agent__ferm_dependent_rules }}' when: (checkmk_agent|d() and 'xinetd' in checkmk_agent) - role: ansible-checkmk_agent From feff28e57128474554cde0c1d58c04b0bdcdb065 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Mon, 30 May 2016 23:32:49 +0200 Subject: [PATCH 07/36] Add tests for debops.ansible-roundcube --- .../inventory/group_vars/all/common | 1 + .../group_vars/all/roundcube/roundcube.yml | 4 +++ ansible-roundcube/inventory/hosts | 1 + ansible-roundcube/playbooks/test.yml | 23 +++++++++++++ ansible-roundcube/test | 32 +++++++++++++++++++ 5 files changed, 61 insertions(+) create mode 120000 ansible-roundcube/inventory/group_vars/all/common create mode 100644 ansible-roundcube/inventory/group_vars/all/roundcube/roundcube.yml create mode 100644 ansible-roundcube/inventory/hosts create mode 100644 ansible-roundcube/playbooks/test.yml create mode 100755 ansible-roundcube/test diff --git a/ansible-roundcube/inventory/group_vars/all/common b/ansible-roundcube/inventory/group_vars/all/common new file mode 120000 index 0000000..b22758b --- /dev/null +++ b/ansible-roundcube/inventory/group_vars/all/common @@ -0,0 +1 @@ +../../../../common-ansible-inventory/group_vars/all/common \ No newline at end of file diff --git a/ansible-roundcube/inventory/group_vars/all/roundcube/roundcube.yml b/ansible-roundcube/inventory/group_vars/all/roundcube/roundcube.yml new file mode 100644 index 0000000..77f77c3 --- /dev/null +++ b/ansible-roundcube/inventory/group_vars/all/roundcube/roundcube.yml @@ -0,0 +1,4 @@ +--- + +roundcube_domain: [ 'localhost.localdomain' ] + diff --git a/ansible-roundcube/inventory/hosts b/ansible-roundcube/inventory/hosts new file mode 100644 index 0000000..6f3df79 --- /dev/null +++ b/ansible-roundcube/inventory/hosts @@ -0,0 +1 @@ +placeholder_fqdn diff --git a/ansible-roundcube/playbooks/test.yml b/ansible-roundcube/playbooks/test.yml new file mode 100644 index 0000000..2968ce3 --- /dev/null +++ b/ansible-roundcube/playbooks/test.yml @@ -0,0 +1,23 @@ +--- + +- hosts: 'placeholder_fqdn' + become: True + + roles: + + - role: debops.php5 + php5_packages: + - '{{ roundcube_php5_packages }}' + php5_pools: + - '{{ roundcube_php5_pool }}' + when: roundcube_dependencies|d() + + - role: debops.nginx + nginx_servers: + - '{{ roundcube_nginx_server }}' + nginx_upstreams: + - '{{ roundcube_nginx_upstream_php5 }}' + when: roundcube_dependencies|d() + + - role: 'ansible-roundcube' + diff --git a/ansible-roundcube/test b/ansible-roundcube/test new file mode 100755 index 0000000..4503d68 --- /dev/null +++ b/ansible-roundcube/test @@ -0,0 +1,32 @@ +#!/bin/bash + +# test: Test debops.owncloud +# Copyright (C) 2014 Nick Janetakis +# Part of the DebOps project - http://debops.org/ + + +. "${ROLESPEC_LIB}/main" +. "${ROLESPEC_TEST}/../defaults.conf" + + +install_ansible ${test_ansible_version} +ansible_plugins + + +ansible-galaxy -f install debops.php5 +ansible-galaxy -f install debops.nginx + + +# Use Trusty packages for more recent PHP5 support +echo "deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/trusty.list +sudo apt-get -qq update + + +assert_playbook_check_runs +assert_playbook_idempotent + + +assert_path "/var/www/roundcube" + +assert_docs + From f73a90672ee2d85511b32b4fd54e36c5a0b0ef7d Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Thu, 9 Jun 2016 19:34:18 +0200 Subject: [PATCH 08/36] Fix path test --- ansible-roundcube/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-roundcube/test b/ansible-roundcube/test index 4503d68..a04f5f1 100755 --- a/ansible-roundcube/test +++ b/ansible-roundcube/test @@ -26,7 +26,7 @@ assert_playbook_check_runs assert_playbook_idempotent -assert_path "/var/www/roundcube" +assert_path "/srv/www/roundcube" assert_docs From 64804f96c12599cdfeeee4e4627fee4b6cfa7706 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Thu, 9 Jun 2016 22:33:25 +0200 Subject: [PATCH 09/36] Install debops.mariadb role --- ansible-roundcube/test | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible-roundcube/test b/ansible-roundcube/test index a04f5f1..f38cd3f 100755 --- a/ansible-roundcube/test +++ b/ansible-roundcube/test @@ -15,6 +15,7 @@ ansible_plugins ansible-galaxy -f install debops.php5 ansible-galaxy -f install debops.nginx +ansible-galaxy -f install debops.mariadb # Use Trusty packages for more recent PHP5 support From 9c3c981e2cec69f147a7cf612efdf5687c958859 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Tue, 14 Jun 2016 22:26:07 +0200 Subject: [PATCH 10/36] Adjust variable names according to namespace change --- ansible-roundcube/playbooks/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible-roundcube/playbooks/test.yml b/ansible-roundcube/playbooks/test.yml index 2968ce3..64ea7cc 100644 --- a/ansible-roundcube/playbooks/test.yml +++ b/ansible-roundcube/playbooks/test.yml @@ -7,16 +7,16 @@ - role: debops.php5 php5_packages: - - '{{ roundcube_php5_packages }}' + - '{{ roundcube__php5_packages }}' php5_pools: - - '{{ roundcube_php5_pool }}' + - '{{ roundcube__php5_pool }}' when: roundcube_dependencies|d() - role: debops.nginx nginx_servers: - - '{{ roundcube_nginx_server }}' + - '{{ roundcube__nginx_server }}' nginx_upstreams: - - '{{ roundcube_nginx_upstream_php5 }}' + - '{{ roundcube__nginx_upstream_php5 }}' when: roundcube_dependencies|d() - role: 'ansible-roundcube' From e4027c945bc7db5694fc537bcd79881b680bdd41 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Fri, 24 Jun 2016 23:57:08 +0200 Subject: [PATCH 11/36] Adjust playbook according to debops-contrib/checkmk_server#14 --- ansible-checkmk_server/playbooks/test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ansible-checkmk_server/playbooks/test.yml b/ansible-checkmk_server/playbooks/test.yml index 3f61523..9296854 100644 --- a/ansible-checkmk_server/playbooks/test.yml +++ b/ansible-checkmk_server/playbooks/test.yml @@ -6,9 +6,7 @@ roles: - role: debops.ferm - tags: [ 'role::ferm' ] - ferm__dependent_rules: '{{ checkmk_server__ferm_dependent_rules }}' - when: checkmk_server__dependencies | bool + ferm__dependent_rules: + - '{{ checkmk_server__ferm_dependent_rules }}' - role: ansible-checkmk_server - tags: [ 'role::checkmk_server' ] From a3377e80ff571195d34e174f720db92c58f8a427 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 25 Jun 2016 23:19:03 +0200 Subject: [PATCH 12/36] Use new variables for dependant role configuration --- ansible-checkmk_agent/playbooks/test.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/ansible-checkmk_agent/playbooks/test.yml b/ansible-checkmk_agent/playbooks/test.yml index e3a11c9..4e58f28 100644 --- a/ansible-checkmk_agent/playbooks/test.yml +++ b/ansible-checkmk_agent/playbooks/test.yml @@ -4,19 +4,24 @@ become: True roles: - - role: debops.etc_services - tags: [ 'role::etc_services' ] etc_services__dependent_list: - - name: 'check-mk-agent' - port: '{{ checkmk_agent__port }}' - comment: 'Check_MK agent (via xinetd)' + - '{{ checkmk_agent__etc_services__dependent_list }}' when: (checkmk_agent|d() and 'xinetd' in checkmk_agent) - role: debops.ferm - tags: [ 'role::ferm' ] - ferm__dependent_rules: '{{ checkmk_agent__ferm_dependent_rules }}' + ferm__dependent_rules: + - '{{ checkmk_agent__ferm__dependent_rules }}' when: (checkmk_agent|d() and 'xinetd' in checkmk_agent) - - role: ansible-checkmk_agent + - role: debops.mariadb + mariadb__users: + - '{{ checkmk_agent__mariadb__users }}' + when: (("mk_mysql" in checkmk_agent__plugin_list and + checkmk_agent__plugin_mysql|d("automatic") == "automatic") or + ((checkmk_agent__plugin_autodetect|d(True) | bool) and + "debops_mariadb_server" in hostvars[inventory_hostname]["group_names"]) + ) + + - role: debops-contrib.checkmk_agent tags: [ 'role::checkmk_agent' ] From 4b3d89c7bd7f9e6123ee8f5ea5b4ee7aa0d13707 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 25 Jun 2016 23:26:51 +0200 Subject: [PATCH 13/36] Install debops.mariadb role for checkmk_agent test --- ansible-checkmk_agent/test | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible-checkmk_agent/test b/ansible-checkmk_agent/test index 2644969..9de3c81 100755 --- a/ansible-checkmk_agent/test +++ b/ansible-checkmk_agent/test @@ -14,6 +14,7 @@ ansible_plugins ansible-galaxy -f install debops.etc_services ansible-galaxy -f install debops.ferm +ansible-galaxy -f install debops.mariadb assert_playbook_check_runs assert_playbook_idempotent From 18bbc435f7277c8c7459f53c8f73a5b3498247fa Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 25 Jun 2016 23:45:16 +0200 Subject: [PATCH 14/36] Fix reference to ansible-checkmk_agent role --- ansible-checkmk_agent/playbooks/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ansible-checkmk_agent/playbooks/test.yml b/ansible-checkmk_agent/playbooks/test.yml index 4e58f28..adc7ae9 100644 --- a/ansible-checkmk_agent/playbooks/test.yml +++ b/ansible-checkmk_agent/playbooks/test.yml @@ -23,5 +23,4 @@ "debops_mariadb_server" in hostvars[inventory_hostname]["group_names"]) ) - - role: debops-contrib.checkmk_agent - tags: [ 'role::checkmk_agent' ] + - role: ansible-checkmk_agent From 8c14fe34b440ebfec3f9fe2a57f4a73a18834ae3 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 30 Jul 2016 17:30:02 +0200 Subject: [PATCH 15/36] Adjust test to latest playbook and role changes See debops-contrib/ansible-checkmk_agent#20 --- ansible-checkmk_agent/playbooks/test.yml | 13 +++++++++++-- ansible-checkmk_agent/test | 6 +++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ansible-checkmk_agent/playbooks/test.yml b/ansible-checkmk_agent/playbooks/test.yml index adc7ae9..c8b04be 100644 --- a/ansible-checkmk_agent/playbooks/test.yml +++ b/ansible-checkmk_agent/playbooks/test.yml @@ -4,15 +4,24 @@ become: True roles: + - role: debops.apt_preferences + apt_preferences__dependent_list: + - '{{ checkmk_agent__apt_preferences__dependent_list }}' + - role: debops.etc_services etc_services__dependent_list: - '{{ checkmk_agent__etc_services__dependent_list }}' - when: (checkmk_agent|d() and 'xinetd' in checkmk_agent) + when: ('xinetd' in checkmk_agent__type|d(['ssh'])) - role: debops.ferm ferm__dependent_rules: - '{{ checkmk_agent__ferm__dependent_rules }}' - when: (checkmk_agent|d() and 'xinetd' in checkmk_agent) + when: ('xinetd' in checkmk_agent__type|d(['ssh'])) + + - role: debops.authorized_keys + authorized_keys__dependent_list: + - '{{ checkmk_agent__authorized_keys__dependent_list }}' + when: ('ssh' in checkmk_agent__type|d(['ssh'])) - role: debops.mariadb mariadb__users: diff --git a/ansible-checkmk_agent/test b/ansible-checkmk_agent/test index 9de3c81..cbb8cc8 100755 --- a/ansible-checkmk_agent/test +++ b/ansible-checkmk_agent/test @@ -12,6 +12,8 @@ install_ansible ${test_ansible_version} ansible_plugins +ansible-galaxy -f install debops.apt_preferences +ansible-galaxy -f install debops.authorized_keys ansible-galaxy -f install debops.etc_services ansible-galaxy -f install debops.ferm ansible-galaxy -f install debops.mariadb @@ -23,6 +25,8 @@ assert_playbook_idempotent assert_path '/etc/check_mk' assert_path '/usr/bin/check_mk_agent' -assert_running 'xinetd' +assert_group 'checkmk' +assert_exit_code 'getent passwd checkmk' 0 + assert_docs From 5bedc26e698b50bc05e3a7f3866961ba5cc79fbc Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 30 Jul 2016 17:57:30 +0200 Subject: [PATCH 16/36] Define dummy ssh public key, assert authorized_keys and sudoers --- .../inventory/groups_vars/all/checkmk_agent.yml | 2 ++ ansible-checkmk_agent/test | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 ansible-checkmk_agent/inventory/groups_vars/all/checkmk_agent.yml diff --git a/ansible-checkmk_agent/inventory/groups_vars/all/checkmk_agent.yml b/ansible-checkmk_agent/inventory/groups_vars/all/checkmk_agent.yml new file mode 100644 index 0000000..234a6fe --- /dev/null +++ b/ansible-checkmk_agent/inventory/groups_vars/all/checkmk_agent.yml @@ -0,0 +1,2 @@ +# define dummy ssh public key +checkmk_agent__user_key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDnHO+mKFHa6NvszevpqrWpX75M/Hux9lFl41B0VEd4btweMccpE2NzJDJy7zXPtSaDmWWIRriF56Gxw9ovOZN0NG7DSUQ0P+7+Rd0Oom8HAKX5tlBAkKEhKA2smcp0tUyZKt+BNGqTcM5NNp5Wycct6+QYMOw0E7apqrKxHpFhv5z8uK7jgGu396cbGfUSwXeja96f7kjqvH+CSktCakqhpC8gTNhcZjtPW4OnB7yLmBsvk00eIAQfmRJGo/OcEWeL7k0VYva9MVPD7aeyNENDnlJWA4qmcTBn39sQYdC1wiCipXGjd45+nYxJuV/+5b1HHicm3LG9Tg28Bew7EM8b travis' diff --git a/ansible-checkmk_agent/test b/ansible-checkmk_agent/test index cbb8cc8..804994d 100755 --- a/ansible-checkmk_agent/test +++ b/ansible-checkmk_agent/test @@ -28,5 +28,8 @@ assert_path '/usr/bin/check_mk_agent' assert_group 'checkmk' assert_exit_code 'getent passwd checkmk' 0 +assert_path '/etc/ssh/authorized_keys/checkmk' +assert_path '/etc/sudoers.d/checkmk' + assert_docs From f3144dc5f55334fc101bc2326995f67488d71776 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 30 Jul 2016 18:04:35 +0200 Subject: [PATCH 17/36] Fix typo in path name --- .../inventory/{groups_vars => group_vars}/all/checkmk_agent.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ansible-checkmk_agent/inventory/{groups_vars => group_vars}/all/checkmk_agent.yml (100%) diff --git a/ansible-checkmk_agent/inventory/groups_vars/all/checkmk_agent.yml b/ansible-checkmk_agent/inventory/group_vars/all/checkmk_agent.yml similarity index 100% rename from ansible-checkmk_agent/inventory/groups_vars/all/checkmk_agent.yml rename to ansible-checkmk_agent/inventory/group_vars/all/checkmk_agent.yml From 6b018ed08fb689e94112f9592871cf9ec320368b Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 30 Jul 2016 18:16:30 +0200 Subject: [PATCH 18/36] Fix path of sudoers file --- ansible-checkmk_agent/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-checkmk_agent/test b/ansible-checkmk_agent/test index 804994d..69a8806 100755 --- a/ansible-checkmk_agent/test +++ b/ansible-checkmk_agent/test @@ -29,7 +29,7 @@ assert_group 'checkmk' assert_exit_code 'getent passwd checkmk' 0 assert_path '/etc/ssh/authorized_keys/checkmk' -assert_path '/etc/sudoers.d/checkmk' +assert_path '/etc/sudoers.d/check-mk-agent' assert_docs From 8653a06cee1b4acbf59b4fae50df557ca134e8bb Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 3 Aug 2016 18:33:26 +0200 Subject: [PATCH 19/36] Adjust playbook to f4a7f63 --- ansible-roundcube/playbooks/test.yml | 6 ++++-- ansible-roundcube/test | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ansible-roundcube/playbooks/test.yml b/ansible-roundcube/playbooks/test.yml index 64ea7cc..1695932 100644 --- a/ansible-roundcube/playbooks/test.yml +++ b/ansible-roundcube/playbooks/test.yml @@ -3,6 +3,10 @@ - hosts: 'placeholder_fqdn' become: True + environment: '{{ inventory__environment | d({}) + | combine(inventory__group_environment | d({})) + | combine(inventory__host_environment | d({})) }}' + roles: - role: debops.php5 @@ -10,14 +14,12 @@ - '{{ roundcube__php5_packages }}' php5_pools: - '{{ roundcube__php5_pool }}' - when: roundcube_dependencies|d() - role: debops.nginx nginx_servers: - '{{ roundcube__nginx_server }}' nginx_upstreams: - '{{ roundcube__nginx_upstream_php5 }}' - when: roundcube_dependencies|d() - role: 'ansible-roundcube' diff --git a/ansible-roundcube/test b/ansible-roundcube/test index f38cd3f..a04f5f1 100755 --- a/ansible-roundcube/test +++ b/ansible-roundcube/test @@ -15,7 +15,6 @@ ansible_plugins ansible-galaxy -f install debops.php5 ansible-galaxy -f install debops.nginx -ansible-galaxy -f install debops.mariadb # Use Trusty packages for more recent PHP5 support From 8ace871b87900b1bb3098514d365771a06ebd815 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 21 Sep 2016 00:23:14 +0200 Subject: [PATCH 20/36] Add tests for ansible-gdnsd --- ansible-gdnsd/inventory/hosts | 1 + ansible-gdnsd/playbooks/test.yml | 7 +++++++ ansible-gdnsd/test | 17 +++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 ansible-gdnsd/inventory/hosts create mode 100644 ansible-gdnsd/playbooks/test.yml create mode 100755 ansible-gdnsd/test diff --git a/ansible-gdnsd/inventory/hosts b/ansible-gdnsd/inventory/hosts new file mode 100644 index 0000000..6f3df79 --- /dev/null +++ b/ansible-gdnsd/inventory/hosts @@ -0,0 +1 @@ +placeholder_fqdn diff --git a/ansible-gdnsd/playbooks/test.yml b/ansible-gdnsd/playbooks/test.yml new file mode 100644 index 0000000..685a354 --- /dev/null +++ b/ansible-gdnsd/playbooks/test.yml @@ -0,0 +1,7 @@ +--- + +- hosts: 'placeholder_fqdn' + become: True + + roles: + - role: 'ansible-gdnsd' diff --git a/ansible-gdnsd/test b/ansible-gdnsd/test new file mode 100755 index 0000000..e42b9c3 --- /dev/null +++ b/ansible-gdnsd/test @@ -0,0 +1,17 @@ +#!/bin/bash + +# test: Test debops.apt +# Copyright (C) 2014 Nick Janetakis +# Part of the DebOps project - http://debops.org/ + + +. "${ROLESPEC_LIB}/main" +. "${ROLESPEC_TEST}/../defaults.conf" + + +install_ansible ${test_ansible_version} +ansible_plugins + +assert_playbook_check_runs +assert_playbook_idempotent +assert_docs From df213f945a3c5fcd031c4791aeef586ffe2cc206 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 21 Sep 2016 01:10:38 +0200 Subject: [PATCH 21/36] Avoid startup error when trying to bind to all addresses --- ansible-gdnsd/inventory/group_vars/all/gdnsd.yml | 4 ++++ ansible-gdnsd/test | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 ansible-gdnsd/inventory/group_vars/all/gdnsd.yml diff --git a/ansible-gdnsd/inventory/group_vars/all/gdnsd.yml b/ansible-gdnsd/inventory/group_vars/all/gdnsd.yml new file mode 100644 index 0000000..1b1255c --- /dev/null +++ b/ansible-gdnsd/inventory/group_vars/all/gdnsd.yml @@ -0,0 +1,4 @@ +--- + +# Startup fails if service is bound to all available addresses in Travis-CI +gdnsd__listen: [ '{{ ansible_default_ipv4.address }}' ] diff --git a/ansible-gdnsd/test b/ansible-gdnsd/test index e42b9c3..ae00770 100755 --- a/ansible-gdnsd/test +++ b/ansible-gdnsd/test @@ -8,6 +8,13 @@ . "${ROLESPEC_LIB}/main" . "${ROLESPEC_TEST}/../defaults.conf" +# Prevent auto-start of unconfigured service +cat <&2 +exit 101 +EOF +sudo chmod +x /usr/sbin/policy-rc.d install_ansible ${test_ansible_version} ansible_plugins From 73ca38365f82af3b55f7100db5400918f1a3de23 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 21 Sep 2016 02:14:51 +0200 Subject: [PATCH 22/36] Add various assert checks for gdnsd service --- ansible-gdnsd/test | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansible-gdnsd/test b/ansible-gdnsd/test index ae00770..88043d0 100755 --- a/ansible-gdnsd/test +++ b/ansible-gdnsd/test @@ -21,4 +21,13 @@ ansible_plugins assert_playbook_check_runs assert_playbook_idempotent + +assert_path /etc/gdnsd/config +assert_running gdnsd +assert_in "$(dig @${HOSTNAME} localdomain SOA)" "ANSWER SECTION" +assert_in "$(dig @${HOSTNAME} localdomain NS)" "ANSWER SECTION" +assert_in "$(dig @${HOSTNAME} ${HOSTNAME}.localdomain)" "ANSWER SECTION" +addr="$(dig @{HOSTNAME} +short ${HOSTNAME}.localdomain)" +assert_in "$(dig @${HOSTNAME} -x ${addr})" "ANSWER SECTION" + assert_docs From bae4f8aa31d3d29f423ed152b1e4b56adf02de3b Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 21 Sep 2016 02:21:44 +0200 Subject: [PATCH 23/36] Also bind to localhost for easier query test --- ansible-gdnsd/inventory/group_vars/all/gdnsd.yml | 2 +- ansible-gdnsd/test | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible-gdnsd/inventory/group_vars/all/gdnsd.yml b/ansible-gdnsd/inventory/group_vars/all/gdnsd.yml index 1b1255c..691ad78 100644 --- a/ansible-gdnsd/inventory/group_vars/all/gdnsd.yml +++ b/ansible-gdnsd/inventory/group_vars/all/gdnsd.yml @@ -1,4 +1,4 @@ --- # Startup fails if service is bound to all available addresses in Travis-CI -gdnsd__listen: [ '{{ ansible_default_ipv4.address }}' ] +gdnsd__listen: [ '{{ ansible_default_ipv4.address }}', '127.0.0.1' ] diff --git a/ansible-gdnsd/test b/ansible-gdnsd/test index 88043d0..32b8a48 100755 --- a/ansible-gdnsd/test +++ b/ansible-gdnsd/test @@ -24,10 +24,10 @@ assert_playbook_idempotent assert_path /etc/gdnsd/config assert_running gdnsd -assert_in "$(dig @${HOSTNAME} localdomain SOA)" "ANSWER SECTION" -assert_in "$(dig @${HOSTNAME} localdomain NS)" "ANSWER SECTION" -assert_in "$(dig @${HOSTNAME} ${HOSTNAME}.localdomain)" "ANSWER SECTION" -addr="$(dig @{HOSTNAME} +short ${HOSTNAME}.localdomain)" -assert_in "$(dig @${HOSTNAME} -x ${addr})" "ANSWER SECTION" +assert_in "$(dig @127.0.0.1 localdomain SOA)" "ANSWER SECTION" +assert_in "$(dig @127.0.0.1 localdomain NS)" "ANSWER SECTION" +assert_in "$(dig @127.0.0.1 ${HOSTNAME}.localdomain)" "ANSWER SECTION" +addr="$(dig @127.0.0.1 +short ${HOSTNAME}.localdomain)" +assert_in "$(dig @127.0.0.1 -x ${addr})" "ANSWER SECTION" assert_docs From 15cd5b352b7d5bee5acd6af049edcb3d707b6b06 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 21 Sep 2016 02:32:35 +0200 Subject: [PATCH 24/36] Make assert checks more informative --- ansible-gdnsd/test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible-gdnsd/test b/ansible-gdnsd/test index 32b8a48..7e23039 100755 --- a/ansible-gdnsd/test +++ b/ansible-gdnsd/test @@ -24,10 +24,10 @@ assert_playbook_idempotent assert_path /etc/gdnsd/config assert_running gdnsd -assert_in "$(dig @127.0.0.1 localdomain SOA)" "ANSWER SECTION" -assert_in "$(dig @127.0.0.1 localdomain NS)" "ANSWER SECTION" -assert_in "$(dig @127.0.0.1 ${HOSTNAME}.localdomain)" "ANSWER SECTION" +assert_in "$(dig @127.0.0.1 localdomain SOA)" "${HOSTNAME}.localdomain." +assert_in "$(dig @127.0.0.1 localdomain NS)" "${HOSTNAME}.localdomain." +assert_in "$(dig @127.0.0.1 ${HOSTNAME}.localdomain)" "86400" addr="$(dig @127.0.0.1 +short ${HOSTNAME}.localdomain)" -assert_in "$(dig @127.0.0.1 -x ${addr})" "ANSWER SECTION" +assert_in "$(dig @127.0.0.1 -x ${addr})" "${HOSTNAME}.localdomain." assert_docs From 70270051487c2636efe793a812df210c714b99e0 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Mon, 17 Oct 2016 08:46:49 +0200 Subject: [PATCH 25/36] Add 'debops-contrib.kibana' test --- ansible-kibana/inventory/hosts | 2 ++ ansible-kibana/playbooks/test.yml | 14 ++++++++++++++ ansible-kibana/test | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 ansible-kibana/inventory/hosts create mode 100644 ansible-kibana/playbooks/test.yml create mode 100755 ansible-kibana/test diff --git a/ansible-kibana/inventory/hosts b/ansible-kibana/inventory/hosts new file mode 100644 index 0000000..a7bf9b7 --- /dev/null +++ b/ansible-kibana/inventory/hosts @@ -0,0 +1,2 @@ +[debops_service_kibana] +placeholder_fqdn diff --git a/ansible-kibana/playbooks/test.yml b/ansible-kibana/playbooks/test.yml new file mode 100644 index 0000000..903890f --- /dev/null +++ b/ansible-kibana/playbooks/test.yml @@ -0,0 +1,14 @@ +--- + +- name: Manage Kibana analytics and visualization platform + hosts: [ 'debops_service_kibana' ] + become: True + + environment: '{{ inventory__environment | d({}) + | combine(inventory__group_environment | d({})) + | combine(inventory__host_environment | d({})) }}' + + roles: + + - role: ansible-kibana + tags: [ 'role::kibana' ] diff --git a/ansible-kibana/test b/ansible-kibana/test new file mode 100755 index 0000000..963cdaf --- /dev/null +++ b/ansible-kibana/test @@ -0,0 +1,23 @@ +#!/bin/bash + +# test: Test debops.kibana +# Copyright (C) 2014 Nick Janetakis +# Part of the DebOps project - http://debops.org/ + + +. "${ROLESPEC_LIB}/main" +. "${ROLESPEC_TEST}/../defaults.conf" + + +install_ansible ${test_ansible_version} +ansible_plugins + + +assert_playbook_check_runs +assert_playbook_idempotent + + +assert_path "/opt/kibana/config/kibana.yml" +assert_tcp localhost 5601 + +assert_docs From 9c83cec2e988ee09b675a23b599027237a064c5e Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Tue, 18 Oct 2016 06:43:21 +0200 Subject: [PATCH 26/36] Add ferm dependencies and iptables assert --- ansible-kibana/playbooks/test.yml | 5 ++++- ansible-kibana/test | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ansible-kibana/playbooks/test.yml b/ansible-kibana/playbooks/test.yml index 903890f..db78f79 100644 --- a/ansible-kibana/playbooks/test.yml +++ b/ansible-kibana/playbooks/test.yml @@ -10,5 +10,8 @@ roles: + - role: debops.ferm + ferm__dependent_rules: + - '{{ kibana__ferm__dependent_rules }}' + - role: ansible-kibana - tags: [ 'role::kibana' ] diff --git a/ansible-kibana/test b/ansible-kibana/test index 963cdaf..2f9b1b3 100755 --- a/ansible-kibana/test +++ b/ansible-kibana/test @@ -12,11 +12,13 @@ install_ansible ${test_ansible_version} ansible_plugins +ansible-galaxy -f install debops.ferm + assert_playbook_check_runs assert_playbook_idempotent - +assert_iptables_allow 5601 assert_path "/opt/kibana/config/kibana.yml" assert_tcp localhost 5601 From c83f8f4e8555f4b3da8694e85662aedb9009a4fe Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Thu, 20 Oct 2016 18:59:29 +0200 Subject: [PATCH 27/36] Add 'debops-contrib.elasticbeats' test --- ansible-elasticbeats/inventory/hosts | 2 ++ ansible-elasticbeats/playbooks/test.yml | 12 +++++++++++ ansible-elasticbeats/test | 28 +++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 ansible-elasticbeats/inventory/hosts create mode 100644 ansible-elasticbeats/playbooks/test.yml create mode 100755 ansible-elasticbeats/test diff --git a/ansible-elasticbeats/inventory/hosts b/ansible-elasticbeats/inventory/hosts new file mode 100644 index 0000000..7b1c5a1 --- /dev/null +++ b/ansible-elasticbeats/inventory/hosts @@ -0,0 +1,2 @@ +[debops_service_elasticbeats] +placeholder_fqdn diff --git a/ansible-elasticbeats/playbooks/test.yml b/ansible-elasticbeats/playbooks/test.yml new file mode 100644 index 0000000..fd141d6 --- /dev/null +++ b/ansible-elasticbeats/playbooks/test.yml @@ -0,0 +1,12 @@ +--- + +- name: Manage Elastic Beats data shippers + hosts: [ 'debops_service_elasticbeats' ] + become: True + + environment: '{{ inventory__environment | d({}) + | combine(inventory__group_environment | d({})) + | combine(inventory__host_environment | d({})) }}' + + roles: + - role: ansible-elasticbeats diff --git a/ansible-elasticbeats/test b/ansible-elasticbeats/test new file mode 100755 index 0000000..5375733 --- /dev/null +++ b/ansible-elasticbeats/test @@ -0,0 +1,28 @@ +#!/bin/bash + +# test: Test debops.elasticbeats +# Copyright (C) 2014 Nick Janetakis +# Part of the DebOps project - http://debops.org/ + + +. "${ROLESPEC_LIB}/main" +. "${ROLESPEC_TEST}/../defaults.conf" + + +install_ansible ${test_ansible_version} +ansible_plugins + + +assert_playbook_check_runs +assert_playbook_idempotent + + +assert_path "/etc/filebeat/filebeat.yml" +assert_running /usr/bin/filebeat +assert_path "/etc/topbeat/topbeat.yml" +assert_running /usr/bin/topbeat +assert_path "/etc/packetbeat/packetbeat.yml" +assert_running /usr/bin/packetbeat + + +assert_docs From 1f9047529f263e4aef285540b09ee3af5759b608 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Thu, 20 Oct 2016 19:06:57 +0200 Subject: [PATCH 28/36] Don't check process names with full path --- ansible-elasticbeats/test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible-elasticbeats/test b/ansible-elasticbeats/test index 5375733..546c20c 100755 --- a/ansible-elasticbeats/test +++ b/ansible-elasticbeats/test @@ -18,11 +18,11 @@ assert_playbook_idempotent assert_path "/etc/filebeat/filebeat.yml" -assert_running /usr/bin/filebeat +assert_running filebeat assert_path "/etc/topbeat/topbeat.yml" -assert_running /usr/bin/topbeat +assert_running topbeat assert_path "/etc/packetbeat/packetbeat.yml" -assert_running /usr/bin/packetbeat +assert_running packetbeat assert_docs From 47d1e89887de2b08803f934da957d50adbe729ae Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Tue, 25 Oct 2016 19:17:48 +0200 Subject: [PATCH 29/36] Test TemplateNotFound error with Ansible 2.1 --- ansible-elasticbeats/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-elasticbeats/test b/ansible-elasticbeats/test index 546c20c..cc771b4 100755 --- a/ansible-elasticbeats/test +++ b/ansible-elasticbeats/test @@ -9,7 +9,7 @@ . "${ROLESPEC_TEST}/../defaults.conf" -install_ansible ${test_ansible_version} +install_ansible stable-2.1 ansible_plugins From e40964029e9f5ab5ab46b7194bb1e0d41a61ef88 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 26 Oct 2016 09:33:28 +0200 Subject: [PATCH 30/36] Use default Ansible version from upstream tests (currently 2.2) --- ansible-checkmk_server/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-checkmk_server/test b/ansible-checkmk_server/test index b39c0c7..4516c9a 100755 --- a/ansible-checkmk_server/test +++ b/ansible-checkmk_server/test @@ -9,7 +9,7 @@ . "${ROLESPEC_TEST}/../defaults.conf" -install_ansible stable-2.0 +install_ansible ${test_ansible_version} ansible_plugins ansible-galaxy -f install debops.ferm From 95b97c4cd0d102478e629f1f009fecbf49d77779 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Thu, 27 Oct 2016 21:40:34 +0200 Subject: [PATCH 31/36] Adjust path to Kibana-5.0 --- ansible-kibana/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-kibana/test b/ansible-kibana/test index 2f9b1b3..22ef60f 100755 --- a/ansible-kibana/test +++ b/ansible-kibana/test @@ -19,7 +19,7 @@ assert_playbook_check_runs assert_playbook_idempotent assert_iptables_allow 5601 -assert_path "/opt/kibana/config/kibana.yml" +assert_path "/etc/kibana/kibana.yml" assert_tcp localhost 5601 assert_docs From 77a487983f71b56520104e7c08f4cbeb719e9fc9 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Thu, 27 Oct 2016 22:56:09 +0200 Subject: [PATCH 32/36] Don't use Ubuntu repository for testing --- ansible-elasticsearch/inventory/group_vars/all.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible-elasticsearch/inventory/group_vars/all.yml b/ansible-elasticsearch/inventory/group_vars/all.yml index 252ebcd..6c35079 100644 --- a/ansible-elasticsearch/inventory/group_vars/all.yml +++ b/ansible-elasticsearch/inventory/group_vars/all.yml @@ -1,5 +1,6 @@ --- +elasticsearch__distribution_repository: False elasticsearch_bind_host: ['0.0.0.0'] elasticsearch_node_allow: ['127.0.0.1'] elasticsearch_http_allow: ['127.0.0.1'] From adf0802bc31c3bd62e8f8f8ab87cd9601c493fd3 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 15 Mar 2017 07:43:47 +0100 Subject: [PATCH 33/36] Assert status of ssh jail --- ansible-fail2ban/test | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible-fail2ban/test b/ansible-fail2ban/test index f8dc9cf..91a787c 100755 --- a/ansible-fail2ban/test +++ b/ansible-fail2ban/test @@ -20,5 +20,6 @@ assert_playbook_idempotent assert_path "/etc/fail2ban/jail.local" assert_running "fail2ban-server" assert_in_file "/etc/fail2ban/jail.local" "banaction" +assert_exit_code "fail2ban-client status ssh" "0" assert_docs From cb6a0c59557fc143129a1654c960ce8808604496 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Wed, 15 Mar 2017 08:03:20 +0100 Subject: [PATCH 34/36] Make test command more verbose --- ansible-fail2ban/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-fail2ban/test b/ansible-fail2ban/test index 91a787c..a8781d3 100755 --- a/ansible-fail2ban/test +++ b/ansible-fail2ban/test @@ -20,6 +20,6 @@ assert_playbook_idempotent assert_path "/etc/fail2ban/jail.local" assert_running "fail2ban-server" assert_in_file "/etc/fail2ban/jail.local" "banaction" -assert_exit_code "fail2ban-client status ssh" "0" +assert_exit_code "fail2ban-client -vv status ssh" "0" assert_docs From b15bcd09bc8bc7aaa594496b74e7ad887a2718f6 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Thu, 16 Mar 2017 07:34:34 +0100 Subject: [PATCH 35/36] Let's try it with sudo --- ansible-fail2ban/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-fail2ban/test b/ansible-fail2ban/test index a8781d3..6a06afe 100755 --- a/ansible-fail2ban/test +++ b/ansible-fail2ban/test @@ -20,6 +20,6 @@ assert_playbook_idempotent assert_path "/etc/fail2ban/jail.local" assert_running "fail2ban-server" assert_in_file "/etc/fail2ban/jail.local" "banaction" -assert_exit_code "fail2ban-client -vv status ssh" "0" +assert_exit_code "sudo fail2ban-client -vv status ssh" "0" assert_docs From 80876ee401d68efe19cf2bae2b631ed3d64a6950 Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Fri, 14 Apr 2017 11:56:41 +0200 Subject: [PATCH 36/36] Update ansible-checkmk_agent for rework-4 Related to: https://github.com/debops-contrib/ansible-checkmk_agent/pull/28 --- ansible-checkmk_agent/playbooks/test.yml | 21 +++++++++++---------- ansible-checkmk_agent/test | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ansible-checkmk_agent/playbooks/test.yml b/ansible-checkmk_agent/playbooks/test.yml index c8b04be..92e780c 100644 --- a/ansible-checkmk_agent/playbooks/test.yml +++ b/ansible-checkmk_agent/playbooks/test.yml @@ -4,6 +4,9 @@ become: True roles: + + - role: ansible-checkmk_agent/env + - role: debops.apt_preferences apt_preferences__dependent_list: - '{{ checkmk_agent__apt_preferences__dependent_list }}' @@ -11,25 +14,23 @@ - role: debops.etc_services etc_services__dependent_list: - '{{ checkmk_agent__etc_services__dependent_list }}' - when: ('xinetd' in checkmk_agent__type|d(['ssh'])) + when: ('xinetd' in checkmk_agent__type) - role: debops.ferm ferm__dependent_rules: - '{{ checkmk_agent__ferm__dependent_rules }}' - when: ('xinetd' in checkmk_agent__type|d(['ssh'])) + + - role: debops.tcpwrappers + tcpwrappers__dependent_allow: + - '{{ checkmk_agent__tcpwrappers__dependent_allow }}' - role: debops.authorized_keys authorized_keys__dependent_list: - '{{ checkmk_agent__authorized_keys__dependent_list }}' - when: ('ssh' in checkmk_agent__type|d(['ssh'])) - role: debops.mariadb - mariadb__users: - - '{{ checkmk_agent__mariadb__users }}' - when: (("mk_mysql" in checkmk_agent__plugin_list and - checkmk_agent__plugin_mysql|d("automatic") == "automatic") or - ((checkmk_agent__plugin_autodetect|d(True) | bool) and - "debops_mariadb_server" in hostvars[inventory_hostname]["group_names"]) - ) + mariadb__dependent_users: + - '{{ checkmk_agent__mariadb__dependent_users }}' + when: ("mk_mysql" in checkmk_agent__combined_plugins) - role: ansible-checkmk_agent diff --git a/ansible-checkmk_agent/test b/ansible-checkmk_agent/test index 69a8806..8ec67a6 100755 --- a/ansible-checkmk_agent/test +++ b/ansible-checkmk_agent/test @@ -16,6 +16,7 @@ ansible-galaxy -f install debops.apt_preferences ansible-galaxy -f install debops.authorized_keys ansible-galaxy -f install debops.etc_services ansible-galaxy -f install debops.ferm +ansible-galaxy -f install debops.tcpwrappers ansible-galaxy -f install debops.mariadb assert_playbook_check_runs