hadoop-ansible/roles/hadoop_zookeeper_server_config/tasks/main.yml

59 lines
1.7 KiB
YAML

---
- name: Create the /var/lib/zookeeper/version-2 directory, owner must be zookeeper
file: path=/var/lib/zookeeper/version-2 owner=zookeeper group=zookeeper state=directory
tags:
- zookeeper
- configuration
- name: Create the /var/log/zookeeper/txlog directory, owner must be zookeeper
file: path=/var/log/zookeeper/txlog owner=zookeeper group=zookeeper state=directory
tags:
- zookeeper
- configuration
- name: create the /var/lib/zookeeper directory
file: path=/var/lib/zookeeper owner=zookeeper group=zookeeper state=directory
tags:
- zookeeper
- configuration
- name: initialize ZooKeeper
command: creates=/var/lib/zookeeper/myid service zookeeper-server init --myid={{ zoo_id }}
tags:
- zookeeper
- configuration
- name: log4j configuration for zookeeper
template: src=log4j.properties.j2 dest={{ zookeeper_conf_dir }}/log4j.properties
notify:
- Restart ZooKeeper
tags:
- zookeeper
- log4j
- configuration
- name: Create the /etc/zookeeper-jmx/conf directory
file: dest=/etc/zookeeper-jmx/conf state=directory owner=root group=zookeeper mode=0750
when: hadoop_jmx_enabled
tags:
- zookeeper
- configuration
- name: Distribute the jmx authorization files for zookeeper jmx
template: src=templates/jmxremote.passwd.j2 dest=/etc/zookeeper-jmx/conf/jmxremote.passwd owner=zookeeper mode=0400
when: hadoop_jmx_enabled
notify:
- Restart ZooKeeper
tags:
- zookeeper
- configuration
- name: Distribute the jmx role files for zookeeper jmx
copy: src=files/jmxremote.access dest=/etc/zookeeper-jmx/conf/jmxremote.access owner=root mode=0440
when: hadoop_jmx_enabled
notify:
- Restart ZooKeeper
tags:
- zookeeper
- configuration