zuul-jobs/roles/ensure-zookeeper/tasks/main.yaml
James E. Blair 5a83a49dac ensure-zookeeper: eliminate the tmpfs size limit
Zuul's use of this role has exceeded the 500M cap.  Let's go ahead
and remove it since it's arbitrary anyway, and Zuul is likely the
primary user of the role.

Change-Id: Ib0bc72f6c909e44bc04af7a8fbe40ef8415addcf
2021-10-22 15:32:03 -07:00

71 lines
1.7 KiB
YAML

- name: Install distro-specific packages
include_tasks: "{{ zj_distro_os }}"
with_first_found:
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
loop_control:
loop_var: zj_distro_os
- name: Create /tmp/zookeeper
file:
path: /tmp/zookeeper
state: directory
mode: 0755
become: true
- name: Get and extract Zookeeper
unarchive:
src: https://archive.apache.org/dist/zookeeper/zookeeper-{{ _zookeeper_install_version }}/apache-zookeeper-{{ _zookeeper_install_version }}-bin.tar.gz
dest: /tmp/zookeeper
remote_src: yes
become: true
- name: Link install to a known location
file:
src: /tmp/zookeeper/apache-zookeeper-{{ _zookeeper_install_version }}-bin
dest: /opt/zookeeper
state: link
become: true
- name: Create a tmpfs for ZooKeeper
mount:
state: mounted
path: /tmp/zookeeper/version-2
fstype: tmpfs
opts: "nodev,nosuid"
src: "none"
when: zookeeper_use_tmpfs
become: true
- name: Setup Zookeeper config file
copy:
src: /opt/zookeeper/conf/zoo_sample.cfg
dest: /opt/zookeeper/conf/zoo.cfg
remote_src: true
mode: 0644
become: true
- name: Enable ZooKeeper 4lw
lineinfile:
path: /opt/zookeeper/conf/zoo.cfg
line: "4lw.commands.whitelist=*"
become: true
- name: Setup ZooKeeper TLS
include_tasks: ./setup_tls.yaml
when: zookeeper_use_tls
- name: Ensure Zookeeper not running
command: pkill -f zookeeper
register: _pkill
# 0 is killed
# 1 is no process matched
# >1 is some sort of actual error
failed_when: _pkill.rc > 1
become: true
- name: Start Zookeeper
command: /opt/zookeeper/bin/zkServer.sh start
become: true