From 682764493a443fd7196422b22888f9ea624a3720 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 27 Jul 2018 13:37:31 +0100 Subject: [PATCH] Remove unnecessary MQ vhost/user creation tasks/vars 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 and tasks which were duplicated as they are no longer required. Change-Id: I7209861cd0b285ce1d641f68d2e97505cd3b1fb8 --- examples/playbook.yml | 1 - tests/os_designate-overrides.yml | 12 ------------ tests/test-install-designate.yml | 22 +++++++--------------- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/examples/playbook.yml b/examples/playbook.yml index 8e78387..ceb6159 100644 --- a/examples/playbook.yml +++ b/examples/playbook.yml @@ -11,4 +11,3 @@ designate_galera_password: "SuperSecretePassword1" designate_service_password: "SuperSecretePassword3" designate_oslomsg_rpc_password: "SuperSecretePassword4" - designate_oslomsg_notify_password: "SuperSecretePassword5" diff --git a/tests/os_designate-overrides.yml b/tests/os_designate-overrides.yml index 64fe596..efbadab 100644 --- a/tests/os_designate-overrides.yml +++ b/tests/os_designate-overrides.yml @@ -14,22 +14,10 @@ # limitations under the License. -designate_venv_tag: "testing" designate_developer_mode: true designate_service_password: "secrete" designate_galera_password: "SuperSecrete" designate_oslomsg_rpc_password: "secrete" -designate_oslomsg_rpc_userid: designate-rpc -designate_oslomsg_rpc_vhost: /designate -designate_oslomsg_rpc_servers: "{{ oslomsg_rpc_servers }}" -designate_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl }}" -designate_oslomsg_rpc_port: "{{ oslomsg_rpc_port }}" -designate_oslomsg_notify_password: "secrete" -designate_oslomsg_notify_userid: designate-notify -designate_oslomsg_notify_vhost: /designate -designate_oslomsg_notify_servers: "{{ oslomsg_notify_servers }}" -designate_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl }}" -designate_oslomsg_notify_port: "{{ oslomsg_notify_port }}" designate_pools_yaml: - name: "default" description: Default BIND9 Pool diff --git a/tests/test-install-designate.yml b/tests/test-install-designate.yml index 7578ee0..d615746 100644 --- a/tests/test-install-designate.yml +++ b/tests/test-install-designate.yml @@ -17,15 +17,14 @@ hosts: designate_all remote_user: root gather_facts: true + vars: + named_config_file: "{{ (ansible_pkg_mgr == 'apt') | ternary('/etc/bind/named.conf.options','/etc/named.conf') }}" + bind_package_name: "{{ (ansible_pkg_mgr == 'apt') | ternary('bind9','bind') }}" + bind_service_name: "{{ (ansible_pkg_mgr == 'apt') | ternary('bind9','named') }}" + bind_service_state: "{{ (ansible_pkg_mgr == 'apt') | ternary('restarted','started') }}" + vars_files: + - common/test-vars.yml pre_tasks: - - include: common/ensure-oslomsg.yml - rpc_vhost: "{{ designate_oslomsg_rpc_vhost }}" - rpc_user: "{{ designate_oslomsg_rpc_userid }}" - rpc_password: "{{ designate_oslomsg_rpc_password }}" - notify_vhost: "{{ designate_oslomsg_notify_vhost }}" - notify_user: "{{ designate_oslomsg_notify_userid }}" - notify_password: "{{ designate_oslomsg_notify_password }}" - - name: Install bind9 package: name: "{{ bind_package_name }}" @@ -50,11 +49,6 @@ service: name: "{{ bind_service_name }}" state: "{{ bind_service_state }}" - vars: - named_config_file: "{{ (ansible_pkg_mgr == 'apt') | ternary('/etc/bind/named.conf.options','/etc/named.conf') }}" - bind_package_name: "{{ (ansible_pkg_mgr == 'apt') | ternary('bind9','bind') }}" - bind_service_name: "{{ (ansible_pkg_mgr == 'apt') | ternary('bind9','named') }}" - bind_service_state: "{{ (ansible_pkg_mgr == 'apt') | ternary('restarted','started') }}" roles: - role: "os_designate" post_tasks: @@ -62,5 +56,3 @@ service: name: "{{ bind_service_name }}" state: restarted - vars_files: - - common/test-vars.yml