From 379b24dc8da5a64df51ee6b339b9e80a7b9f3389 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 15 May 2018 09:38:23 +0100 Subject: [PATCH] Move MQ vhost/user creation into role (glance) There is no record for why we implement the MQ vhost/user creation outside of the role in the playbook, when we could do it inside the role. Implementing it inside the role allows us to reduce the quantity of group_vars duplicated from the role, and allows us to better document the required variables in the role. The delegation can still be done as it is done in the playbook too. In this patch we remove the test-vars which were duplicated from the role, and remove the MQ setup tasks as they are no longer required. We also remove the usage of a variable for the role name as that is unnecessary legacy. Depends-On: https://review.openstack.org/568517 Change-Id: I516e65e3b49f1722636d69f80c1bddc01c942a48 --- test-install-glance.yml | 22 +--------------------- test-vars.yml | 18 ------------------ 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/test-install-glance.yml b/test-install-glance.yml index a8da3c76..fed640a5 100644 --- a/test-install-glance.yml +++ b/test-install-glance.yml @@ -19,27 +19,7 @@ become: true gather_facts: true any_errors_fatal: true - pre_tasks: - - include: ensure-rabbitmq.yml - vhost_name: "{{ glance_rabbitmq_vhost }}" - user_name: "{{ glance_rabbitmq_userid }}" - user_password: "{{ glance_rabbitmq_password }}" - when: - - "'rabbitmq_all' in groups" - - "groups['rabbitmq_all'] | length > 0" - - "'oslomsg_rpc_all' not in groups" - - - include: ensure-oslomsg.yml - rpc_vhost: "{{ glance_oslomsg_rpc_vhost }}" - rpc_user: "{{ glance_oslomsg_rpc_userid }}" - rpc_password: "{{ glance_oslomsg_rpc_password }}" - notify_vhost: "{{ glance_oslomsg_notify_vhost }}" - notify_user: "{{ glance_oslomsg_notify_userid }}" - notify_password: "{{ glance_oslomsg_notify_password }}" - when: - - "'oslomsg_rpc_all' in groups" - - "groups['oslomsg_rpc_all'] | length > 0" roles: - - role: "{{ glance_rolename | default('os_glance') }}" + - role: "os_glance" vars_files: - test-vars.yml diff --git a/test-vars.yml b/test-vars.yml index 47f37b30..fb841573 100644 --- a/test-vars.yml +++ b/test-vars.yml @@ -171,25 +171,7 @@ glance_developer_mode: true glance_git_install_branch: "{{ test_branch }}" glance_profiler_hmac_key: "secrete" glance_oslomsg_rpc_password: "{{ oslomsg_rpc_password }}" -glance_oslomsg_rpc_userid: glance -glance_oslomsg_rpc_vhost: /glance -glance_oslomsg_rpc_transport: "{{ oslomsg_rpc_transport }}" -glance_oslomsg_rpc_port: "{{ oslomsg_rpc_port }}" -glance_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers }}" -glance_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl }}" glance_oslomsg_notify_password: "{{ oslomsg_notify_password }}" -glance_oslomsg_notify_userid: glance -glance_oslomsg_notify_vhost: /glance -glance_oslomsg_notify_transport: "{{ oslomsg_notify_transport }}" -glance_oslomsg_notify_port: "{{ oslomsg_notify_port }}" -glance_oslomsg_notify_servers: "{{ oslomsg_notify_servers }}" -glance_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl }}" -glance_rabbitmq_password: "{{ rabbitmq_password }}" -glance_rabbitmq_port: "{{ rabbitmq_port }}" -glance_rabbitmq_servers: "{{ rabbitmq_servers }}" -glance_rabbitmq_userid: glance -glance_rabbitmq_vhost: /glance -glance_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" glance_service_password: "secrete" glance_venv_tag: "testing" glance_host: "{{ test_glance_host }}"