Ansible role to manage Zookeeper
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.3 KiB

# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Define zookeeper_file_myid_dest
set_fact:
zookeeper_file_myid_dest: "{{ __zookeeper_file_myid_dest }}"
when: zookeeper_file_myid_dest is not defined
- name: Define zookeeper_file_myid_src
set_fact:
zookeeper_file_myid_src: "{{ __zookeeper_file_myid_src }}"
when: zookeeper_file_myid_src is not defined
- name: Define zookeeper_file_zoo_conf_dest
set_fact:
zookeeper_file_zoo_conf_dest: "{{ __zookeeper_file_zoo_conf_dest }}"
when: zookeeper_file_zoo_conf_dest is not defined
- name: Define zookeeper_file_zoo_conf_src
set_fact:
zookeeper_file_zoo_conf_src: "{{ __zookeeper_file_zoo_conf_src }}"
when: zookeeper_file_zoo_conf_src is not defined
- name: Create required directories
become: true
file:
group: "{{ zookeeper_user_group }}"
owner: "{{ zookeeper_user_name }}"
path: "{{ item }}"
state: directory
with_items:
- /etc/zookeeper
- /etc/zookeeper/conf
- /etc/zookeeper/ca
- /etc/zookeeper/ca/certs
- /etc/zookeeper/ca/keystores
- /var/log/zookeeper
- name: Install zookeeper log4j.properties
become: yes
template:
dest: "{{ zookeeper_file_log4j_properties_dest }}"
group: "{{ zookeeper_file_log4j_properties_group }}"
mode: "{{ zookeeper_file_log4j_properties_mode }}"
owner: "{{ zookeeper_file_log4j_properties_owner }}"
src: "{{ zookeeper_file_log4j_properties_src }}"
register: zookeeper_file_log4j_properties
- name: Install zookeeper ssl truststore configuration
become: true
template:
dest: "{{ zookeeper_file_ssl_truststore_dest }}"
group: "{{ zookeeper_file_ssl_truststore_group }}"
mode: "{{ zookeeper_file_ssl_truststore_mode }}"
owner: "{{ zookeeper_file_ssl_truststore_owner }}"
src: "{{ zookeeper_file_ssl_truststore_src }}"
register: zookeeper_file_ssl_truststore
- name: Install zookeeper ssl keystore configuration
become: true
template:
dest: "{{ zookeeper_file_ssl_keystore_dest }}"
group: "{{ zookeeper_file_ssl_keystore_group }}"
mode: "{{ zookeeper_file_ssl_keystore_mode }}"
owner: "{{ zookeeper_file_ssl_keystore_owner }}"
src: "{{ zookeeper_file_ssl_keystore_src }}"
register: zookeeper_file_ssl_keystore
- name: Install zookeeper myid
become: yes
template:
dest: "{{ zookeeper_file_myid_dest }}"
group: "{{ zookeeper_file_myid_group }}"
mode: "{{ zookeeper_file_myid_mode }}"
owner: "{{ zookeeper_file_myid_owner }}"
src: "{{ zookeeper_file_myid_src }}"
register: zookeeper_file_myid
- name: Install zookeeper configuration
become: yes
template:
dest: "{{ zookeeper_file_zoo_conf_dest }}"
group: "{{ zookeeper_file_zoo_conf_group }}"
mode: "{{ zookeeper_file_zoo_conf_mode }}"
owner: "{{ zookeeper_file_zoo_conf_owner }}"
src: "{{ zookeeper_file_zoo_conf_src }}"
register: zookeeper_file_zoo_conf