You've already forked role-check-mk-agent
Proper role testing
This commit is contained in:
@@ -61,3 +61,5 @@ cmk_force_install: false
|
|||||||
cmk_host_ip: "{{ ansible_host }}"
|
cmk_host_ip: "{{ ansible_host }}"
|
||||||
|
|
||||||
cmk_dl_needs_auth: true
|
cmk_dl_needs_auth: true
|
||||||
|
|
||||||
|
cmk_debug: True
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Aaron Guise
|
author: Aaron Guise
|
||||||
description: Install checkmk agent with Enterprise Baked Agent
|
description: Install checkmk agent with Enterprise Baked Agent
|
||||||
|
role_name: check_mk_agent
|
||||||
|
namespace: cybercinch
|
||||||
# If the issue tracker for your role is not on github, uncomment the
|
# If the issue tracker for your role is not on github, uncomment the
|
||||||
# next line and provide a value
|
# next line and provide a value
|
||||||
# issue_tracker_url: http://example.com/issue/tracker
|
# issue_tracker_url: http://example.com/issue/tracker
|
||||||
|
|||||||
@@ -14,17 +14,17 @@
|
|||||||
- name: Delete Host
|
- name: Delete Host
|
||||||
uri:
|
uri:
|
||||||
method: POST
|
method: POST
|
||||||
url: http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=delete_host{{ cmk_auth }}
|
url: https://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=delete_host{{ cmk_auth }}
|
||||||
body: 'request={"hostname":"{{ item.name }}"}'
|
body: 'request={"hostname":"{{ item.name }}"}'
|
||||||
body_format: raw
|
body_format: raw
|
||||||
status_code: 200
|
status_code: 200
|
||||||
no_log: true
|
no_log: False
|
||||||
with_items: "{{ molecule_yml.platforms }}"
|
with_items: "{{ molecule_yml.platforms }}"
|
||||||
|
|
||||||
- name: cmk_apply
|
- name: cmk_apply
|
||||||
uri:
|
uri:
|
||||||
method: POST
|
method: POST
|
||||||
url: http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=activate_changes&mode=specific{{ cmk_auth }}
|
url: https://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=activate_changes&mode=specific{{ cmk_auth }}
|
||||||
body: 'request={"sites":["{{ cmk_omd_site }}"]}'
|
body: 'request={"sites":["{{ cmk_omd_site }}"]}'
|
||||||
body_format: raw
|
body_format: raw
|
||||||
status_code: 200
|
status_code: 200
|
||||||
@@ -8,7 +8,11 @@
|
|||||||
cmk_omd_site: "{{ lookup('env', 'CMK_OMD_SITE') }}"
|
cmk_omd_site: "{{ lookup('env', 'CMK_OMD_SITE') }}"
|
||||||
cmk_username: "{{ lookup('env', 'CMK_USERNAME') }}"
|
cmk_username: "{{ lookup('env', 'CMK_USERNAME') }}"
|
||||||
cmk_secret: "{{ lookup('env', 'CMK_SECRET') }}"
|
cmk_secret: "{{ lookup('env', 'CMK_SECRET') }}"
|
||||||
|
cmk_download_mode: "{{ lookup('env', 'CMK_DOWNLOAD_MODE') }}"
|
||||||
|
cmk_download_path: "{{ lookup('env', 'CMK_DOWNLOAD_PATH') }}"
|
||||||
|
cmk_smb_username: "{{ lookup('env', 'CMK_SMB_USERNAME') }}"
|
||||||
|
cmk_smb_password: "{{ lookup('env', 'CMK_SMB_PASSWORD') }}"
|
||||||
tasks:
|
tasks:
|
||||||
- name: "Include ansible-role-cmk-agent"
|
- name: "Include ansible-role-cmk-agent"
|
||||||
include_role:
|
include_role:
|
||||||
name: "ansible-role-cmk-agent"
|
name: "ansi-ansible-role-check-mk-agent"
|
||||||
|
|||||||
@@ -5,27 +5,30 @@ driver:
|
|||||||
name: docker
|
name: docker
|
||||||
platforms:
|
platforms:
|
||||||
- name: rhel8
|
- name: rhel8
|
||||||
image: guisea/centos8-ansible:latest
|
image: docker.io/cybercinch/docker-almalinux8-ansible
|
||||||
# dockerfile: Centos8-Dockerfile
|
# dockerfile: Centos8-Dockerfile
|
||||||
privileged: True
|
privileged: True
|
||||||
volume_mounts:
|
command: ${MOLECULE_DOCKER_COMMAND:-"/usr/sbin/init"}
|
||||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
volumes:
|
||||||
command: "/usr/sbin/init"
|
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||||
pre_build_image: true
|
pre_build_image: true
|
||||||
- name: rhel7
|
- name: rhel7
|
||||||
image: guisea/centos7-ansible:latest
|
image: guisea/centos7-ansible:latest
|
||||||
# dockerfile: Centos7-Dockerfile
|
# dockerfile: Centos7-Dockerfile
|
||||||
privileged: True
|
privileged: True
|
||||||
volume_mounts:
|
volumes:
|
||||||
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
|
||||||
command: "/usr/sbin/init"
|
command: "/usr/sbin/init"
|
||||||
pre_build_image: true
|
pre_build_image: true
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
log: True
|
||||||
|
options:
|
||||||
|
vvv: True
|
||||||
verifier:
|
verifier:
|
||||||
name: ansible
|
name: ansible
|
||||||
lint: |
|
# lint: |
|
||||||
set -e
|
# set -e
|
||||||
yamllint .
|
# yamllint .
|
||||||
ansible-lint
|
# ansible-lint
|
||||||
flake8
|
# flake8
|
||||||
@@ -6,6 +6,11 @@
|
|||||||
state: present
|
state: present
|
||||||
notify: restart xinetd
|
notify: restart xinetd
|
||||||
|
|
||||||
|
- name: Ensure python openssl available
|
||||||
|
package:
|
||||||
|
name: python3-openssl,python3-requests
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Fix SeLinux Auto-Updates
|
- name: Fix SeLinux Auto-Updates
|
||||||
block:
|
block:
|
||||||
- name: list installed selinux modules
|
- name: list installed selinux modules
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
state: present
|
state: present
|
||||||
notify: restart xinetd
|
notify: restart xinetd
|
||||||
|
|
||||||
|
- name: Start xinetd
|
||||||
|
service:
|
||||||
|
name: xinetd
|
||||||
|
state: started
|
||||||
|
|
||||||
- name: Fix SeLinux Auto-Updates
|
- name: Fix SeLinux Auto-Updates
|
||||||
block:
|
block:
|
||||||
- name: list installed selinux modules
|
- name: list installed selinux modules
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
become: True
|
||||||
with_items:
|
with_items:
|
||||||
- samba-client
|
- samba-client
|
||||||
- cifs-utils
|
- cifs-utils
|
||||||
|
|||||||
Reference in New Issue
Block a user