1- Icinga Director Collection for Ansible
2- =========
1+ # Icinga Director Collection for Ansible
32
43[ ![ ci-ansible-test] ( https://github.com/T-Systems-MMS/ansible-collection-icinga-director/workflows/ansible-test/badge.svg )] ( https://github.com/T-Systems-MMS/ansible-collection-icinga-director/actions?query=workflow%3Aansible-test )
54[ ![ codecov] ( https://codecov.io/gh/T-Systems-MMS/ansible-collection-icinga-director/branch/master/graph/badge.svg )] ( https://codecov.io/gh/T-Systems-MMS/ansible-collection-icinga-director )
@@ -27,8 +26,9 @@ Currently supported modules:
2726* ` icinga_user `
2827* ` icinga_zone `
2928
30- Installation
31- ------------
29+ Additionally all supported modules have an appropriate ` *_info ` -module to gather facts about the existing objects in the director.
30+
31+ ## Installation
3232
3333These modules are distributed as [ collections] ( https://docs.ansible.com/ansible/latest/user_guide/collections_using.html ) .
3434To install them, run:
@@ -45,8 +45,7 @@ collections:
4545- t_systems_mms.icinga_director
4646```
4747
48- Examples using the modules
49- --------------------------
48+ ## Examples using the modules
5049
5150See the ` examples ` directory for a complete list of examples.
5251
@@ -72,56 +71,67 @@ See the `examples` directory for a complete list of examples.
7271 dnscheck: "no"
7372```
7473
75- Examples using the role
76- -----------------------
74+ ```
75+ - name: Query a service apply rule in icinga
76+ t_systems_mms.icinga_director.icinga_service_apply_info:
77+ url: "{{ icinga_url }}"
78+ url_username: "{{ icinga_user }}"
79+ url_password: "{{ icinga_pass }}"
80+ query: "SERVICE_dummy"
81+ register: result
82+ ```
83+
84+ ## Examples using the role
7785
7886Please see the [ README] ( roles/ansible_icinga/README.md ) of the role.
7987
80- Troubleshooting
81- ---------------
88+ ## Troubleshooting
8289
8390If the following error is thrown, check if you're behind a proxy and use ` force_basic_auth: true ` in the task.
8491
8592```
8693fatal: [localhost]: FAILED! => {"changed": false, "msg": "bad return code while creating: -1. Error message: Request failed: <urlopen error Tunnel connection failed: 302 Found>"}
8794```
8895
89- Local Testing
90- -------------
96+ ## Local Development and testing
9197
92- * Linting with tox
98+ ### Linting with tox
9399
94100```
95101> tox -elinters
96102```
97103
98- * Integration tests with docker
104+ ### Updating the tests and examples
105+
106+ If you add new features or arguments to the existing modules, please add them to the examples in the module itself.
107+ The integration tests and examples in our documentation are then generated from the module-examples.
108+
109+ To trigger this generation, you need to run the script ` hacking/update_examples_and_tests.sh ` from the root of the repository. For this you need to have yq in version 3 installed (see https://mikefarah.gitbook.io/yq/v/v3.x/ ).
110+
111+ ### Integration tests with docker
99112
100113```
101114# run icinga in a container and forward port 80
102- > docker run -d -p 80:80 jordan /icinga2
115+ > docker run -d -p 80:80 schurzi /icinga2
103116
104117# run the ansible playbooks against the container
105118> ansible-playbook tests/integration/targets/icinga/normalmode.yml
106119> ansible-playbook tests/integration/targets/icinga/checkmode.yml
107120```
108121
109- Extras
110- ------
122+ ## Extras
111123
112124* Use our code snippets template supported in Visual Studio Code
113125
114126Please see the [ README] ( vsc-snippets/README.md ) for more information.
115127
116-
117- License
118- -------
128+ ## License
119129
120130GPLv3
121131
122- Author Information
123- ------------------
132+ ## Author Information
124133
125134* Sebastian Gumprich
126135* Lars Krahl
127136* Michaela Mattes
137+ * Martin Schurz
0 commit comments