L5D4me
(L)
October 27, 2022, 4:48pm
1
Hello All!
Ive been using the new Icinga Collection for Ansible (F Amazing guys!)
The one thing im lacking or having trouble finding is a way to kick off a Director Deploy.
Im using your new Ansible Collection for 100% of my Icinga tasks EXCEPT for the actual Director Deploy
Right now im forced to use something like this
(The var director_url_deploy references this url “…/director/config/deploy”)
- name: Deploy Changes in Icinga Director
tags: uri
uri:
validate_certs: no
url: "{{ director_url_deploy }}"
headers:
Accept: application/json
method: POST
user: "{{ icinga_username }}"
password: "{{ icinga_password }}"
return_content: true
retries: 3
delay: 5
register: deploy_result
until: deploy_result is not failed
I scoured the docs for the new collections, but couldn’t find a way to kick off a deploy.
Am i missing something stupid?
TIA
Hi L5D4me,
Unfortunately, the t_systems_mms.icinga_director module pushes the host only in Icinga Directory. There is no way to deploy the changes automatically through ansible script.
But you can create automatic jobs which will deploy your changes!
https://icinga.com/docs/icinga-director/latest/doc/79-Jobs/
David
rndmh3ro
(Sebastian Gumprich)
May 23, 2023, 8:26am
3
In the latest version we added a module to deploy changes:
- name: Deploy the icinga config
t_systems_mms.icinga_director.icinga_deploy:
url: "{{ icinga_url }}"
url_username: "{{ icinga_user }}"
url_password: "{{ icinga_pass }}"
The version isn’t in the ansible-package yet, so you have to manually install it or wait for a new ansible release.
Hi Sebastian,
Can you help me to understand, why, I cannot deploy the changes to directory?
Here is my ansible script:
- name: Add Host to icinga
t_systems_mms.icinga_director.icinga_host:
state: present
validate_certs: no
url: "{{ url }}"
url_username: "{{ icinga_user }}"
url_password: "{{ icinga_password }}"
accept_config: true
address: "{{ ansible_default_ipv4['address'] }}"
check_command: hostalive
disabled: false
object_name: "{{ ansible_hostname }}"
- name: Deploy the icinga config
t_systems_mms.icinga_director.icinga_deploy:
url: "{{ url }}"
validate_certs: no
url_username: "{{ icinga_user }}"
url_password: "{{ icinga_password }}"
And the error I get:
And the URL is correct!
Thank you!!!
Hi!
Any help will be appreciated!
Thanks