Merge "Allow neutron services to move around environment"

This commit is contained in:
Jenkins 2016-01-30 20:28:09 +00:00 committed by Gerrit Code Review
commit c68820e6e6
8 changed files with 29 additions and 23 deletions

View File

@ -96,6 +96,7 @@ neutron_plugins:
neutron_services: neutron_services:
neutron-dhcp-agent: neutron-dhcp-agent:
group: neutron_dhcp_agent
service_name: neutron-dhcp-agent service_name: neutron-dhcp-agent
service_en: True service_en: True
service_conf: dhcp_agent.ini service_conf: dhcp_agent.ini
@ -105,6 +106,7 @@ neutron_services:
config_overrides: "{{ neutron_dhcp_agent_ini_overrides }}" config_overrides: "{{ neutron_dhcp_agent_ini_overrides }}"
config_type: "ini" config_type: "ini"
neutron-linuxbridge-agent: neutron-linuxbridge-agent:
group: neutron_linuxbridge_agent
service_name: neutron-linuxbridge-agent service_name: neutron-linuxbridge-agent
service_en: True service_en: True
service_conf: plugins/ml2/linuxbridge_agent.ini service_conf: plugins/ml2/linuxbridge_agent.ini
@ -114,6 +116,7 @@ neutron_services:
config_overrides: "{{ neutron_linuxbridge_agent_ini_overrides }}" config_overrides: "{{ neutron_linuxbridge_agent_ini_overrides }}"
config_type: "ini" config_type: "ini"
neutron-metadata-agent: neutron-metadata-agent:
group: neutron_metadata_agent
service_name: neutron-metadata-agent service_name: neutron-metadata-agent
service_en: True service_en: True
service_conf: metadata_agent.ini service_conf: metadata_agent.ini
@ -122,6 +125,7 @@ neutron_services:
config_overrides: "{{ neutron_metadata_agent_ini_overrides }}" config_overrides: "{{ neutron_metadata_agent_ini_overrides }}"
config_type: "ini" config_type: "ini"
neutron-metering-agent: neutron-metering-agent:
group: neutron_metering_agent
service_name: neutron-metering-agent service_name: neutron-metering-agent
service_en: "{{ neutron_metering }}" service_en: "{{ neutron_metering }}"
service_conf: metering_agent.ini service_conf: metering_agent.ini
@ -130,6 +134,7 @@ neutron_services:
config_overrides: "{{ neutron_metering_agent_ini_overrides }}" config_overrides: "{{ neutron_metering_agent_ini_overrides }}"
config_type: "ini" config_type: "ini"
neutron-l3-agent: neutron-l3-agent:
group: neutron_l3_agent
service_name: neutron-l3-agent service_name: neutron-l3-agent
service_en: "{{ neutron_l3 }}" service_en: "{{ neutron_l3 }}"
service_conf: l3_agent.ini service_conf: l3_agent.ini
@ -139,6 +144,7 @@ neutron_services:
config_overrides: "{{ neutron_l3_agent_ini_overrides }}" config_overrides: "{{ neutron_l3_agent_ini_overrides }}"
config_type: "ini" config_type: "ini"
neutron-lbaas-agent: neutron-lbaas-agent:
group: neutron_lbaas_agent
service_name: neutron-lbaas-agent service_name: neutron-lbaas-agent
service_en: "{{ neutron_lbaas }}" service_en: "{{ neutron_lbaas }}"
service_conf: lbaas_agent.ini service_conf: lbaas_agent.ini
@ -148,6 +154,7 @@ neutron_services:
config_overrides: "{{ neutron_lbaas_agent_ini_overrides }}" config_overrides: "{{ neutron_lbaas_agent_ini_overrides }}"
config_type: "ini" config_type: "ini"
neutron-server: neutron-server:
group: neutron_server
service_name: neutron-server service_name: neutron-server
service_en: True service_en: True
service_group: neutron_server service_group: neutron_server

View File

@ -20,7 +20,7 @@
- include: neutron_db_setup.yml - include: neutron_db_setup.yml
when: > when: >
inventory_hostname == groups['neutron_server'][0] inventory_hostname == groups[neutron_services['neutron-server']['group']][0]
- include: neutron_service_setup.yml - include: neutron_service_setup.yml
when: > when: >
@ -28,7 +28,7 @@
- include: neutron_l3_ha.yml - include: neutron_l3_ha.yml
when: > when: >
inventory_hostname in groups['neutron_agent'] inventory_hostname in groups[neutron_services['neutron-l3-agent']['group']]
- name: Flush handlers - name: Flush handlers
meta: flush_handlers meta: flush_handlers

View File

