Merge "Neutron 16.04 support"

This commit is contained in:
Jenkins 2016-06-03 01:39:56 +00:00 committed by Gerrit Code Review
commit dbbdebba56
11 changed files with 197 additions and 30 deletions

View File

@ -416,6 +416,9 @@ neutron_apt_packages:
- libpq-dev
- radvd
neutron_lxb_apt_packages:
- bridge-utils
neutron_lbaas_apt_packages:
- haproxy

View File

@ -36,10 +36,7 @@
- include: neutron_post_install.yml
# neutron system services
- include: neutron_upstart_init.yml
when:
- ansible_distribution | lower == 'ubuntu'
- ansible_distribution_version | version_compare('16.04', '<')
- include: neutron_init.yml
- include: neutron_lbaas.yml

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-server'].service_name }}"
program_config_options: "{{ neutron_services['neutron-server'].config_options }}"
@ -27,7 +27,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-dhcp-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-dhcp-agent'].config_options }}"
@ -41,7 +41,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-l3-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-l3-agent'].config_options }}"
@ -55,7 +55,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-linuxbridge-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-linuxbridge-agent'].config_options }}"
@ -69,7 +69,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-openvswitch-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-openvswitch-agent'].config_options }}"
@ -84,7 +84,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-metadata-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-metadata-agent'].config_options }}"
@ -98,7 +98,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-metering-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-metering-agent'].config_options }}"
@ -112,7 +112,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-lbaas-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-lbaas-agent'].config_options }}"
@ -126,7 +126,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-lbaasv2-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-lbaasv2-agent'].config_options }}"
@ -140,7 +140,7 @@
tags:
- upstart-init
- include: neutron_upstart_common_init.yml
- include: neutron_init_common.yml
vars:
program_name: "{{ neutron_services['neutron-vpnaas-agent'].service_name }}"
program_config_options: "{{ neutron_services['neutron-vpnaas-agent'].config_options }}"

View File

@ -0,0 +1,38 @@
---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- include: neutron_init_upstart.yml
when:
- ansible_distribution | lower == 'ubuntu'
- ansible_distribution_version | version_compare('16.04', '<')
tags:
- neutron-init
- include: neutron_init_systemd.yml
when:
- ansible_distribution | lower == 'ubuntu'
- ansible_distribution_version | version_compare('16.04', '>=')
tags:
- neutron-init
- name: Load service
service:
name: "{{ program_name }}"
enabled: "yes"
notify:
- Restart neutron services
tags:
- upstart-init
- neutron-init

View File

@ -0,0 +1,48 @@
---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create neutron TEMP dirs
file:
path: "{{ item.path }}/{{ program_name }}"
state: directory
owner: "{{ system_user }}"
group: "{{ system_group }}"
mode: "2755"
with_items:
- { path: "/var/run" }
- { path: "/var/lock" }
- name: Create tempfile.d entry
template:
src: "neutron-systemd-tempfiles.j2"
dest: "/etc/tmpfiles.d/neutron.conf"
mode: "0644"
owner: "root"
group: "root"
- name: Place the systemd init script
template:
src: "neutron-systemd-init.j2"
dest: "/etc/systemd/system/{{ program_name }}.service"
mode: "0644"
owner: "root"
group: "root"
register: systemd_init
- name: Reload the systemd daemon
command: "systemctl daemon-reload"
when: systemd_init | changed
notify:
- Restart neutron services

View File

@ -1,5 +1,5 @@
---
# Copyright 2014, Rackspace US, Inc.
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -20,8 +20,7 @@
mode: "0644"
owner: "root"
group: "root"
notify:
- Restart neutron services
register: upstart_init
tags:
- upstart-init
- neutron-init
@ -29,18 +28,7 @@
- name: Reload init scripts
shell: |
initctl reload-configuration
notify:
- Restart neutron services
tags:
- upstart-init
- neutron-init
- name: Load service
service:
name: "{{ program_name }}"
enabled: "yes"
notify:
- Restart neutron services
when: upstart_init | changed
tags:
- upstart-init
- neutron-init

View File

@ -43,6 +43,23 @@
- neutron-install
- neutron-apt-packages
- name: Install apt packages for lxb
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ neutron_lxb_apt_packages }}"
when:
- inventory_hostname in groups[neutron_services['neutron-linuxbridge-agent']['group']]
- neutron_services['neutron-linuxbridge-agent']['group'] in group_names
- neutron_services['neutron-linuxbridge-agent'].service_en | bool
tags:
- neutron-install
- neutron-apt-packages
- name: Install apt packages for LBaaS
apt:
pkg: "{{ item }}"

View File

@ -0,0 +1,25 @@
# {{ ansible_managed }}
[Unit]
Description=neutron openstack service
After=syslog.target
After=network.target
[Service]
Type=simple
User={{ system_user }}
Group={{ system_group }}
{% if program_override is defined %}
ExecStart={{ program_override }} {{ program_config_options|default('') }} --log-file=/var/log/neutron/{{ program_name }}.log
{% else %}
ExecStart={{ neutron_bin }}/{{ program_name }} {{ program_config_options|default('') }} --log-file=/var/log/neutron/{{ program_name }}.log
{% endif %}
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
Restart=on-failure
RestartSec=150
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,4 @@
# {{ ansible_managed }}
D /var/lock/{{ program_name }} 2755 {{ system_user }} {{ system_group }}
D /var/run/{{ program_name }} 2755 {{ system_user }} {{ system_group }}

View File

@ -69,7 +69,7 @@
- name: Check for iptables checksum rule
shell: |
ip netns exec {{ dhcp_namespace.stdout }} iptables -C neutron-dhcp-age-POSTROUTING -t mangle -p udp --dport 68 -j CHECKSUM --checksum-fill
ip netns exec {{ dhcp_namespace.stdout.split(' ')[0] }} iptables -C neutron-dhcp-age-POSTROUTING -t mangle -p udp --dport 68 -j CHECKSUM --checksum-fill
register: checksum_rule
until : checksum_rule.rc == 0
retries: 5

47
vars/ubuntu-16.04.yml Normal file
View File

@ -0,0 +1,47 @@
---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This has to be reworked because openvswitch packages are not part of the UCA now
# current version is included in mainstream xenial.
ovs_apt_repo: 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main'
ovs_apt_packages:
- openvswitch-common
- openvswitch-switch
## APT Cache options
cache_timeout: 600
neutron_apt_dependencies:
- conntrack
- dnsmasq-base
- dnsmasq-utils
- ebtables
- ipset
- iputils-arping
- keepalived
- libpq-dev
- radvd
neutron_lbaas_apt_packages:
- haproxy
neutron_apt_remove_packages:
- conntrackd
neutron_lbaasv1_initscript_path: "/etc/init/neutron-lbaas-agent.conf"
neutron_lbaasv2_initscript_path: "/etc/init/neutron-lbaasv2-agent.conf"
neutron_lbaasv1_agent_servicename: "neutron-lbaas-agent"
neutron_lbaasv2_agent_servicename: "neutron-lbaasv2-agent"