Add neutron-bgp-dragent playbooks and sensible defaults.

Depends-On: If7f5c80eb10a1c418785d9c659ae18bfecfcfe33
Change-Id: I9c54f01193b4e12338e71cd1f0a4635dcbfa43fe
Implements: blueprint neutron-bgp-dragent
This commit is contained in:
Thomas O'Neill 2017-03-07 16:39:59 +00:00
parent 181c331174
commit 94dec80705
10 changed files with 121 additions and 0 deletions

View File

@ -344,6 +344,7 @@ enable_neutron_lbaas: "no"
enable_neutron_fwaas: "no" enable_neutron_fwaas: "no"
enable_neutron_qos: "no" enable_neutron_qos: "no"
enable_neutron_agent_ha: "no" enable_neutron_agent_ha: "no"
enable_neutron_bgp_dragent: "no"
enable_nova_serialconsole_proxy: "no" enable_nova_serialconsole_proxy: "no"
enable_octavia: "no" enable_octavia: "no"
enable_panko: "no" enable_panko: "no"
@ -473,6 +474,13 @@ cloudkitty_collector_backend: "ceilometer"
designate_backend: "bind9" designate_backend: "bind9"
designate_ns_record: "sample.openstack.org" designate_ns_record: "sample.openstack.org"
#######################
# Neutron options
#######################
neutron_bgp_router_id: "1.1.1.1"
####################### #######################
# Nova options # Nova options
####################### #######################

View File

@ -236,6 +236,9 @@ neutron
[neutron-vpnaas-agent:children] [neutron-vpnaas-agent:children]
neutron neutron
[neutron-bgp-dragent:children]
neutron
# Ceph # Ceph
[ceph-mon:children] [ceph-mon:children]
ceph ceph

View File

@ -253,6 +253,9 @@ neutron
[neutron-vpnaas-agent:children] [neutron-vpnaas-agent:children]
neutron neutron
[neutron-bgp-dragent:children]
neutron
# Ceph # Ceph
[ceph-mon:children] [ceph-mon:children]
ceph ceph

View File

@ -212,6 +212,21 @@ neutron_services:
- "/lib/modules:/lib/modules:ro" - "/lib/modules:/lib/modules:ro"
- "neutron_metadata_socket:/var/lib/neutron/kolla/" - "neutron_metadata_socket:/var/lib/neutron/kolla/"
- "kolla_logs:/var/log/kolla/" - "kolla_logs:/var/log/kolla/"
neutron-bgp-dragent:
container_name: "neutron_bgp_dragent"
image: "{{ neutron_bgp_dragent_image_full }}"
privileged: True
enabled: "{{ enable_neutron_bgp_dragent | bool }}"
group: "neutron-bgp-dragent"
host_in_groups: "{{ False if orchestration_engine == 'KUBERNETES' else inventory_hostname in groups['neutron-bgp-dragent'] }}"
volumes:
- "{{ node_config_directory }}/neutron-bgp-dragent/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/run:/run:shared"
- "/run/netns/:/run/netns/:shared"
- "/lib/modules:/lib/modules:ro"
- "neutron_metadata_socket:/var/lib/neutron/kolla/"
- "kolla_logs:/var/log/kolla/"
#################### ####################
@ -261,6 +276,10 @@ neutron_vpnaas_agent_image: "{{ docker_registry ~ '/' if docker_registry else ''
neutron_vpnaas_agent_tag: "{{ openstack_release }}" neutron_vpnaas_agent_tag: "{{ openstack_release }}"
neutron_vpnaas_agent_image_full: "{{ neutron_vpnaas_agent_image }}:{{ neutron_vpnaas_agent_tag }}" neutron_vpnaas_agent_image_full: "{{ neutron_vpnaas_agent_image }}:{{ neutron_vpnaas_agent_tag }}"
neutron_bgp_dragent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-bgp-dragent"
neutron_bgp_dragent_tag: "{{ openstack_release }}"
neutron_bgp_dragent_image_full: "{{ neutron_bgp_dragent_image }}:{{ neutron_bgp_dragent_tag }}"
openvswitch_db_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-openvswitch-db-server" openvswitch_db_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-openvswitch-db-server"
openvswitch_db_tag: "{{ openstack_release }}" openvswitch_db_tag: "{{ openstack_release }}"
openvswitch_db_image_full: "{{ openvswitch_db_image }}:{{ openvswitch_db_tag }}" openvswitch_db_image_full: "{{ openvswitch_db_image }}:{{ openvswitch_db_tag }}"
@ -318,5 +337,7 @@ service_plugins:
enabled: true enabled: true
- name: "sfc" - name: "sfc"
enabled: "{{ neutron_plugin_agent == 'sfc' }}" enabled: "{{ neutron_plugin_agent == 'sfc' }}"
- name: "neutron_dynamic_routing.services.bgp.bgp_plugin.BgpPlugin"
enabled: "{{ enable_neutron_bgp_dragent | bool }}"
neutron_service_plugins: "{{ service_plugins|selectattr('enabled', 'equalto', true)|list }}" neutron_service_plugins: "{{ service_plugins|selectattr('enabled', 'equalto', true)|list }}"

