From f47fb972b61c2e9729ae4d5e4457c5273b3ea363 Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Mon, 13 Jul 2015 07:32:29 +0000 Subject: [PATCH] Ansible Neutron support Add initial Ansible support for Neutron Change-Id: Idad011945bff914535d1ac0eb09cc9d3b0882fbe Partially-Implements: blueprint ansible-service --- ansible/inventory/all-in-one | 12 +++ ansible/roles/neutron/defaults/main.yml | 61 +++++++++++++++ ansible/roles/neutron/tasks/bootstrap.yml | 12 +++ ansible/roles/neutron/tasks/config.yml | 74 +++++++++++++++++++ ansible/roles/neutron/tasks/main.yml | 8 ++ ansible/roles/neutron/tasks/register.yml | 21 ++++++ ansible/roles/neutron/tasks/start.yml | 59 +++++++++++++++ .../roles/neutron/templates/dhcp_agent.ini.j2 | 4 + .../roles/neutron/templates/l3_agent.ini.j2 | 8 ++ .../neutron/templates/metadata_agent.ini.j2 | 26 +++++++ .../roles/neutron/templates/ml2_conf.ini.j2 | 35 +++++++++ .../roles/neutron/templates/neutron.conf.j2 | 38 ++++++++++ ansible/site.yml | 11 ++- .../neutron/neutron-dhcp-agent/start.sh | 6 +- .../neutron-l3-agent/config-external.sh | 12 ++- .../common/neutron/neutron-l3-agent/start.sh | 6 +- .../neutron/neutron-metadata-agent/start.sh | 6 +- .../config-external.sh | 10 +++ .../neutron-openvswitch-agent/start.sh | 5 +- .../neutron/neutron-server/config-external.sh | 11 +++ docker/common/neutron/neutron-server/start.sh | 2 +- etc/kolla/config/neutron.conf | 0 etc/kolla/config/neutron/ml2_conf.ini | 0 etc/kolla/config/neutron/neutron-agents.conf | 0 .../neutron/neutron-openvswitch-agent.conf | 0 etc/kolla/config/neutron/neutron-server.conf | 0 26 files changed, 414 insertions(+), 13 deletions(-) create mode 100644 ansible/roles/neutron/defaults/main.yml create mode 100644 ansible/roles/neutron/tasks/bootstrap.yml create mode 100644 ansible/roles/neutron/tasks/config.yml create mode 100644 ansible/roles/neutron/tasks/main.yml create mode 100644 ansible/roles/neutron/tasks/register.yml create mode 100644 ansible/roles/neutron/tasks/start.yml create mode 100644 ansible/roles/neutron/templates/dhcp_agent.ini.j2 create mode 100644 ansible/roles/neutron/templates/l3_agent.ini.j2 create mode 100644 ansible/roles/neutron/templates/metadata_agent.ini.j2 create mode 100644 ansible/roles/neutron/templates/ml2_conf.ini.j2 create mode 100644 ansible/roles/neutron/templates/neutron.conf.j2 create mode 100644 etc/kolla/config/neutron.conf create mode 100644 etc/kolla/config/neutron/ml2_conf.ini create mode 100644 etc/kolla/config/neutron/neutron-agents.conf create mode 100644 etc/kolla/config/neutron/neutron-openvswitch-agent.conf create mode 100644 etc/kolla/config/neutron/neutron-server.conf diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index 5b4a915681..7fd25f9d66 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -3,6 +3,9 @@ [support] localhost ansible_connection=local +[network] +localhost ansible_connection=local + [compute] localhost ansible_connection=local @@ -24,6 +27,8 @@ support [nova:children] support +[neutron:children] +network # Additional control implemented here. These groups allow you to control which # services run on which hosts at a per-service level. @@ -47,3 +52,10 @@ nova [nova-scheduler:children] nova + +# Neutron +[neutron-server:children] +neutron + +[neutron-agents:children] +neutron diff --git a/ansible/roles/neutron/defaults/main.yml b/ansible/roles/neutron/defaults/main.yml new file mode 100644 index 0000000000..d68a775fa4 --- /dev/null +++ b/ansible/roles/neutron/defaults/main.yml @@ -0,0 +1,61 @@ +--- +project_name: "neutron" + +#################### +# Database +#################### +neutron_database_name: "neutron" +neutron_database_user: "neutron" +neutron_database_address: "{{ kolla_internal_address }}" + +# Do not override "service_*" variables +service_database_name: "{{ neutron_database_name }}" +service_database_user: "{{ neutron_database_user }}" +service_database_password: "{{ neutron_database_password }}" + + +#################### +# Docker +#################### +docker_neutron_registry: "{{ docker_registry }}" +docker_neutron_namespace: "{{ docker_namespace }}" +kolla_neutron_base_distro: "{{ kolla_base_distro }}" +kolla_neutron_install_type: "{{ kolla_install_type }}" + +kolla_neutron_server_container_name: "neutron-server" +docker_neutron_server_image: "{{ docker_neutron_registry }}{{ docker_neutron_namespace }}/{{ kolla_neutron_base_distro }}-{{ kolla_neutron_install_type }}-{{ kolla_neutron_server_container_name }}" +docker_neutron_server_tag: "{{ openstack_release }}" +docker_neutron_server_image_full: "{{ docker_neutron_server_image }}:{{ docker_neutron_server_tag }}" + +kolla_neutron_agents_container_name: "neutron-agents" +docker_neutron_agents_image: "{{ docker_neutron_registry }}{{ docker_neutron_namespace }}/{{ kolla_neutron_base_distro }}-{{ kolla_neutron_install_type }}-{{ kolla_neutron_agents_container_name }}" +docker_neutron_agents_tag: "{{ openstack_release }}" +docker_neutron_agents_image_full: "{{ docker_neutron_agents_image }}:{{ docker_neutron_agents_tag }}" + +kolla_neutron_openvswitch_agent_container_name: "neutron-openvswitch-agent" +docker_neutron_openvswitch_agent_image: "{{ docker_neutron_registry }}{{ docker_neutron_namespace }}/{{ kolla_neutron_base_distro }}-{{ kolla_neutron_install_type }}-{{ kolla_neutron_openvswitch_agent_container_name }}" +docker_neutron_openvswitch_agent_tag: "{{ openstack_release }}" +docker_neutron_openvswitch_agent_image_full: "{{ docker_neutron_openvswitch_agent_image }}:{{ docker_neutron_openvswitch_agent_tag }}" + +kolla_openvswitch_db_container_name: "ovs-db-server" +docker_openvswitch_db_image: "{{ docker_neutron_registry }}{{ docker_neutron_namespace }}/{{ kolla_neutron_base_distro }}-{{ kolla_neutron_install_type }}-{{ kolla_openvswitch_db_container_name }}" +docker_openvswitch_db_tag: "{{ openstack_release }}" +docker_openvswitch_db_image_full: "{{ docker_openvswitch_db_image }}:{{ docker_openvswitch_db_tag }}" + +kolla_openvswitch_vswitchd_container_name: "ovs-vswitchd" +docker_openvswitch_vswitchd_image: "{{ docker_neutron_registry }}{{ docker_neutron_namespace }}/{{ kolla_neutron_base_distro }}-{{ kolla_neutron_install_type }}-{{ kolla_openvswitch_vswitchd_container_name }}" +docker_openvswitch_vswitchd_tag: "{{ openstack_release }}" +docker_openvswitch_vswitchd_image_full: "{{ docker_openvswitch_vswitchd_image }}:{{ docker_openvswitch_vswitchd_tag }}" + + +#################### +# Openstack +#################### +neutron_public_address: "{{ kolla_external_address }}" +neutron_admin_address: "{{ kolla_internal_address }}" +neutron_internal_address: "{{ kolla_internal_address }}" + +neutron_logging_verbose: "{{ openstack_logging_verbose }}" +neutron_logging_debug: "{{ openstack_logging_debug }}" + +neutron_keystone_user: "neutron" diff --git a/ansible/roles/neutron/tasks/bootstrap.yml b/ansible/roles/neutron/tasks/bootstrap.yml new file mode 100644 index 0000000000..f0e9aabcd5 --- /dev/null +++ b/ansible/roles/neutron/tasks/bootstrap.yml @@ -0,0 +1,12 @@ +--- +- include: ../../bootstrap.yml + vars: + container_detach: False + container_environment: + KOLLA_BOOTSTRAP: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + container_image: "{{ docker_neutron_server_image_full }}" + container_name: "bootstrap_neutron" + container_restart_policy: "no" + container_volumes: + - "{{ node_config_directory }}/neutron-server/:/opt/kolla/neutron-server/:ro" diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml new file mode 100644 index 0000000000..fcc7d6f5ab --- /dev/null +++ b/ansible/roles/neutron/tasks/config.yml @@ -0,0 +1,74 @@ +--- +- include: ../../config.yml + vars: + service_name: "neutron-server" + config_source: + - "roles/{{ project_name }}/templates/neutron.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/database.conf" + - "/etc/kolla/config/messaging.conf" + - "/etc/kolla/config/{{ project_name }}.conf" + - "/etc/kolla/config/{{ project_name }}/{{ service_name }}.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_database" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_messaging" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_augment" + - "{{ node_templates_directory }}/{{ service_name }}/{{ service_name }}.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/neutron.conf" + when: inventory_hostname in groups['neutron-server'] + +- include: ../../config.yml + vars: + service_name: "neutron-agents" + config_source: + - "roles/{{ project_name }}/templates/neutron.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/database.conf" + - "/etc/kolla/config/messaging.conf" + - "/etc/kolla/config/{{ project_name }}.conf" + - "/etc/kolla/config/{{ project_name }}/{{ service_name }}.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_database" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_messaging" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_augment" + - "{{ node_templates_directory }}/{{ service_name }}/{{ service_name }}.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/neutron.conf" + when: inventory_hostname in groups['neutron-agents'] + +- include: ../../config.yml + vars: + service_name: "neutron-openvswitch-agent" + config_source: + - "roles/{{ project_name }}/templates/neutron.conf.j2" + - "/etc/kolla/config/global.conf" + - "/etc/kolla/config/database.conf" + - "/etc/kolla/config/messaging.conf" + - "/etc/kolla/config/{{ project_name }}.conf" + - "/etc/kolla/config/{{ project_name }}/{{ service_name }}.conf" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_global" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_database" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_messaging" + - "{{ node_templates_directory }}/{{ service_name }}/{{ project_name }}.conf_augment" + - "{{ node_templates_directory }}/{{ service_name }}/{{ service_name }}.conf_augment" + config_dest: "{{ node_config_directory }}/{{ service_name }}/neutron.conf" + when: inventory_hostname in groups['neutron-agents'] or + inventory_hostname in groups['compute'] + +- include: ../../config.yml + vars: + service_name: "neutron-openvswitch-agent" + config_source: + - "roles/{{ project_name }}/templates/ml2_conf.ini.j2" + - "/etc/kolla/config/{{ project_name }}/ml2_conf.ini" + config_template_dest: + - "{{ node_templates_directory }}/{{ service_name }}/ml2_conf.ini_minimal" + - "{{ node_templates_directory }}/{{ service_name }}/ml2_conf.ini_augment" + config_dest: "{{ node_config_directory }}/ml2_conf.ini" + when: inventory_hostname in groups['neutron-agents'] or + inventory_hostname in groups['compute'] diff --git a/ansible/roles/neutron/tasks/main.yml b/ansible/roles/neutron/tasks/main.yml new file mode 100644 index 0000000000..5c48120b7c --- /dev/null +++ b/ansible/roles/neutron/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- include: register.yml + +- include: config.yml + +- include: bootstrap.yml + +- include: start.yml diff --git a/ansible/roles/neutron/tasks/register.yml b/ansible/roles/neutron/tasks/register.yml new file mode 100644 index 0000000000..1acf4af5ae --- /dev/null +++ b/ansible/roles/neutron/tasks/register.yml @@ -0,0 +1,21 @@ +--- +- name: Creating the Neutron service and endpoint + kolla_keystone_service: + service_name: "neutron" + service_type: "network" + description: "OpenStack Networking" + endpoint_region: "{{ openstack_region_name }}" + admin_url: "http://{{ kolla_internal_address }}:{{ neutron_server_port }}" + internal_url: "http://{{ kolla_internal_address }}:{{ neutron_server_port }}" + public_url: "http://{{ kolla_external_address }}:{{ neutron_server_port }}" + auth: "{{ openstack_auth_v2 }}" + region_name: "{{ openstack_region_name }}" + +- name: Creating the Neutron project, user, and role + kolla_keystone_user: + project: "service" + user: "neutron" + password: "{{ neutron_keystone_password }}" + role: "admin" + auth: "{{ openstack_auth_v2 }}" + region_name: "{{ openstack_region_name }}" diff --git a/ansible/roles/neutron/tasks/start.yml b/ansible/roles/neutron/tasks/start.yml new file mode 100644 index 0000000000..4cecfc35b6 --- /dev/null +++ b/ansible/roles/neutron/tasks/start.yml @@ -0,0 +1,59 @@ +--- +- include: ../../start.yml + vars: + container_environment: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + container_image: "{{ docker_openvswitch_db_image_full }}" + container_name: "openvswitch_db" + container_volumes: + - "/run:/run" + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['neutron-agents'] + +- include: ../../start.yml + vars: + container_environment: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + container_image: "{{ docker_openvswitch_vswitchd_image_full }}" + container_name: "openvswitch_vswitchd" + container_privileged: "True" + container_volumes: + - "/run:/run" + - "/lib/modules:/lib/modules:ro" + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['neutron-agents'] + +- include: ../../start.yml + vars: + container_environment: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + container_image: "{{ docker_neutron_openvswitch_agent_image_full }}" + container_name: "neutron_openvswitch_agent" + container_privileged: "True" + container_volumes: + - "/run:/run" + - "{{ node_config_directory }}/neutron-openvswitch-agent/:/opt/kolla/neutron-openvswitch-agent/:ro" + when: inventory_hostname in groups['compute'] or + inventory_hostname in groups['neutron-agents'] + +- include: ../../start.yml + vars: + container_environment: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + container_image: "{{ docker_neutron_agents_image_full }}" + container_name: "neutron_agents" + container_privileged: "True" + container_volumes: + - "{{ node_config_directory }}/neutron-agents/:/opt/kolla/neutron-agents/:ro" + when: inventory_hostname in groups['neutron-agents'] + +- include: ../../start.yml + vars: + container_environment: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + container_image: "{{ docker_neutron_server_image_full }}" + container_name: "neutron_server" + container_privileged: "True" + container_volumes: + - "{{ node_config_directory }}/neutron-server/:/opt/kolla/neutron-server/:ro" + when: inventory_hostname in groups['neutron-server'] diff --git a/ansible/roles/neutron/templates/dhcp_agent.ini.j2 b/ansible/roles/neutron/templates/dhcp_agent.ini.j2 new file mode 100644 index 0000000000..be18730d23 --- /dev/null +++ b/ansible/roles/neutron/templates/dhcp_agent.ini.j2 @@ -0,0 +1,4 @@ +[DEFAULT] +# DHCP Agent +dnsmasq_config_file = /etc/neutron/dnsmasq.conf +dhcp_delete_namespaces = true diff --git a/ansible/roles/neutron/templates/l3_agent.ini.j2 b/ansible/roles/neutron/templates/l3_agent.ini.j2 new file mode 100644 index 0000000000..0df28ab486 --- /dev/null +++ b/ansible/roles/neutron/templates/l3_agent.ini.j2 @@ -0,0 +1,8 @@ +[DEFAULT] +# L3 Agent +router_delete_namespaces = true +#router_distributed = true +enable_metadata_proxy = true +agent_mode = legacy +external_network_bridge = br-ex +#ha_vrrp_auth_password = c0b4e8f922a7b03d1def93b516da81d8103c83c2 diff --git a/ansible/roles/neutron/templates/metadata_agent.ini.j2 b/ansible/roles/neutron/templates/metadata_agent.ini.j2 new file mode 100644 index 0000000000..cce556950e --- /dev/null +++ b/ansible/roles/neutron/templates/metadata_agent.ini.j2 @@ -0,0 +1,26 @@ +[DEFAULT] +nova_metadata_ip = {{ kolla_internal_address }} +metadata_proxy_shared_secret = {{ metadata_secret }} +auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }} +auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }} +auth_region = {{ openstack_region_name }} +auth_plugin = password +project_domain_id = default +user_domain_id = default +project_name = service +username = neutron +password = {{ neutron_keystone_password }} + +nova_url = http://{{ kolla_internal_address }}:{{ nova_api_port }}/v2 +notify_nova_on_port_data_changes = True +notify_nova_on_port_status_change = True + +[nova] +auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }} +auth_plugin = password +project_domain_id = default +user_domain_id = default +region_name = {{ openstack_region_name }} +project_name = service +username = nova +password = {{ nova_keystone_password }} diff --git a/ansible/roles/neutron/templates/ml2_conf.ini.j2 b/ansible/roles/neutron/templates/ml2_conf.ini.j2 new file mode 100644 index 0000000000..f994ba1a15 --- /dev/null +++ b/ansible/roles/neutron/templates/ml2_conf.ini.j2 @@ -0,0 +1,35 @@ +# TODO(SamYaple): Make entire file more configurable configurable + +[ml2] +# Changing type_drivers after bootstrap can lead to database inconsistencies +type_drivers = flat,vlan,vxlan +tenant_network_types = vxlan +mechanism_drivers = openvswitch,l2population + +[ml2_type_vlan] +network_vlan_ranges = external:1000:1999 + +[ml2_type_flat] +#flat_networks = external + +[ml2_type_gre] +tunnel_id_ranges = 1:1000 + +[ml2_type_vxlan] +vni_ranges = 1:1000 +vxlan_group = 239.1.1.1 + +[securitygroup] +firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver +enable_ipset = true +enable_security_group = true + +[agent] +tunnel_types = vxlan +l2_population = true +arp_responder = true +#enable_distributed_routing = true + +[ovs] +local_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bridge_mappings = external:{{ neutron_interface }} diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2 new file mode 100644 index 0000000000..8c9961fd64 --- /dev/null +++ b/ansible/roles/neutron/templates/neutron.conf.j2 @@ -0,0 +1,38 @@ +[DEFAULT] +verbose = true +debug = true + +bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} + +lock_path = /var/lock/neutron +api_paste_config = /usr/share/neutron/api-paste.ini + +notification_driver = neutron.openstack.common.notifier.rpc_notifier + +interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver + +allow_overlapping_ips = true +core_plugin = ml2 +service_plugins = router + +[oslo_messaging_rabbit] +rabbit_host = {{ kolla_internal_address }} +rabbit_userid = {{ rabbitmq_user }} +rabbit_password = {{ rabbitmq_password }} +rabbit_ha_queues = true + +[agent] +root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf + +[database] +connection = mysql://{{ neutron_database_user }}:{{ neutron_database_password }}@{{ neutron_database_address }}/{{ neutron_database_name }} + +[keystone_authtoken] +auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }} +auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }} +auth_plugin = password +project_domain_id = default +user_domain_id = default +project_name = service +username = neutron +password = {{ neutron_keystone_password }} diff --git a/ansible/site.yml b/ansible/site.yml index db3d31a823..5abb1d07de 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -19,7 +19,16 @@ - glance tags: glance -- hosts: nova +- hosts: + - nova + - compute roles: - nova tags: nova + +- hosts: + - neutron + - compute + roles: + - neutron + tags: neutron diff --git a/docker/common/neutron/neutron-dhcp-agent/start.sh b/docker/common/neutron/neutron-dhcp-agent/start.sh index a89aaf6044..71ec4678a4 100755 --- a/docker/common/neutron/neutron-dhcp-agent/start.sh +++ b/docker/common/neutron/neutron-dhcp-agent/start.sh @@ -2,7 +2,7 @@ set -o errexit CMD="/usr/bin/neutron-dhcp-agent" -ARGS="--config-file /etc/neutron/dhcp_agent.ini --config-dir /etc/neutron" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini" # Loading common functions. source /opt/kolla/kolla-common.sh @@ -16,14 +16,14 @@ set_configs() { exec /opt/kolla/neutron-dhcp-agent/config-internal.sh ;; CONFIG_EXTERNAL_COPY_ALWAYS) - source /opt/kolla/neutron-dhcp-agent/config-exernal.sh + source /opt/kolla/neutron-dhcp-agent/config-external.sh ;; CONFIG_EXTERNAL_COPY_ONCE) if [[ -f /configured-dhcp ]]; then echo 'INFO - Neutron-dhcp has already been configured; Refusing to copy new configs' return fi - source /opt/kolla/neutron-dhcp-agent/config-exernal.sh + source /opt/kolla/neutron-dhcp-agent/config-external.sh touch /configured-dhcp ;; diff --git a/docker/common/neutron/neutron-l3-agent/config-external.sh b/docker/common/neutron/neutron-l3-agent/config-external.sh index 5b85898b75..e6eb049a4b 100755 --- a/docker/common/neutron/neutron-l3-agent/config-external.sh +++ b/docker/common/neutron/neutron-l3-agent/config-external.sh @@ -1,5 +1,5 @@ #!/bin/bash -SOURCES="/opt/kolla/neutron-l3-agent/neutron.conf /opt/kolla/neutron-l3-agent/l3_agent.ini /opt/kolla/neutron-l3-agent/fwaas_driver.ini" +SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/l3_agent.ini /opt/kolla/neutron-agents/fwaas_driver.ini" TARGET="/etc/neutron/" OWNER="neutron" @@ -11,3 +11,13 @@ for f in $SOURCES; do chmod 0644 $TARGET/$fname fi done + +SOURCE="/opt/kolla/neutron-agents/ml2_conf.ini" +TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/neutron/neutron-l3-agent/start.sh b/docker/common/neutron/neutron-l3-agent/start.sh index ca301d196f..fd85c22b13 100755 --- a/docker/common/neutron/neutron-l3-agent/start.sh +++ b/docker/common/neutron/neutron-l3-agent/start.sh @@ -2,7 +2,7 @@ set -o errexit CMD="/usr/bin/neutron-l3-agent" -ARGS="--config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-dir /etc/neutron" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" # Loading common functions. source /opt/kolla/kolla-common.sh @@ -16,14 +16,14 @@ set_configs() { exec /opt/kolla/neutron-l3-agent/config-internal.sh ;; CONFIG_EXTERNAL_COPY_ALWAYS) - source /opt/kolla/neutron-l3-agent/config-exernal.sh + source /opt/kolla/neutron-l3-agent/config-external.sh ;; CONFIG_EXTERNAL_COPY_ONCE) if [[ -f /configured-l3 ]]; then echo 'INFO - Neutron-l3 has already been configured; Refusing to copy new configs' return fi - source /opt/kolla/neutron-l3-agent/config-exernal.sh + source /opt/kolla/neutron-l3-agent/config-external.sh touch /configured-l3 ;; diff --git a/docker/common/neutron/neutron-metadata-agent/start.sh b/docker/common/neutron/neutron-metadata-agent/start.sh index c43388b0c4..e67946117b 100755 --- a/docker/common/neutron/neutron-metadata-agent/start.sh +++ b/docker/common/neutron/neutron-metadata-agent/start.sh @@ -2,7 +2,7 @@ set -o errexit CMD="/usr/bin/neutron-metadata-agent" -ARGS="--config-file /etc/neutron/metadata_agent.ini --config-dir /etc/neutron" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini" # Loading common functions. source /opt/kolla/kolla-common.sh @@ -16,14 +16,14 @@ set_configs() { exec /opt/kolla/neutron-metadata-agent/config-internal.sh ;; CONFIG_EXTERNAL_COPY_ALWAYS) - source /opt/kolla/neutron-metadata-agent/config-exernal.sh + source /opt/kolla/neutron-metadata-agent/config-external.sh ;; CONFIG_EXTERNAL_COPY_ONCE) if [[ -f /configured-md ]]; then echo 'INFO - Neutron-metadata has already been configured; Refusing to copy new configs' return fi - source /opt/kolla/neutron-metadata-agent/config-exernal.sh + source /opt/kolla/neutron-metadata-agent/config-external.sh touch /configured-md ;; diff --git a/docker/common/neutron/neutron-openvswitch-agent/config-external.sh b/docker/common/neutron/neutron-openvswitch-agent/config-external.sh index 780c2be14f..552d698617 100755 --- a/docker/common/neutron/neutron-openvswitch-agent/config-external.sh +++ b/docker/common/neutron/neutron-openvswitch-agent/config-external.sh @@ -8,3 +8,13 @@ if [[ -f "$SOURCE" ]]; then chown ${OWNER}: $TARGET chmod 0644 $TARGET fi + +SOURCE="/opt/kolla/neutron-openvswitch-agent/ml2_conf.ini" +TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/neutron/neutron-openvswitch-agent/start.sh b/docker/common/neutron/neutron-openvswitch-agent/start.sh index 6c2add489f..4c05db9c50 100755 --- a/docker/common/neutron/neutron-openvswitch-agent/start.sh +++ b/docker/common/neutron/neutron-openvswitch-agent/start.sh @@ -2,7 +2,7 @@ set -o errexit CMD="/usr/bin/neutron-openvswitch-agent" -ARGS="--config-file /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" # Loading common functions. source /opt/kolla/kolla-common.sh @@ -10,4 +10,7 @@ source /opt/kolla/kolla-common.sh # Config-internal script exec out of this function, it does not return here. set_configs +# Set !requiretty +source /opt/kolla/config-sudoers.sh + exec $CMD $ARGS diff --git a/docker/common/neutron/neutron-server/config-external.sh b/docker/common/neutron/neutron-server/config-external.sh index 83cd33ba53..c8558ecca3 100755 --- a/docker/common/neutron/neutron-server/config-external.sh +++ b/docker/common/neutron/neutron-server/config-external.sh @@ -8,3 +8,14 @@ if [[ -f "$SOURCE" ]]; then chown ${OWNER}: $TARGET chmod 0644 $TARGET fi + +# TODO(SamYaple): Remove this from neutron-server once bootstrap is understood +SOURCE="/opt/kolla/neutron-openvswitch-agent/ml2_conf.ini" +TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/neutron/neutron-server/start.sh b/docker/common/neutron/neutron-server/start.sh index 295caaac6b..7df950e57e 100755 --- a/docker/common/neutron/neutron-server/start.sh +++ b/docker/common/neutron/neutron-server/start.sh @@ -2,7 +2,7 @@ set -o errexit CMD="/usr/bin/neutron-server" -ARGS="--config-file /etc/neutron/plugins/ml2/ml2_conf.ini" +ARGS="--config-file /etc/neutron/neutron.conf" # Loading common functions. source /opt/kolla/kolla-common.sh diff --git a/etc/kolla/config/neutron.conf b/etc/kolla/config/neutron.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/neutron/ml2_conf.ini b/etc/kolla/config/neutron/ml2_conf.ini new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/neutron/neutron-agents.conf b/etc/kolla/config/neutron/neutron-agents.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/neutron/neutron-openvswitch-agent.conf b/etc/kolla/config/neutron/neutron-openvswitch-agent.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/etc/kolla/config/neutron/neutron-server.conf b/etc/kolla/config/neutron/neutron-server.conf new file mode 100644 index 0000000000..e69de29bb2