Browse Source

Add install zookeeper role; use for nodepool-builder testing

This adds a simple role to install Zookeeper.

Add an option to nodepool-base to use this role to install Zookeeper.

Use this in the nodepool-builder gate testing where we are just
validating that the nodepool-builder container starts and is ready to
accept connections.  It needs a zookeeper to talk to, even though it
is not going to do anything.

Change-Id: I4ae89a51e454be4ee53ad4e04407162aaa8d9f9a
changes/08/710908/3
Ian Wienand 2 years ago
parent
commit
e7f1062d51
  1. 4
      playbooks/roles/install-zookeeper/README.rst
  2. 11
      playbooks/roles/install-zookeeper/tasks/main.yaml
  3. 7
      playbooks/roles/nodepool-base/README.rst
  4. 1
      playbooks/roles/nodepool-base/defaults/main.yaml
  5. 5
      playbooks/roles/nodepool-base/tasks/main.yaml
  6. 1
      playbooks/zuul/run-base.yaml
  7. 1
      playbooks/zuul/templates/host_vars/nb01-test.opendev.org.yaml.j2

4
playbooks/roles/install-zookeeper/README.rst

@ -0,0 +1,4 @@
An ansible role to install Zookeeper
**Role Variables**

11
playbooks/roles/install-zookeeper/tasks/main.yaml

@ -0,0 +1,11 @@
- name: Install zookeeper
package:
name:
- zookeeper
- zookeeperd
state: present
- name: Start zookeeper service
service:
name: zookeeper
state: started

7
playbooks/roles/nodepool-base/README.rst

@ -1,3 +1,10 @@
nodepool base setup
**Role Variables**
.. zuul:rolevar:: nodepool_base_install_zookeeper
Install zookeeper to the node. This is not expected to be used in
production, where the nodes would connect to an externally
configured zookeeper instance. It can be useful for basic loopback
tests in the gate, however.

1
playbooks/roles/nodepool-base/defaults/main.yaml

@ -0,0 +1 @@
nodepool_base_install_zookeeper: False

5
playbooks/roles/nodepool-base/tasks/main.yaml

@ -11,6 +11,11 @@
create_home: yes
shell: /bin/bash
- name: Install zookeeper
include_role:
name: install-zookeeper
when: nodepool_base_install_zookeeper
# NOTE(ianw) : A note on testing; we have some configurations for
# system-config-run-nodepool test hosts committed to project-config.
# Since this is a protected repo we can't speculatively test, which is

1
playbooks/zuul/run-base.yaml

@ -92,6 +92,7 @@
- host_vars/mirror-update01.opendev.org.yaml
- host_vars/backup-test01.opendev.org.yaml
- host_vars/backup-test02.opendev.org.yaml
- host_vars/nb01-test.opendev.org.yaml
- name: Display group membership
command: ansible localhost -m debug -a 'var=groups'
- name: Run base.yaml

1
playbooks/zuul/templates/host_vars/nb01-test.opendev.org.yaml.j2

@ -0,0 +1 @@
nodepool_base_install_zookeeper: True
Loading…
Cancel
Save