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
This commit is contained in:
Jesse Pretorius 2018-07-27 13:37:31 +01:00
parent 15f7775800
commit 682764493a
3 changed files with 7 additions and 28 deletions

View File

@ -11,4 +11,3 @@
designate_galera_password: "SuperSecretePassword1"
designate_service_password: "SuperSecretePassword3"
designate_oslomsg_rpc_password: "SuperSecretePassword4"
designate_oslomsg_notify_password: "SuperSecretePassword5"

View File

@ -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

View File

@ -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