ansible-role-zookeeper/tasks/config.yaml

66 lines
2.1 KiB
YAML

# 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
- /var/log/zookeeper
- 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