View File

@ -359,3 +359,28 @@
or neutron_vpnaas_agent_ini | changed or neutron_vpnaas_agent_ini | changed
or policy_json | changed or policy_json | changed
or neutron_vpnaas_agent_container | changed or neutron_vpnaas_agent_container | changed
- name: Restart neutron-bgp-dragent container
vars:
service_name: "neutron-bgp-dragent"
service: "{{ neutron_services[service_name] }}"
config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}"
policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
neutron_bgp_dragent_container: "{{ check_neutron_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 }}"
privileged: "{{ service.privileged | default(False) }}"
when:
- action != "config"
- service.enabled | bool
- service.host_in_groups | bool
- config_json | changed
or neutron_conf | changed
or neutron_bgp_dragent_ini | changed
or policy_json | changed
or neutron_bgp_dragent_container | changed

View File

@ -47,6 +47,7 @@
- "neutron-server" - "neutron-server"
- "neutron-lbaas-agent" - "neutron-lbaas-agent"
- "neutron-vpnaas-agent" - "neutron-vpnaas-agent"
- "neutron-bgp-dragent"
merge_configs: merge_configs:
sources: sources:
- "{{ role_path }}/templates/neutron.conf.j2" - "{{ role_path }}/templates/neutron.conf.j2"
@ -251,6 +252,22 @@
notify: notify:
- "Restart {{ service_name }} container" - "Restart {{ service_name }} container"
- name: Copying over bgp_dragent.ini
vars:
service_name: "neutron-bgp-dragent"
neutron_bgp_dragent: "{{ neutron_services['neutron-bgp-dragent'] }}"
merge_configs:
sources:
- "{{ role_path }}/templates/bgp_dragent.ini.j2"
- "{{ node_custom_config }}/neutron/bgp_dragent.ini"
dest: "{{ node_config_directory }}/{{ service_name }}/bgp_dragent.ini"
register: neutron_bgp_dragent_ini
when:
- neutron_bgp_dragent.enabled | bool
- neutron_bgp_dragent.host_in_groups | bool
notify:
- "Restart {{ service_name }} container"
- name: Check if policies shall be overwritten - name: Check if policies shall be overwritten
local_action: stat path="{{ node_custom_config }}/neutron/policy.json" local_action: stat path="{{ node_custom_config }}/neutron/policy.json"
register: neutron_policy register: neutron_policy
@ -267,6 +284,7 @@
- "neutron-server" - "neutron-server"
- "neutron-lbaas-agent" - "neutron-lbaas-agent"
- "neutron-vpnaas-agent" - "neutron-vpnaas-agent"
- "neutron-bgp-dragent"
template: template:
src: "{{ node_custom_config }}/neutron/policy.json" src: "{{ node_custom_config }}/neutron/policy.json"
dest: "{{ node_config_directory }}/{{ service_name }}/policy.json" dest: "{{ node_config_directory }}/{{ service_name }}/policy.json"

View File

@ -0,0 +1,3 @@
[BGP]
bgp_speaker_driver = neutron_dynamic_routing.services.bgp.agent.driver.ryu.driver.RyuBgpDriver
bgp_router_id = {{ neutron_bgp_router_id }}

View File

@ -0,0 +1,36 @@
{
"command": "neutron-bgp-dragent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/bgp_dragent.ini",
"config_files": [
{
"source": "{{ container_config_directory }}/neutron.conf",
"dest": "/etc/neutron/neutron.conf",
"owner": "neutron",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/bgp_dragent.ini",
"dest": "/etc/neutron/bgp_dragent.ini",
"owner": "neutron",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/policy.json",
"dest": "/etc/neutron/policy.json",
"owner": "neutron",
"perm": "0600",
"optional": true
}
],
"permissions": [
{
"path": "/var/log/kolla/neutron",
"owner": "neutron:neutron",
"recurse": true
},
{
"path": "/var/lib/neutron/kolla",
"owner": "neutron:neutron",
"recurse": true
}
]
}

View File

@ -170,6 +170,7 @@ kolla_internal_vip_address: "10.10.10.254"
#enable_mongodb: "no" #enable_mongodb: "no"
#enable_murano: "no" #enable_murano: "no"
#enable_multipathd: "no" #enable_multipathd: "no"
#enable_neutron_bgp_dragent: "no"
#enable_neutron_dvr: "no" #enable_neutron_dvr: "no"
#enable_neutron_lbaas: "no" #enable_neutron_lbaas: "no"
#enable_neutron_fwaas: "no" #enable_neutron_fwaas: "no"

View File

@ -0,0 +1,3 @@
---
features:
- Added playbooks and default configuration for neutron-bgp-dragent service