pvc-ansible/roles/pvc/tasks/zookeeper/main.yml

79 lines
1.8 KiB
YAML
Raw Permalink Normal View History

2023-09-01 15:42:19 -04:00
---
- name: install zookeeper packages
apt:
name:
- zookeeper
2023-09-01 15:42:19 -04:00
- zookeeper-bin
- zkcli
2023-09-01 15:42:19 -04:00
state: latest
2023-09-01 15:42:30 -04:00
register: apt_res
retries: 5
until: apt_res is success
2023-09-01 15:42:19 -04:00
- name: install zookeeper configuration
template:
src: zookeeper/{{ item }}.j2
dest: /etc/zookeeper/conf/{{ item }}
with_items:
- configuration.xsl
- environment
- log4j.properties
- myid
- zoo.cfg
notify: restart zookeeper
2023-12-10 12:39:35 -05:00
- name: install Prometheus zookeeper exporter if enabled
apt:
name:
- prometheus-zookeeper-exporter
register: apt_res
retries: 5
until: apt_res is success
when: enable_prometheus_exporters is defined and enable_prometheus_exporters
- name: install Prometheus zookeeper exporter config if enabled
template:
2023-12-28 11:36:27 -05:00
src: zookeeper/prometheus.env.j2
2023-12-10 12:39:35 -05:00
dest: /etc/default/prometheus-zookeeper-exporter
owner: prometheus
group: prometheus
mode: 0640
notify:
- restart prometheus-zookeeper
when: enable_prometheus_exporters is defined and enable_prometheus_exporters
2023-09-01 15:42:21 -04:00
- name: install daily vacuum script
template:
src: zookeeper/zookeeper-vacuum.j2
dest: /etc/cron.daily/zookeeper-vacuum
mode: 0755
2023-09-01 15:42:26 -04:00
- name: install check_mk agent check
template:
src: zookeeper/zk_status.j2
dest: /usr/lib/check_mk_agent/plugins/zk_status
mode: 0755
- name: install systemd unit file
template:
src: zookeeper/zookeeper.service.j2
dest: /etc/systemd/system/zookeeper.service
register: systemd
- name: reload systemd to apply changes
command: systemctl daemon-reload
when: systemd.changed
- name: start but disable services (managed by PVC)
2023-09-01 15:42:19 -04:00
service:
name: "{{ item }}"
2023-09-01 15:42:20 -04:00
state: started
enabled: no
2023-09-01 15:42:19 -04:00
with_items:
- zookeeper
2023-09-01 15:42:19 -04:00
- include: zookeeper/bootstrap.yml
when: do_bootstrap is defined and do_bootstrap
2023-09-01 15:42:19 -04:00
- meta: flush_handlers