From 33564a0097e3ebe7dd6d947611cb3ef7eb662531 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 9 Apr 2019 15:22:35 +0100 Subject: [PATCH] Remove RabbitMQ support from Bifrost During the Train cycle, Bifrost switched to using JSON-RPC by default for Ironic's internal communication [1], avoiding the need to install RabbitMQ. This simplifies things, so we may as well remove our custom configuration of RabbitMQ. [1] https://review.openstack.org/645093 Change-Id: I3107349530aa753d68fd59baaf13eb7dd5485ae6 --- ansible/roles/bifrost/tasks/bootstrap.yml | 4 +--- ansible/roles/bifrost/tasks/config.yml | 23 ------------------- ansible/roles/bifrost/tasks/start.yml | 1 - .../roles/bifrost/templates/rabbitmq-env.conf | 15 ------------ .../bifrost-no-rabbit-cea7af663f4b814f.yaml | 7 ++++++ tests/test-bifrost.sh | 8 +++---- 6 files changed, 12 insertions(+), 46 deletions(-) delete mode 100644 ansible/roles/bifrost/templates/rabbitmq-env.conf create mode 100644 releasenotes/notes/bifrost-no-rabbit-cea7af663f4b814f.yaml diff --git a/ansible/roles/bifrost/tasks/bootstrap.yml b/ansible/roles/bifrost/tasks/bootstrap.yml index ce3b6f29fb..697588ec59 100644 --- a/ansible/roles/bifrost/tasks/bootstrap.yml +++ b/ansible/roles/bifrost/tasks/bootstrap.yml @@ -15,9 +15,7 @@ - name: Bootstrap bifrost (this may take several minutes) command: > docker exec bifrost_deploy - bash -c 'source /bifrost/env-vars - && cp /etc/bifrost/rabbitmq-env.conf /etc/rabbitmq/rabbitmq-env.conf && - chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq-env.conf && + bash -c 'source /bifrost/env-vars && ansible-playbook -vvvv -i /bifrost/playbooks/inventory/target /bifrost/playbooks/install.yaml -e @/etc/bifrost/bifrost.yml -e @/etc/bifrost/dib.yml -e skip_package_install=true' diff --git a/ansible/roles/bifrost/tasks/config.yml b/ansible/roles/bifrost/tasks/config.yml index a3dd50569b..3ca431bfea 100644 --- a/ansible/roles/bifrost/tasks/config.yml +++ b/ansible/roles/bifrost/tasks/config.yml @@ -24,15 +24,6 @@ - "dib" - "servers" -- name: Copying over rabbitmq config - template: - src: "{{ item }}" - dest: "{{ node_config_directory }}/bifrost/{{ item }}" - mode: "0660" - become: true - with_items: - - "rabbitmq-env.conf" - - name: Template ssh keys template: src: "{{ item.src }}" @@ -43,17 +34,3 @@ - { src: "id_rsa", dest: "id_rsa" } - { src: "id_rsa.pub", dest: "id_rsa.pub" } - { src: "ssh_config", dest: "ssh_config" } - -# NOTE(mgoddard): The following task was lifted from a Bifrost play -# (playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml). Because -# Bifrost cannot modify /etc/hosts from within the container we must do it -# here. -- name: "Ensure /etc/hosts has good defaults" - lineinfile: - dest: "/etc/hosts" - regexp: "{{ item.regexp }}.*({{ ansible_hostname }}|localhost).*" - line: "{{ item.contents }}" - with_items: - - { regexp: '^127\.0\.0\.1', contents: '127.0.0.1 {{ ansible_hostname }} {{ ansible_fqdn }} localhost' } - - { regexp: '^::1', contents: '::1 {{ ansible_hostname }} {{ ansible_fqdn }} localhost ipv6-localhost ipv6-loopback' } - become: true diff --git a/ansible/roles/bifrost/tasks/start.yml b/ansible/roles/bifrost/tasks/start.yml index d74d0095a2..d9cd1d0a44 100644 --- a/ansible/roles/bifrost/tasks/start.yml +++ b/ansible/roles/bifrost/tasks/start.yml @@ -15,5 +15,4 @@ - "bifrost_httpboot:/httpboot/" - "bifrost_ironic:/var/lib/ironic/" - "bifrost_mariadb:/var/lib/mysql/" - - "bifrost_rabbitmq:/var/lib/rabbitmq/" - "bifrost_tftpboot:/tftpboot/" diff --git a/ansible/roles/bifrost/templates/rabbitmq-env.conf b/ansible/roles/bifrost/templates/rabbitmq-env.conf deleted file mode 100644 index 08a56e5b6e..0000000000 --- a/ansible/roles/bifrost/templates/rabbitmq-env.conf +++ /dev/null @@ -1,15 +0,0 @@ -# Defaults to rabbit. This can be useful if you want to run more than one node -# per machine - RABBITMQ_NODENAME should be unique per erlang-node-and-machine -# combination. See the clustering on a single machine guide for details: -# http://www.rabbitmq.com/clustering.html#single-machine -#NODENAME=rabbit - -# By default RabbitMQ will bind to all interfaces, on IPv4 and IPv6 if -# available. Set this if you only want to bind to one network interface or# -# address family. -#NODE_IP_ADDRESS=127.0.0.1 - -HOME=/var/lib/rabbitmq - -# Defaults to 5672. -#NODE_PORT=5672 diff --git a/releasenotes/notes/bifrost-no-rabbit-cea7af663f4b814f.yaml b/releasenotes/notes/bifrost-no-rabbit-cea7af663f4b814f.yaml new file mode 100644 index 0000000000..5e429436ea --- /dev/null +++ b/releasenotes/notes/bifrost-no-rabbit-cea7af663f4b814f.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Removes support for RabbitMQ from the Bifrost container. During the Train + cycle, Bifrost switched its default to use JSON-RPC rather than RabbitMQ + for internal Ironic communication. This simplifies the deployment and + should improve reliability. diff --git a/tests/test-bifrost.sh b/tests/test-bifrost.sh index 94c71f482f..93ce197946 100755 --- a/tests/test-bifrost.sh +++ b/tests/test-bifrost.sh @@ -12,7 +12,7 @@ function test_bifrost { # TODO(mgoddard): Use openstackclient when clouds.yaml works. See # https://bugs.launchpad.net/bifrost/+bug/1754070. attempts=0 - while [[ $(sudo docker exec bifrost_deploy bash -c "source env-vars && ironic driver-list" | wc -l) -le 4 ]]; do + while [[ $(sudo docker exec bifrost_deploy bash -c "OS_CLOUD=bifrost openstack baremetal driver list -f value" | wc -l) -eq 0 ]]; do attempts=$((attempts + 1)) if [[ $attempts -gt 6 ]]; then echo "Timed out waiting for ironic conductor to become active" @@ -20,9 +20,9 @@ function test_bifrost { fi sleep 10 done - sudo docker exec bifrost_deploy bash -c "source env-vars && ironic node-list" - sudo docker exec bifrost_deploy bash -c "source env-vars && ironic node-create --driver ipmi --name test-node" - sudo docker exec bifrost_deploy bash -c "source env-vars && ironic node-delete test-node" + sudo docker exec bifrost_deploy bash -c "OS_CLOUD=bifrost openstack baremetal node list" + sudo docker exec bifrost_deploy bash -c "OS_CLOUD=bifrost openstack baremetal node create --driver ipmi --name test-node" + sudo docker exec bifrost_deploy bash -c "OS_CLOUD=bifrost openstack baremetal node delete test-node" }