From 12ef3cbbadb638e363a73f3c269b3138de740ef0 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Wed, 30 Aug 2017 14:06:16 +0000 Subject: [PATCH] Correct rabbitmq port usage Several messages where we had a hard coded wait for a hard coded port, for rabbitmq, were present. Replaced all but one of the instances with variable usage, the remainder I added a TODO as more refactoring of that file is required and it should be done at the same time. Change-Id: I5019424c79763254854fdaace3da2753a05cd94f --- playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml | 4 ++++ playbooks/roles/bifrost-keystone-install/README.md | 1 + playbooks/roles/bifrost-keystone-install/defaults/main.yml | 2 +- playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml index 7752d2e58..4bad7f1e8 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml @@ -54,10 +54,14 @@ when: ansible_os_family == 'Suse' - name: "Start rabbitmq-server" service: name=rabbitmq-server state=started enabled=yes + # NOTE(cinerama): on some systems, rabbit may not be ready when we want to # make changes to users if we don't wait first +# TODO(TheJulia): This needs to be changed to a variable, however +# should update this playbook all at once with new variable structures. - name: "Wait for rabbitmq" wait_for: port=5672 delay=5 + - name: "Ensure guest user is removed from rabbitmq" rabbitmq_user: user: "guest" diff --git a/playbooks/roles/bifrost-keystone-install/README.md b/playbooks/roles/bifrost-keystone-install/README.md index 641fc0359..efb4a3838 100644 --- a/playbooks/roles/bifrost-keystone-install/README.md +++ b/playbooks/roles/bifrost-keystone-install/README.md @@ -64,6 +64,7 @@ Below is the full data structure. username: keystone password: ChangeThisPa55w0rd host: 127.0.0.1 + port: 5672 database: name: keystone username: keystone diff --git a/playbooks/roles/bifrost-keystone-install/defaults/main.yml b/playbooks/roles/bifrost-keystone-install/defaults/main.yml index c508297dd..9977f6a2b 100644 --- a/playbooks/roles/bifrost-keystone-install/defaults/main.yml +++ b/playbooks/roles/bifrost-keystone-install/defaults/main.yml @@ -54,9 +54,9 @@ keystone: username: keystone password: ChangeThisPa55w0rd host: localhost + port: 5672 database: name: keystone username: keystone password: ChangeThisPa55w0rd host: localhost - diff --git a/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml index e014c04fe..f9e6bfaa3 100644 --- a/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml @@ -39,7 +39,7 @@ # NOTE(cinerama): on some systems, rabbit may not be ready when we want to # make changes to users if we don't wait first - name: "Wait for rabbitmq" - wait_for: port=5672 delay=5 + wait_for: port="{{ keystone.message_queue.port | default('5672') }}" delay=5 - name: "Ensure guest user is removed from rabbitmq" rabbitmq_user: