FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 881e78cd authored by Dr Rich Wareham's avatar Dr Rich Wareham
Browse files

Merge branch 'match-usvc-zookeeper-role' into 'master'

Update zookeeper role to match recent changes to usvc-deploy

See merge request !26
parents 0696e41e ae0d11cc
No related branches found
No related tags found
1 merge request!26Update zookeeper role to match recent changes to usvc-deploy
Pipeline #1525 passed
# Role: zookeeper
This role installs the apache zookeeper service to a docker swarm cluster. Provides data synchronisation services to other
This role installs the apache zookeeper service to a docker swarm cluster. Provides data synchronisation services to other
services distributed on the swarm cluster (eg. traefik).
## Dependencies
......@@ -11,7 +11,7 @@ services distributed on the swarm cluster (eg. traefik).
- `zookeeper_root`
A path to the root where zookeeper stores it's data.
A path to the root where zookeeper stores it's data.
## Role Variables
......@@ -26,5 +26,5 @@ eg
roles:
- role: zookeeper
vars:
zookeeper_root: "/var/zookeeper"
zookeeper_root: "/var/lib/zookeeper"
```
......@@ -2,6 +2,9 @@
# Zookeeper image to deploy
zookeeper_image: "zookeeper:3.4"
# Root for persistent data used by zookeeper
zookeeper_root: "/var/lib/zookeeper"
# Zookeeper persistent data volume locations
zookeeper_data_dir: "{{ zookeeper_root }}/data"
zookeeper_datalog_dir: "{{ zookeeper_root }}/datalog"
......
......@@ -40,24 +40,3 @@
file:
state: directory
path: "{{ zookeeper_datalog_dir }}"
# Actually deploy the zookeper service.
- name: Deploy Zookeeper service
docker_swarm_service:
name: zookeeper
networks:
- "{{ zookeeper_network_name }}"
image: "{{ zookeeper_image }}"
mounts:
- source: "{{ zookeeper_data_dir }}"
target: /data
type: bind
- source: "{{ zookeeper_datalog_dir }}"
target: /datalog
type: bind
restart_policy: any
restart_policy_attempts: 5
restart_policy_window: 30
---
# Actually deploy the zookeper service.
- name: Deploy Zookeeper service
docker_swarm_service:
name: zookeeper
networks:
- "{{ zookeeper_network_name }}"
image: "{{ zookeeper_image }}"
mounts:
- source: "{{ zookeeper_data_dir }}"
target: /data
type: bind
- source: "{{ zookeeper_datalog_dir }}"
target: /datalog
type: bind
restart_policy: any
restart_policy_attempts: 5
restart_policy_window: 30
# Add a simple zookeeper instance to the swarm
#
# Deployment tasks in the file deploy.yml are all run with run_once: true
#
# Zookeeper is only used by traefik and even then it is only used to store ACME
# certificate information. It is, therefore, quite a small service and need not
# be replicated as long as the data it stores is persistent.
---
- import_tasks: configure.yml
# Configure nodes to be able to run zookeeper
- include: configure.yml
tags: zookeeper
# Deploy zookeeper
- include: deploy.yml
run_once: true
tags:
- zookeeper
tags: zookeeper
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment