Comments (3)
I have tried the devel-branch (https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/8928a1df37701c863752fce5692b5e17c6ae2b5c/plugins/modules/host.py) and my example tasks are working now.
- Changing folder and/or ip of the host is working.
- The state (absent/present) is working.
But the role is missing a line for the state: https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/8928a1df37701c863752fce5692b5e17c6ae2b5c/roles/agent/tasks/main.yml#L34-L44
Adding state: "{{ checkmk_agent_state | default(omit) }}"
after https://github.com/tribe29/ansible-collection-tribe29.checkmk/blob/8928a1df37701c863752fce5692b5e17c6ae2b5c/roles/agent/tasks/main.yml#L43 seems to fix it:
changed: [my_host_with_ip -> localhost] => {"changed": true, "failed_when_result": false, "msg": "Host deleted."}
My inventory now looks like:
my_site: # = Sitename
hosts:
host_with_ip:
ansible_host: 127.0.0.1
checkmk_agent_host_attributes:
ipaddress: '{{ansible_host}}'
tag_custom: "own_custom_tag"
checkmk_agent_folder: test
state: present
my_host_with_ip:
ansible_host: 127.0.0.2
checkmk_agent_host_attributes:
ipaddress: '{{ansible_host}}'
tag_custom: "own_custom_tag"
checkmk_agent_folder: test
state: absent
vars:
checkmk_agent_add_host: 'true'
checkmk_agent_edition: cme
checkmk_agent_host_ip: '{{ ansible_host }}'
checkmk_agent_host_name: '{{ inventory_hostname }}'
checkmk_agent_pass: "$SECRET"
checkmk_agent_protocol: https
checkmk_agent_server: localhost
checkmk_agent_site: my_site
checkmk_agent_user: automation
checkmk_agent_version: 2.0.0p23
My playbook now looks like:
---
- hosts: my_site # = Sitename
connection: local
roles:
- tribe29.checkmk.agent
from ansible-collection-checkmk.general.
@lgetwan can you take a look at the plugin, I cannot seem to get my head around it.
from ansible-collection-checkmk.general.
Fixed with PR #147
from ansible-collection-checkmk.general.
Related Issues (20)
- [BUG] folder creation always lowers the foldername HOT 10
- [Feed] folder lookup plugin does not return the title of the folder HOT 3
- fixed downtime? HOT 4
- [BUG] "Register Agent for TLS" does not allow for "!" in checkmk_agent_auth on Linux HOT 1
- [FEED] Only register agent if host was created on the server or agent was installed HOT 4
- [FEED] Implement module for LDAP Connections
- [BUG] module "folder" not idempotent HOT 10
- [BUG] `discovery` module out of sync with the Checkmk REST API HOT 2
- [BUG] Error in the Agent role, Firewall seems to be only installed if checkmk_agent_server is an ip address HOT 3
- [FEED] Configure new web services monitoring HOT 1
- [BUG] rule idempotency check does not work for special_agents:vsphere rules HOT 4
- [BUG] ckeckmk agent deployment not respecting variables HOT 1
- [BUG] Unable to register agent for automatic updates HOT 5
- [BUG] Integration tests for downtime module creates downtime in the past HOT 1
- [BUG] Agent role crashes, when connections file absent HOT 4
- [BUG] InvalidAccessKeyId during installing the collection HOT 1
- Agent TLS registration does not work in disributed monitoring
- [BUG] Skip verifying the ssl cert for setting downtimes HOT 1
- [BUG] update_attribute on folder always results in 'changed' HOT 12
- [FEED] Implement module for DCD Connections
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-collection-checkmk.general.