feat: initial commit
This commit is contained in:
commit
29bec6f965
17 changed files with 343 additions and 0 deletions
21
tasks/config.yaml
Normal file
21
tasks/config.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
|
||||
# configure psk
|
||||
- name: "configure psk"
|
||||
ansible.builtin.template:
|
||||
src: "templates/zabbix/zabbix_proxy.psk.j2"
|
||||
dest: "/etc/zabbix/zabbix_proxy.psk"
|
||||
owner: "zabbix"
|
||||
group: "zabbix"
|
||||
mode: "0640"
|
||||
notify: "restart zabbix-proxy"
|
||||
|
||||
# config proxy
|
||||
- name: "configure zabbix-proxy"
|
||||
ansible.builtin.template:
|
||||
src: "templates/zabbix/zabbix_proxy.conf.j2"
|
||||
dest: "/etc/zabbix/zabbix_proxy.conf"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0664"
|
||||
notify: "restart zabbix-proxy"
|
||||
34
tasks/install.yaml
Normal file
34
tasks/install.yaml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
|
||||
# install zabbix-server
|
||||
- name: "install zabbix-server"
|
||||
when: "zabbix_major_version not in zabbix_current_version.stdout"
|
||||
block:
|
||||
|
||||
# install repository - debian
|
||||
- name: "install repository"
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
block:
|
||||
|
||||
# remove old proxy
|
||||
- name: "remove old proxy"
|
||||
ansible.builtin.apt:
|
||||
name: "zabbix-proxy"
|
||||
state: "absent"
|
||||
loop:
|
||||
- "zabbix-proxy"
|
||||
|
||||
# install zabbix proxy
|
||||
- name: "install zabbix-proxy"
|
||||
ansible.builtin.apt:
|
||||
name: "zabbix-proxy-sqlite3"
|
||||
state: "present"
|
||||
update_cache: true
|
||||
|
||||
# create zabbix db directory
|
||||
- name: "create zabbix db directory"
|
||||
ansible.builtin.file:
|
||||
path: "/usr/lib/zabbix/proxy/"
|
||||
state: "directory"
|
||||
owner: "zabbix"
|
||||
group: "zabbix"
|
||||
28
tasks/main.yaml
Normal file
28
tasks/main.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
|
||||
# load variables and collect version information
|
||||
- name: "include vars and collect versions"
|
||||
block:
|
||||
|
||||
# collect zabbix-proxy version information
|
||||
- name: "collect version information"
|
||||
ansible.builtin.shell:
|
||||
cmd: "zabbix_proxy --version | head -n 1"
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
ignore_errors: true
|
||||
register: "zabbix_current_version"
|
||||
|
||||
|
||||
# zabbix-proxy install
|
||||
- name: "zabbix-proxy install"
|
||||
ansible.builtin.import_tasks: "install.yaml"
|
||||
tags:
|
||||
- "zabbix_proxy_install"
|
||||
|
||||
|
||||
# zabbix-proxy config
|
||||
- name: "zabbix-proxy config"
|
||||
ansible.builtin.import_tasks: "config.yaml"
|
||||
tags:
|
||||
- "zabbix_proxy_config"
|
||||
Loading…
Add table
Add a link
Reference in a new issue