mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 12:37:21 +00:00
WIP changes for adding hosts to checkmk
This commit is contained in:
1 parent
001db69fe0
commit
41c8ecdddc
5 files changed
+77
-8
No files matched your search
@@ -0,0 +1,35 @@
|
||||
---
|
||||
|
||||
- name: Gather the package facts
|
||||
ansible.builtin.package_facts:
|
||||
manager: apt
|
||||
|
||||
- name: Setup CheckMK agent
|
||||
block:
|
||||
- name: Include CheckMK variables
|
||||
ansible.builtin.include_vars:
|
||||
file: ../vars/checkmk.yml
|
||||
|
||||
- name: Add proxy host into checkMK
|
||||
checkmk.general.host:
|
||||
server_url: "{{ checkmk_agent_protocol }}://{{ checkmk_server }}:80/"
|
||||
site: "{{ checkmk_agent_site }}"
|
||||
validate_certs: "true"
|
||||
automation_user: "{{ checkmk_agent_user }}"
|
||||
automation_secret: "{{ checkmk_password }}"
|
||||
folder: "/"
|
||||
name: "{{ inventory_hostname }}"
|
||||
attributes:
|
||||
ipaddress: "{{ hostvars[inventory_hostname].ansible_host }}"
|
||||
state: "present"
|
||||
notify: "activate changes"
|
||||
|
||||
- name: Install CheckMK Agent
|
||||
import_role:
|
||||
name: checkmk.general.agent
|
||||
when: ansible_facts.packages['check-mk-agent'] | default('Missing') == 'Missing'
|
||||
|
||||
- name: register agent for TLS
|
||||
shell: |
|
||||
cmk-agent-ctl proxy-register --hostname {{ inventory_hostname }} --server {{ checkmk_server }} --site {{ checkmk_agent_site }} --user {{ checkmk_agent_user }} --password '{{ checkmk_password }}' --trust-cert
|
||||
|
||||
@@ -69,4 +69,9 @@
|
||||
state: started
|
||||
enabled: true
|
||||
when:
|
||||
- not ansible_check_mode
|
||||
- not ansible_check_mode
|
||||
|
||||
- name: Import checkmk.yml
|
||||
import_tasks:
|
||||
file: checkmk.yml
|
||||
tags: proxy_cmk
|
||||
Reference in new issue
Block a user