Skip to content

Commit

Permalink
Playbook (documentation) update, remove dependencies
Browse files Browse the repository at this point in the history
Don't hard-depend on roles anymore (see debops/debops-playbooks#192).
Include example playbook instead of inlining it (see debops/docs#145).
  • Loading branch information
ganto committed Jun 25, 2016
1 parent db36f50 commit 608de16
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 65 deletions.
19 changes: 15 additions & 4 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Getting started
===============

Example playbook
----------------

Here's an example playbook that uses the ``debops-contrib.checkmk_agent`` role:

.. literalinclude:: playbooks/checkmk_agent.yml
:language: yaml


Ansible tags
------------
Expand All @@ -18,16 +29,16 @@ Available role tags:
this to omit them using ``--skip-tags`` parameter.

``depend-of::checkmk_agent``
Execute all ``debops.contrib-checkmk_agent`` role dependencies in its context.
Execute all ``debops-contrib.checkmk_agent`` role dependencies in its context.

``depend::apt_preferences:checkmk_agent``
Run ``debops.apt_preferences`` dependent role in ``debops.contrib-checkmk_agent`` context.
Run ``debops.apt_preferences`` dependent role in ``debops-contrib.checkmk_agent`` context.

``depend::etc_services:checkmk_agent``
Run ``debops.etc_services`` dependent role in ``debops.contrib-checkmk_agent`` context.
Run ``debops.etc_services`` dependent role in ``debops-contrib.checkmk_agent`` context.

``depend::ferm:checkmk_agent``
Run ``debops.ferm`` dependent role in ``debops.contrib-checkmk_agent`` context.
Run ``debops.ferm`` dependent role in ``debops-contrib.checkmk_agent`` context.

``role::checkmk_agent:plugins``
Run tasks related to Check_MK agent plugin configuration.
5 changes: 2 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
.. _debops.contrib-checkmk_agent:
.. _debops-contrib.checkmk_agent:

Ansible role: debops.contrib-checkmk_agent
Ansible role: debops-contrib.checkmk_agent
==========================================

.. toctree::
:maxdepth: 2

introduction
installation
getting-started
defaults
copyright
Expand Down
16 changes: 0 additions & 16 deletions docs/installation.rst

This file was deleted.

11 changes: 11 additions & 0 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ suite.
.. _Ansible: http://ansible.com/
.. _Check_MK: https://mathias-kettner.com/check_mk.html


Installation
~~~~~~~~~~~~

This role requires at least Ansible ``v1.9.0``. To install it, clone it
to your `DebOps`_ project roles directory::

git clone https://github.com/debops-contrib/ansible-checkmk_agent.git debops-contrib.ansible_checkmk_agent

.. _DebOps: http://debops.org/

..
Local Variables:
mode: rst
Expand Down
51 changes: 51 additions & 0 deletions docs/playbooks/checkmk_agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---

- name: Manage Check_MK agent
hosts: [ 'debops_service_checkmk_agent', 'debops_checkmk_agent' ]
become: True

roles:
- role: debops.apt_preferences
tags: [ 'depend::apt_preferences', 'depend::apt_preferences:checkmk_agent',
'depend-of::checkmk_agent', 'type::dependency' ]
apt_preferences__dependent_list:
- package: 'check-mk'
backports: [ 'jessie' ]
reason: 'Package not available in stable Debian Jessie'
by_role: 'debops.contrib-checkmk_agent'

- role: debops.etc_services
tags: [ 'depend::etc_services', 'depend::etc_services:checkmk_agent',
'depend-of::checkmk_agent', 'type::dependency' ]
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: [ 'depend::ferm', 'depend::ferm:checkmk_agent',
'depend-of::checkmk_agent', 'type::dependency' ]
ferm__dependent_rules: '{{ checkmk_agent__ferm_dependent_rules }}'
when: (checkmk_agent|d() and 'xinetd' in checkmk_agent)

- role: debops.mariadb
tags: [ 'depend::mariadb', 'depend::mariadb:checkmk_agent',
'depend-of::checkmk_agent', 'type::dependency' ]
mariadb__users:
- user: '{{ checkmk_agent__plugin_mysql_user }}'
password: '{{ checkmk_agent__plugin_mysql_password }}'
priv: '{{ checkmk_agent__plugin_mysql_priv }}'
priv_default: False
priv_aux: False
append_privs: False
owner: 'root'
creds_path: '/etc/check_mk/mysql.cfg'
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' ]
44 changes: 2 additions & 42 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,14 @@
---

dependencies:

- role: debops.apt_preferences
tags: [ 'depend::apt_preferences', 'depend::apt_preferences:checkmk_agent',
'depend-of::checkmk_agent', 'type::dependency' ]
apt_preferences__dependent_list:
- package: 'check-mk'
backports: [ 'jessie' ]
reason: 'Package not available in stable Debian Jessie'
by_role: 'debops.contrib-checkmk_agent'

- role: debops.etc_services
tags: [ 'depend::etc_services', 'depend::etc_services:checkmk_agent',
'depend-of::checkmk_agent', 'type::dependency' ]
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: [ 'depend::ferm', 'depend::ferm:checkmk_agent',
'depend-of::checkmk_agent', 'type::dependency' ]
ferm__dependent_rules: '{{ checkmk_agent__ferm_dependent_rules }}'
when: (checkmk_agent|d() and 'xinetd' in checkmk_agent)

- role: debops.mariadb
mariadb__users:
- user: '{{ checkmk_agent__plugin_mysql_user }}'
password: '{{ checkmk_agent__plugin_mysql_password }}'
priv: '{{ checkmk_agent__plugin_mysql_priv }}'
priv_default: False
priv_aux: False
append_privs: False
owner: 'root'
creds_path: '/etc/check_mk/mysql.cfg'
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"])
)
tags: [ 'depend::mariadb', 'depend::mariadb:checkmk_agent',
'depend-of::checkmk_agent', 'type::dependency' ]
dependencies: []

galaxy_info:

company: 'DebOps'
author: 'Reto Gantenbein, Robin Schneider'
description: 'Setup Check_MK monitoring agent'
license: 'GNU General Public License v3'
min_ansible_version: '1.7.0'
min_ansible_version: '1.9.0'

platforms:

Expand Down

0 comments on commit 608de16

Please sign in to comment.