diff --git a/ansible-checkmk_agent/inventory/group_vars/all/checkmk_agent.yml b/ansible-checkmk_agent/inventory/group_vars/all/checkmk_agent.yml new file mode 100644 index 0000000..234a6fe --- /dev/null +++ b/ansible-checkmk_agent/inventory/group_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/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..92e780c --- /dev/null +++ b/ansible-checkmk_agent/playbooks/test.yml @@ -0,0 +1,36 @@ +--- + +- hosts: 'placeholder_fqdn' + become: True + + roles: + + - role: ansible-checkmk_agent/env + + - 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: ('xinetd' in checkmk_agent__type) + + - role: debops.ferm + ferm__dependent_rules: + - '{{ checkmk_agent__ferm__dependent_rules }}' + + - 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 }}' + + - role: debops.mariadb + 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 new file mode 100755 index 0000000..8ec67a6 --- /dev/null +++ b/ansible-checkmk_agent/test @@ -0,0 +1,36 @@ +#!/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.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 +assert_playbook_idempotent + + +assert_path '/etc/check_mk' +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/check-mk-agent' + + +assert_docs 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..9296854 --- /dev/null +++ b/ansible-checkmk_server/playbooks/test.yml @@ -0,0 +1,12 @@ +--- + +- hosts: 'placeholder_fqdn' + become: True + + roles: + + - role: debops.ferm + ferm__dependent_rules: + - '{{ checkmk_server__ferm_dependent_rules }}' + + - role: ansible-checkmk_server diff --git a/ansible-checkmk_server/test b/ansible-checkmk_server/test new file mode 100755 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 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..cc771b4 --- /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 stable-2.1 +ansible_plugins + + +assert_playbook_check_runs +assert_playbook_idempotent + + +assert_path "/etc/filebeat/filebeat.yml" +assert_running filebeat +assert_path "/etc/topbeat/topbeat.yml" +assert_running topbeat +assert_path "/etc/packetbeat/packetbeat.yml" +assert_running packetbeat + + +assert_docs 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'] diff --git a/ansible-fail2ban/test b/ansible-fail2ban/test index f8dc9cf..6a06afe 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 "sudo fail2ban-client -vv status ssh" "0" assert_docs 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..691ad78 --- /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 }}', '127.0.0.1' ] 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..7e23039 --- /dev/null +++ b/ansible-gdnsd/test @@ -0,0 +1,33 @@ +#!/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" + +# 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 + +assert_playbook_check_runs +assert_playbook_idempotent + +assert_path /etc/gdnsd/config +assert_running gdnsd +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})" "${HOSTNAME}.localdomain." + +assert_docs 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..db78f79 --- /dev/null +++ b/ansible-kibana/playbooks/test.yml @@ -0,0 +1,17 @@ +--- + +- 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: debops.ferm + ferm__dependent_rules: + - '{{ kibana__ferm__dependent_rules }}' + + - role: ansible-kibana diff --git a/ansible-kibana/test b/ansible-kibana/test new file mode 100755 index 0000000..22ef60f --- /dev/null +++ b/ansible-kibana/test @@ -0,0 +1,25 @@ +#!/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 + +ansible-galaxy -f install debops.ferm + + +assert_playbook_check_runs +assert_playbook_idempotent + +assert_iptables_allow 5601 +assert_path "/etc/kibana/kibana.yml" +assert_tcp localhost 5601 + +assert_docs 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..1695932 --- /dev/null +++ b/ansible-roundcube/playbooks/test.yml @@ -0,0 +1,25 @@ +--- + +- hosts: 'placeholder_fqdn' + become: True + + environment: '{{ inventory__environment | d({}) + | combine(inventory__group_environment | d({})) + | combine(inventory__host_environment | d({})) }}' + + roles: + + - role: debops.php5 + php5_packages: + - '{{ roundcube__php5_packages }}' + php5_pools: + - '{{ roundcube__php5_pool }}' + + - role: debops.nginx + nginx_servers: + - '{{ roundcube__nginx_server }}' + nginx_upstreams: + - '{{ roundcube__nginx_upstream_php5 }}' + + - role: 'ansible-roundcube' + diff --git a/ansible-roundcube/test b/ansible-roundcube/test new file mode 100755 index 0000000..a04f5f1 --- /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 "/srv/www/roundcube" + +assert_docs +