@ -77,7 +77,7 @@
state: stopped state: stopped
pattern: "neutron-server" pattern: "neutron-server"
delegate_to: "{{ item }}" delegate_to: "{{ item }}"
with_items: groups['neutron_server'] with_items: groups[neutron_services['neutron-server']['group']]
when: (neutron_migrations is defined and neutron_migrations['run_contract']|bool) or neutron_plugin_type != 'ml2' when: (neutron_migrations is defined and neutron_migrations['run_contract']|bool) or neutron_plugin_type != 'ml2'
tags: tags:
- neutron-db-setup - neutron-db-setup
@ -121,7 +121,7 @@
state: started state: started
pattern: "neutron-server" pattern: "neutron-server"
delegate_to: "{{ item }}" delegate_to: "{{ item }}"
with_items: groups['neutron_server'] with_items: groups[neutron_services['neutron-server']['group']]
when: (neutron_migrations is defined and neutron_migrations['run_contract']|bool) or neutron_plugin_type != 'ml2' when: (neutron_migrations is defined and neutron_migrations['run_contract']|bool) or neutron_plugin_type != 'ml2'
tags: tags:
- neutron-db-setup - neutron-db-setup

View File

@ -47,7 +47,7 @@
delay: 2 delay: 2
with_items: neutron_lbaas_apt_packages with_items: neutron_lbaas_apt_packages
when: when:
- inventory_hostname in groups['neutron_agents_container'] - inventory_hostname in groups[neutron_services['neutron-lbaas-agent']['group']]
- neutron_lbaas | bool - neutron_lbaas | bool
tags: tags:
- neutron-install - neutron-install

View File

@ -60,7 +60,7 @@
notify: notify:
- Restart neutron services - Restart neutron services
when: > when: >
inventory_hostname in groups['neutron_agents_container'] inventory_hostname in groups[neutron_services['neutron-dhcp-agent']['group']]
tags: tags:
- neutron-config - neutron-config
@ -79,8 +79,7 @@
when: when:
- item.value.service_en | bool - item.value.service_en | bool
- item.value.service_conf is defined - item.value.service_conf is defined
- (inventory_hostname in groups['neutron_agents_container'] or - inventory_hostname in groups[item.value.group]
inventory_hostname in groups['neutron_linuxbridge_agent'])
tags: tags:
- neutron-config - neutron-config
@ -128,7 +127,7 @@
group: "root" group: "root"
mode: "0755" mode: "0755"
when: > when: >
inventory_hostname in groups['neutron_linuxbridge_agent'] inventory_hostname in groups[neutron_services['neutron-linuxbridge-agent']['group']]
tags: tags:
- neutron-config - neutron-config
- neutron-checksum-fix - neutron-checksum-fix
@ -136,7 +135,7 @@
- name: Run iptables checksum fix - name: Run iptables checksum fix
command: /etc/network/if-up.d/post-up-checksum-rules command: /etc/network/if-up.d/post-up-checksum-rules
when: > when: >
inventory_hostname in groups['neutron_linuxbridge_agent'] inventory_hostname in groups[neutron_services['neutron-linuxbridge-agent']['group']]
tags: tags:
- neutron-config - neutron-config
- neutron-checksum-fix - neutron-checksum-fix

View File

@ -22,7 +22,7 @@
system_group: "{{ neutron_system_group_name }}" system_group: "{{ neutron_system_group_name }}"
service_home: "{{ neutron_system_home_folder }}" service_home: "{{ neutron_system_home_folder }}"
when: when:
- inventory_hostname in groups['neutron_server'] - inventory_hostname in groups[neutron_services['neutron-server']['group']]
- neutron_services['neutron-server'].service_en | bool - neutron_services['neutron-server'].service_en | bool
tags: tags:
- upstart-init - upstart-init
@ -36,7 +36,7 @@
system_group: "{{ neutron_system_group_name }}" system_group: "{{ neutron_system_group_name }}"
service_home: "{{ neutron_system_home_folder }}" service_home: "{{ neutron_system_home_folder }}"
when: when:
- inventory_hostname in groups['neutron_agent'] - inventory_hostname in groups[neutron_services['neutron-dhcp-agent']['group']]
- neutron_services['neutron-dhcp-agent'].service_en | bool - neutron_services['neutron-dhcp-agent'].service_en | bool
tags: tags:
- upstart-init - upstart-init
@ -50,7 +50,7 @@
system_group: "{{ neutron_system_group_name }}" system_group: "{{ neutron_system_group_name }}"
service_home: "{{ neutron_system_home_folder }}" service_home: "{{ neutron_system_home_folder }}"
when: when:
- inventory_hostname in groups['neutron_agent'] - inventory_hostname in groups[neutron_services['neutron-l3-agent']['group']]
- neutron_services['neutron-l3-agent'].service_en | bool - neutron_services['neutron-l3-agent'].service_en | bool
tags: tags:
- upstart-init - upstart-init
@ -64,7 +64,7 @@
system_group: "{{ neutron_system_group_name }}" system_group: "{{ neutron_system_group_name }}"
service_home: "{{ neutron_system_home_folder }}" service_home: "{{ neutron_system_home_folder }}"
when: when:
- inventory_hostname in groups['neutron_linuxbridge_agent'] - inventory_hostname in groups[neutron_services['neutron-linuxbridge-agent']['group']]
- neutron_services['neutron-linuxbridge-agent'].service_en | bool - neutron_services['neutron-linuxbridge-agent'].service_en | bool
tags: tags:
- upstart-init - upstart-init
@ -78,7 +78,7 @@
system_group: "{{ neutron_system_group_name }}" system_group: "{{ neutron_system_group_name }}"
service_home: "{{ neutron_system_home_folder }}" service_home: "{{ neutron_system_home_folder }}"
when: when:
- inventory_hostname in groups['neutron_agent'] - inventory_hostname in groups[neutron_services['neutron-metadata-agent']['group']]
- neutron_services['neutron-metadata-agent'].service_en | bool - neutron_services['neutron-metadata-agent'].service_en | bool
tags: tags:
- upstart-init - upstart-init
@ -92,7 +92,7 @@
system_group: "{{ neutron_system_group_name }}" system_group: "{{ neutron_system_group_name }}"
service_home: "{{ neutron_system_home_folder }}" service_home: "{{ neutron_system_home_folder }}"
when: when:
- inventory_hostname in groups['neutron_agent'] - inventory_hostname in groups[neutron_services['neutron-metering-agent']['group']]
- neutron_services['neutron-metering-agent'].service_en | bool - neutron_services['neutron-metering-agent'].service_en | bool
tags: tags:
- upstart-init - upstart-init
@ -106,7 +106,7 @@
system_group: "{{ neutron_system_group_name }}" system_group: "{{ neutron_system_group_name }}"
service_home: "{{ neutron_system_home_folder }}" service_home: "{{ neutron_system_home_folder }}"
when: when:
- inventory_hostname in groups['neutron_agent'] - inventory_hostname in groups[neutron_services['neutron-lbaas-agent']['group']]
- neutron_services['neutron-lbaas-agent'].service_en | bool - neutron_services['neutron-lbaas-agent'].service_en | bool
tags: tags:
- upstart-init - upstart-init

