Skip to content
Snippets Groups Projects
Commit 815dfe40 authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Add qdrouterd role for messaging infrastructure component"

parents 2f809c15 eeb535aa
No related branches found
No related tags found
No related merge requests found
Showing
with 304 additions and 0 deletions
......@@ -223,6 +223,8 @@ panko_api_port: "8977"
placement_api_port: "8780"
qdrouterd_port: "15676"
rabbitmq_port: "5672"
rabbitmq_management_port: "15672"
rabbitmq_cluster_port: "25672"
......@@ -376,6 +378,7 @@ enable_octavia: "no"
enable_openvswitch: "{{ neutron_plugin_agent != 'linuxbridge' | bool }}"
enable_osprofiler: "no"
enable_panko: "no"
enable_qdrouterd: "no"
enable_rally: "no"
enable_sahara: "no"
enable_searchlight: "no"
......@@ -421,6 +424,11 @@ rabbitmq_user: "openstack"
rabbitmq_version: "rabbitmq_server-3.6/plugins/rabbitmq_clusterer-3.6.x.ez/rabbitmq_clusterer-3.6.x-667f92b0/ebin"
outward_rabbitmq_user: "openstack"
####################
# Qdrouterd options
####################
qdrouterd_user: "openstack"
####################
# HAProxy options
####################
......
......@@ -80,6 +80,9 @@ control
[outward-rabbitmq:children]
control
[qdrouterd:children]
control
[mongodb:children]
control
......
......@@ -101,6 +101,9 @@ control
[outward-rabbitmq:children]
control
[qdrouterd:children]
control
[mongodb:children]
control
......
---
project_name: "qdrouterd"
qdrouterd_services:
qdrouterd:
container_name: qdrouterd
group: qdrouterd
enabled: true
image: "{{ qdrouterd_image_full }}"
volumes:
- "{{ node_config_directory }}/qdrouterd/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "qdrouterd:/var/lib/qdrouterd/"
- "kolla_logs:/var/log/kolla/"
####################
# Docker
####################
qdrouterd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-qdrouterd"
qdrouterd_tag: "{{ openstack_release }}"
qdrouterd_image_full: "{{ qdrouterd_image }}:{{ qdrouterd_tag }}"
---
- name: Restart qdrouterd container
vars:
service_name: "qdrouterd"
service: "{{ qdrouterd_services[service_name] }}"
config_json: "{{ qdrouterd_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
qdrouterd_container: "{{ check_qdrouterd_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
when:
- action != "config"
- inventory_hostname in groups[service.group]
- service.enabled | bool
- config_json.changed | bool
or qdrouterd_confs.changed | bool
or qdrouterd_sasl_confs.changed | bool
or qdrouterd_container.changed | bool
---
dependencies:
- { role: common }
---
- name: Wait for qdrouterd is up
wait_for:
host: "{{ api_interface_address }}"
port: "{{ qdrouterd_port }}"
connect_timeout: 1
state: started
when:
- action != "config"
- name: Create qdrouterd sasl user
shell: echo {{ qdrouterd_password }} | docker exec -u root -i qdrouterd saslpasswd2 -c -p -f /var/lib/qdrouterd/qdrouterd.sasldb -u AMQP {{ qdrouterd_user }}
run_once: true
changed_when: true
when:
- action != "config"
---
---
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item.key }}"
state: "directory"
recurse: yes
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ qdrouterd_services }}"
- name: Copying over config.json files for services
template:
src: "{{ item.key }}.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
register: qdrouterd_config_jsons
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ qdrouterd_services }}"
notify:
- Restart qdrouterd container
- name: Copying over qdrouterd config
vars:
service: "{{ qdrouterd_services['qdrouterd'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/qdrouterd/qdrouterd.conf"
register: qdrouterd_confs
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found:
- "{{ node_custom_config }}/qdrouterd/{{ inventory_hostname }}/qdrouterd.conf"
- "{{ node_custom_config }}/qdrouterd/qdrouterd.conf"
- "qdrouterd.conf.j2"
notify:
- Restart qdrouterd container
- name: Copying over qdrouterd sasl config
vars:
service: "{{ qdrouterd_services['qdrouterd'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/qdrouterd/qdrouterd-sasl.conf"
register: qdrouterd_sasl_confs
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_first_found:
- "{{ node_custom_config }}/qdrouterd/{{ inventory_hostname }}/qdrouterd-sasl.conf"
- "{{ node_custom_config }}/qdrouterd/qdrouterd-sasl.conf"
- "qdrouterd-sasl.conf.j2"
notify:
- Restart qdrouterd container
- name: Check qdrouterd containers
kolla_docker:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
register: check_qdrouterd_containers
when:
- action != "config"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ qdrouterd_services }}"
notify:
- Restart qdrouterd container
---
- include: config.yml
- name: Flush handlers
meta: flush_handlers
- include: add_sasl_user.yml
---
- include: "{{ action }}.yml"
---
- name: Get container facts
kolla_container_facts:
name:
- qdrouterd
register: container_facts
- name: Checking free port for Qdrouterd
wait_for:
host: "{{ api_interface_address }}"
port: "{{ qdrouterd_port }}"
connect_timeout: 1
timeout: 1
state: stopped
when:
- container_facts['qdrouterd'] is not defined
- inventory_hostname in groups['qdrouterd']
- name: Check if all qdrouterd hostnames are resolvable
command: "getent ahostsv4 {{ hostvars[item]['ansible_hostname'] }}"
changed_when: false
register: qdrouterd_hostnames
with_items: "{{ groups['qdrouterd'] }}"
- fail: msg="Hostname has to resolve to IP address of api_interface"
with_items: "{{ qdrouterd_hostnames.results }}"
when:
- "item.stdout.find(hostvars[item['item']]['ansible_' ~ hostvars[item['item']]['api_interface']]['ipv4']['address']) == -1"
---
- name: Pulling qdrouterd image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ qdrouterd_services }}"
---
- include: deploy.yml
---
- include: config.yml
- name: Flush handlers
meta: flush_handlers
pwcheck_method: auxprop
auxprop_plugin: sasldb
sasldb_path: /var/lib/qdrouterd/qdrouterd.sasldb
mech_list: ANONYMOUS PLAIN
router {
mode: standalone
id: Router.A
workerThreads: 4
saslConfigPath: /etc/sasl2
saslConfigName: qdrouterd
}
listener {
addr: {{ api_interface_address }}
port: {{ qdrouterd_port }}
role: normal
authenticatePeer: no
}
address {
prefix: unicast
distribution: closest
}
address {
prefix: exclusive
distribution: closest
}
address {
prefix: broadcast
distribution: multicast
}
address {
prefix: openstack.org/om/rpc/multicast
distribution: multicast
}
address {
prefix: openstack.org/om/rpc/unicast
distribution: closest
}
address {
prefix: openstack.org/om/rpc/anycast
distribution: balanced
}
address {
prefix: openstack.org/om/notify/multicast
distribution: multicast
}
address {
prefix: openstack.org/om/notify/unicast
distribution: closest
}
address {
prefix: openstack.org/om/notify/anycast
distribution: balanced
}
log {
module: DEFAULT
enable: info+
output: /var/log/kolla/qdrouterd/qdrouterd.log
}
{
"command": "/usr/sbin/qdrouterd",
"config_files": [
{
"source": "{{ container_config_directory }}/qdrouterd.conf",
"dest": "/etc/qpid-dispatch/qdrouterd.conf",
"owner": "qdrouterd",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/qdrouterd-sasl.conf",
"dest": "/etc/sasl2/qdrouterd.conf",
"owner": "qdrouterd",
"perm": "0600"
}
],
"permissions": [
{
"path": "/var/lib/qdrouterd",
"owner": "qdrouterd:qdrouterd",
"recurse": true
},
{
"path": "/var/log/kolla/qdrouterd",
"owner": "qdrouterd:qdrouterd",
"recurse": true
}
]
}
......@@ -192,6 +192,15 @@
role_rabbitmq_user: '{{ outward_rabbitmq_user }}',
when: enable_outward_rabbitmq | bool }
- name: Apply role qdrouterd
gather_facts: false
hosts: qdrouterd
serial: '{{ serial|default("0") }}'
roles:
- { role: qdrouterd,
tags: qdrouterd,
when: enable_qdrouterd | bool }
- name: Apply role etcd
gather_facts: false
hosts: etcd
......
......@@ -187,6 +187,7 @@ kolla_internal_vip_address: "10.10.10.254"
#enable_openvswitch: "{{ neutron_plugin_agent != 'linuxbridge' }}"
#enable_osprofiler: "no"
#enable_panko: "no"
#enable_qdrouterd: "no"
#enable_rally: "no"
#enable_sahara: "no"
#enable_searchlight: "no"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment