7 Commits
1.0.4 ... 1.0.9

4 changed files with 40 additions and 26 deletions

View File

@@ -14,6 +14,11 @@ cmk_rpm_agent: http://url-from-your-agent-bakery-in-checkmk.rpm
# Copy paste the link address for MSI (Windows) agent from CheckMK
cmk_msi_agent: http://url-from-your-agent-bakery-in-checkmk.msi
# Check_MK GPG Key
# Copy paste the link address from Signature Keys for Signing Agents page
cmk_gpg_key_id: 1
cmk_gpg_key_url: "{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/wato.py?key={{ cmk_gpg_key_id }}&mode=download_signature_key"
# Should be username of an automation user in checkmk
cmk_username: some-username

View File

@@ -15,7 +15,4 @@
port: 6556/tcp
state: enabled
permanent: yes
- name: ensure firewall reloaded
command: firewall-cmd --reload
changed_when: false
immediate: yes

View File

@@ -1,5 +1,27 @@
- block:
- name: Register with CheckMK Update Server
shell: |
cmk-update-agent register -H $(hostname -s) --user {{ cmk_username }} \
--secret {{ cmk_secret }}
changed_when: false
rescue:
- name: Gather facts of packages
package_facts:
manager: "auto"
- name: Ensure check_mk_agent installed (again)
package:
name: "{{ cmk_rpm_agent }}{{ cmk_auth }}"
state: latest
disable_gpg_check: true
notify:
- restart xinetd
- ensure firewall open
when: "'check-mk-agent' not in ansible_facts.packages"
- name: Register with CheckMK Update Server (retry)
shell: |
cmk-update-agent register -H $(hostname -s) --user {{ cmk_username }} \
--secret {{ cmk_secret }}
changed_when: false
when: "'check-mk-agent' in ansible_facts.packages"

View File

@@ -1,9 +1,9 @@
---
# Tasks for installation on RedHat Family
- name: Ensure xinetd installed
yum:
package:
name: xinetd
state: installed
state: present
notify: restart xinetd
- name: Gather facts of packages
@@ -12,25 +12,15 @@
- name: Install check-mk-agent
block:
- name: Download the agent from Server
get_url:
url: "{{ cmk_rpm_agent }}{{ cmk_auth }}"
dest: /tmp/check-mk-agent.rpm
- name: Ensure check_mk_agent installed
yum:
name: /tmp/check-mk-agent.rpm
state: installed
package:
name: "{{ cmk_rpm_agent }}{{ cmk_auth }}"
state: latest
disable_gpg_check: true
notify:
- restart xinetd
- cmk fresh install
- ensure firewall open
- ensure firewall reloaded
- name: Remove agent Download
file:
path: /tmp/check-mk-agent.rpm
state: absent
when: "'check-mk-agent' not in ansible_facts.packages or cmk_force_install"
tags:
- check_mk_agent