Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zerwes committed Aug 5, 2022
1 parent 26adbe8 commit ffb281e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: service inetd
service:
ansible.builtin.service:
name: inetd
state: restarted

Expand Down
24 changes: 12 additions & 12 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
- name: Install opnsense packages
pkgng:
community.general.pkgng:
name: "{{ opn_packages }}"
state: present

- name: copy check_mk_agent
copy:
ansible.builtin.copy:
src: check_mk_agent.freebsd
dest: "{{ opn_check_mk_path }}"
mode: 0700
notify: service inetd
when: opn_install_check_mk

- name: create lib dirs
file:
ansible.builtin.file:
path: "{{ opn_check_mk_lib_dir }}/{{ item }}"
state: directory
mode: 0755
Expand All @@ -23,60 +23,60 @@
when: opn_install_check_mk

- name: copy check_mk plugins
copy:
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ opn_check_mk_lib_dir }}/plugins/{{ item }}"
mode: 0700
with_items: "{{ opn_check_mk_plugins }}"
when: opn_install_check_mk

- name: copy check_mk local checks
copy:
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ opn_check_mk_lib_dir }}/local/{{ item }}"
mode: 0700
with_items: "{{ opn_check_mk_local_checks }}"
when: opn_install_check_mk

- name: copy check_mk additional files
copy:
ansible.builtin.copy:
src: "{{ item.key }}"
dest: "{{ item.value }}"
mode: 0600
with_dict: "{{ opn_check_mk_additional_files }}"
when: opn_install_check_mk

- name: enable check_mk_agent in /etc/inetd.conf
lineinfile:
ansible.builtin.lineinfile:
path: /etc/inetd.conf
line: "check_mk stream tcp nowait root {{ opn_check_mk_path }} {{ opn_check_mk_path | basename }}"
regexp: "^check_mk "
notify: service inetd
when: opn_install_check_mk

- name: add service to /etc/services
lineinfile:
ansible.builtin.lineinfile:
path: /etc/services
line: "check_mk {{ opn_check_mk_port }}/tcp #check_mk agent" # noqa no-tabs
regexp: "^check_mk "
notify: service inetd
when: opn_install_check_mk

- name: setup /etc/hosts.allow
lineinfile:
ansible.builtin.lineinfile:
path: /etc/hosts.allow
line: "check_mk : {{ checkmk_ip }} : allow" # noqa no-tabs
regexp: "^check_mk "
notify: service inetd
when: opn_install_check_mk

- name: debug ansible_local
debug:
ansible.builtin.debug:
var: ansible_local
verbosity: 1

- name: enable inetd
blockinfile:
ansible.builtin.blockinfile:
backup: true
path: /etc/rc.conf
block: |
Expand All @@ -87,7 +87,7 @@
notify: service inetd

- name: enable inetd
blockinfile:
ansible.builtin.blockinfile:
backup: true
path: /etc/rc.conf.d/inetd
create: true
Expand Down

0 comments on commit ffb281e

Please sign in to comment.