View File

@ -48,7 +48,7 @@
- "{{ neutron_optional_plumgrid_pip_packages }}" - "{{ neutron_optional_plumgrid_pip_packages }}"
when: when:
- neutron_venv_enabled | bool - neutron_venv_enabled | bool
- inventory_hostname in groups['neutron_server'] - inventory_hostname in groups[neutron_services['neutron-server']['group']]
tags: tags:
- neutron-install - neutron-install
- neutron-pip-packages - neutron-pip-packages
@ -69,7 +69,7 @@
- "{{ neutron_optional_plumgrid_pip_packages }}" - "{{ neutron_optional_plumgrid_pip_packages }}"
when: when:
- neutron_venv_enabled | bool - neutron_venv_enabled | bool
- inventory_hostname in groups['neutron_server'] - inventory_hostname in groups[neutron_services['neutron-server']['group']]
tags: tags:
- neutron-install - neutron-install
- neutron-pip-packages - neutron-pip-packages
@ -88,7 +88,7 @@
- "{{ neutron_optional_plumgrid_pip_packages }}" - "{{ neutron_optional_plumgrid_pip_packages }}"
when: when:
- not neutron_venv_enabled | bool - not neutron_venv_enabled | bool
- inventory_hostname in groups['neutron_server'] - inventory_hostname in groups[neutron_services['neutron-server']['group']]
tags: tags:
- neutron-install - neutron-install
- neutron-pip-packages - neutron-pip-packages
@ -107,7 +107,7 @@
- "{{ neutron_optional_plumgrid_pip_packages }}" - "{{ neutron_optional_plumgrid_pip_packages }}"
when: when:
- not neutron_venv_enabled | bool - not neutron_venv_enabled | bool
- inventory_hostname in groups['neutron_server'] - inventory_hostname in groups[neutron_services['neutron-server']['group']]
tags: tags:
- neutron-install - neutron-install
- neutron-pip-packages - neutron-pip-packages

View File

@ -10,7 +10,7 @@ debug = {{ debug }}
fatal_deprecations = {{ neutron_fatal_deprecations }} fatal_deprecations = {{ neutron_fatal_deprecations }}
log_file = /var/log/neutron/neutron.log log_file = /var/log/neutron/neutron.log
{% if inventory_hostname in groups['neutron_server'] %} {% if inventory_hostname in groups[neutron_services['neutron-server']['group']] %}
# General, only applies to neutron server host group # General, only applies to neutron server host group
network_device_mtu = {{ neutron_network_device_mtu }} network_device_mtu = {{ neutron_network_device_mtu }}
@ -48,7 +48,7 @@ router_distributed = False
# Agents # Agents
agent_down_time = {{ neutron_agent_down_time }} agent_down_time = {{ neutron_agent_down_time }}
{% set num_agent = groups['neutron_agent'] | length %} {% set num_agent = groups[neutron_services['neutron-dhcp-agent']['group']] | length %}
{% if neutron_plugin_type == 'ml2' and num_agent >= 2 %} {% if neutron_plugin_type == 'ml2' and num_agent >= 2 %}
{% if neutron_services['neutron-linuxbridge-agent']['service_en'] | bool %} {% if neutron_services['neutron-linuxbridge-agent']['service_en'] | bool %}