diff --git a/playbooks/roles/install-zookeeper/README.rst b/playbooks/roles/install-zookeeper/README.rst new file mode 100644 index 0000000000..32679cb981 --- /dev/null +++ b/playbooks/roles/install-zookeeper/README.rst @@ -0,0 +1,4 @@ +An ansible role to install Zookeeper + +**Role Variables** + diff --git a/playbooks/roles/install-zookeeper/tasks/main.yaml b/playbooks/roles/install-zookeeper/tasks/main.yaml new file mode 100644 index 0000000000..8373973487 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/playbooks/roles/nodepool-base/README.rst b/playbooks/roles/nodepool-base/README.rst index 0affcb4c94..d12b86e5e8 100644 --- a/playbooks/roles/nodepool-base/README.rst +++ b/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. diff --git a/playbooks/roles/nodepool-base/defaults/main.yaml b/playbooks/roles/nodepool-base/defaults/main.yaml new file mode 100644 index 0000000000..4f299f5df0 --- /dev/null +++ b/playbooks/roles/nodepool-base/defaults/main.yaml @@ -0,0 +1 @@ +nodepool_base_install_zookeeper: False \ No newline at end of file diff --git a/playbooks/roles/nodepool-base/tasks/main.yaml b/playbooks/roles/nodepool-base/tasks/main.yaml index 5704ecf034..df43052c00 100644 --- a/playbooks/roles/nodepool-base/tasks/main.yaml +++ b/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 diff --git a/playbooks/zuul/run-base.yaml b/playbooks/zuul/run-base.yaml index 3a8d553619..ff335289c1 100644 --- a/playbooks/zuul/run-base.yaml +++ b/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 diff --git a/playbooks/zuul/templates/host_vars/nb01-test.opendev.org.yaml.j2 b/playbooks/zuul/templates/host_vars/nb01-test.opendev.org.yaml.j2 new file mode 100644 index 0000000000..d2799c226a --- /dev/null +++ b/playbooks/zuul/templates/host_vars/nb01-test.opendev.org.yaml.j2 @@ -0,0 +1 @@ +nodepool_base_install_zookeeper: True \ No newline at end of file