Merge "Add 16.04 support"

This commit is contained in:
Jenkins 2016-06-02 21:02:00 +00:00 committed by Gerrit Code Review
commit 47b2e04b4b
17 changed files with 317 additions and 90 deletions

View File

@ -150,26 +150,6 @@ ironic_pip_packages:
- pycrypto - pycrypto
- python-memcached - python-memcached
ironic_api_apt_packages:
- apache2
- apache2-utils
- libapache2-mod-wsgi
ironic_conductor_apt_packages:
- libxml2-dev
- syslinux
- syslinux-common
- libxslt1-dev
- qemu-utils
- libpq-dev
- python-yaml
- open-iscsi
- ipmitool
- tftpd-hpa
ironic_conductor_standalone_apt_packages:
- isc-dhcp-server
## RabbitMQ info ## RabbitMQ info
ironic_rabbitmq_userid: ironic ironic_rabbitmq_userid: ironic
ironic_rabbitmq_vhost: /ironic ironic_rabbitmq_vhost: /ironic

View File

@ -22,6 +22,7 @@ galaxy_info:
- name: Ubuntu - name: Ubuntu
versions: versions:
- trusty - trusty
- xenial
categories: categories:
- cloud - cloud
- baremetal - baremetal
@ -33,6 +34,8 @@ dependencies:
- role: pip_install - role: pip_install
when: when:
- ironic_developer_mode | bool - ironic_developer_mode | bool
- apt_package_pinning - role: apt_package_pinning
when:
- ansible_pkg_mgr == 'apt'
- galera_client - galera_client
- openstack_openrc - openstack_openrc

View File

@ -0,0 +1,3 @@
---
features:
- The ``ironic`` role now supports Ubuntu 16.04 and SystemD.

View File

@ -13,15 +13,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: Install ironic-api specific apt packages - include: ironic_install_apt.yml
apt: when:
pkg: "{{ item }}" - ansible_pkg_mgr == 'apt'
state: latest vars:
register: install_packages apt_pkgs: "{{ ironic_api_apt_packages }}"
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ ironic_api_apt_packages }}"
tags: tags:
- ironic-install - ironic-install
- ironic-api - ironic-api

View File

@ -13,30 +13,22 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: Install ironic-conductor specific apt packages - include: ironic_install_apt.yml
apt: when:
pkg: "{{ item }}" - ansible_pkg_mgr == 'apt'
state: latest vars:
register: install_packages apt_pkgs: "{{ ironic_conductor_apt_packages }}"
until: install_packages|success
retries: 5
delay: 2
with_items: "{{ ironic_conductor_apt_packages }}"
tags: tags:
- ironic-install - ironic-install
- ironic-conductor - ironic-conductor
- ironic-apt-packages - ironic-apt-packages
- name: Install ironic-conductor standalone apt packages - include: ironic_install_apt.yml
apt: when:
pkg: "{{ item }}" - ansible_pkg_mgr == 'apt'
state: latest - ironic_standalone
register: install_packages vars:
until: install_packages|success apt_pkgs: "{{ ironic_conductor_standalone_apt_packages }}"
retries: 5
delay: 2
with_items: "{{ ironic_conductor_standalone_apt_packages }}"
when: ironic_standalone
tags: tags:
- ironic-install - ironic-install
- ironic-conductor - ironic-conductor

View File

@ -56,7 +56,7 @@
## there is no idempotent way of doing this without several tasks ## there is no idempotent way of doing this without several tasks
## which is a wasted effort. ## which is a wasted effort.
- name: Copy syslinux pxlinux.0 - name: Copy syslinux pxlinux.0
command: cp /usr/lib/syslinux/pxelinux.0 /tftpboot/pxelinux.0 command: "cp {{ ironic_pxelinux_path }} /tftpboot/pxelinux.0"
tags: tags:
- tftpd-hpa - tftpd-hpa
@ -65,6 +65,6 @@
## there is no idempotent way of doing this without several tasks ## there is no idempotent way of doing this without several tasks
## which is a wasted effort. ## which is a wasted effort.
- name: Copy syslinux chain.c32 - name: Copy syslinux chain.c32
command: cp /usr/lib/syslinux/chain.c32 /tftpboot/chain.c32 command: "cp {{ ironic_chainc32_path }} /tftpboot/chain.c32"
tags: tags:
- tftpd-hpa - tftpd-hpa

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- include: ironic_upstart_common_init.yml - include: ironic_init_common.yml
vars: vars:
program_name: "{{ ironic_conductor_program_name }}" program_name: "{{ ironic_conductor_program_name }}"
service_name: "{{ ironic_service_name }}" service_name: "{{ ironic_service_name }}"

View File

@ -0,0 +1,31 @@
---
# 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: ironic_init_upstart.yml
when: pid1_name == "init"
tags:
- ironic-init
- include: ironic_init_systemd.yml
when: pid1_name == "systemd"
tags:
- ironic-init
- name: Load service
service:
name: "{{ program_name }}"
enabled: "yes"
notify:
- Restart ironic services

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 ironic 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: "ironic-systemd-tempfiles.j2"
dest: "/etc/tmpfiles.d/ironic.conf"
mode: "0644"
owner: "root"
group: "root"
- name: Place the systemd init script
template:
src: "ironic-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 ironic services

View File

@ -20,27 +20,13 @@
mode: "0644" mode: "0644"
owner: "root" owner: "root"
group: "root" group: "root"
register: upstart_init
notify: notify:
- Restart ironic services - Restart ironic services
tags:
- upstart-init
- ironic-init
- name: Reload init scripts - name: Reload init scripts
shell: | shell: |
initctl reload-configuration initctl reload-configuration
when: upstart_init | changed
notify: notify:
- Restart ironic services - Restart ironic services
tags:
- upstart-init
- ironic-init
- name: Load service
service:
name: "{{ program_name }}"
enabled: "yes"
notify:
- Restart ironic services
tags:
- upstart-init
- ironic-init

View File

@ -26,6 +26,17 @@
- ironic-install - ironic-install
- ironic-pip-packages - ironic-pip-packages
- include: ironic_install_apt.yml
when:
- ansible_pkg_mgr == 'apt'
- ironic_developer_mode | bool
vars:
apt_pkgs: "{{ ironic_developer_apt_packages }}"
tags:
- ironic-install
- ironic-apt
- ironic-apt-packages
- name: Clone requirements git repository - name: Clone requirements git repository
git: git:
repo: "{{ ironic_requirements_git_repo }}" repo: "{{ ironic_requirements_git_repo }}"

View File

@ -0,0 +1,39 @@
---
# 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: Update apt sources
apt:
update_cache: yes
cache_valid_time: "{{ cache_timeout }}"
register: apt_update
until: apt_update|success
retries: 5
delay: 2
tags:
- ironic-apt-packages
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items:
- "{{ apt_pkgs }}"
tags:
- ironic-install
- ironic-apt-packages

View File

@ -13,33 +13,56 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- include: ironic_pre_install.yml - name: Check init system
- include: ironic_install.yml command: cat /proc/1/comm
register: _pid1_name
tags:
- always
- include: ironic_api_install.yml - name: Set the name of pid1
when: > set_fact:
inventory_hostname in groups['ironic_api'] pid1_name: "{{ _pid1_name.stdout }}"
tags:
- always
- include: ironic_conductor_install.yml - name: Gather variables for each operating system
when: > include_vars: "{{ item }}"
inventory_hostname in groups['ironic_conductor'] with_first_found:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
tags:
- always
- include: ironic_post_install.yml - include: ironic_pre_install.yml
- include: ironic_install.yml
- include: ironic_api_post_install.yml - include: ironic_api_install.yml
when: > when: >
inventory_hostname in groups['ironic_api'] inventory_hostname in groups['ironic_api']
- include: ironic_conductor_post_install.yml - include: ironic_conductor_install.yml
when: > when: >
inventory_hostname in groups['ironic_conductor'] inventory_hostname in groups['ironic_conductor']
- include: ironic_db_setup.yml - include: ironic_post_install.yml
when: >
inventory_hostname == groups['ironic_conductor'][0]
- include: ironic_upstart_init.yml - include: ironic_api_post_install.yml
when: >
inventory_hostname in groups['ironic_api']
- include: ironic_service_setup.yml - include: ironic_conductor_post_install.yml
when: > when: >
inventory_hostname == groups['ironic_api'][0] inventory_hostname in groups['ironic_conductor']
- include: ironic_db_setup.yml
when: >
inventory_hostname == groups['ironic_conductor'][0]
- include: ironic_init.yml
- include: ironic_service_setup.yml
when: >
inventory_hostname == groups['ironic_api'][0]

View File

@ -0,0 +1,25 @@
# {{ ansible_managed }}
[Unit]
Description=ironic 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/ironic/{{ program_name }}.log
{% else %}
ExecStart={{ ironic_bin }}/{{ program_name }} {{ program_config_options|default('') }} --log-file=/var/log/ironic/{{ 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 }}

42
vars/ubuntu-14.04.yml Normal file
View File

@ -0,0 +1,42 @@
---
# 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.
cache_timeout: 600
ironic_developer_apt_packages:
- git-core
ironic_api_apt_packages:
- apache2
- apache2-utils
- libapache2-mod-wsgi
ironic_conductor_apt_packages:
- libxml2-dev
- syslinux
- syslinux-common
- libxslt1-dev
- qemu-utils
- libpq-dev
- python-yaml
- open-iscsi
- ipmitool
- tftpd-hpa
ironic_conductor_standalone_apt_packages:
- isc-dhcp-server
ironic_pxelinux_path: "/usr/lib/syslinux/pxelinux.0"
ironic_chainc32_path: "/usr/lib/syslinux/chain.c32"

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

@ -0,0 +1,44 @@
---
# 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.
cache_timeout: 600
ironic_developer_apt_packages:
- git-core
- libffi-dev
ironic_api_apt_packages:
- apache2
- apache2-utils
- libapache2-mod-wsgi
ironic_conductor_apt_packages:
- libxml2-dev
- syslinux
- syslinux-common
- pxelinux
- libxslt1-dev
- qemu-utils
- libpq-dev
- python-yaml
- open-iscsi
- ipmitool
- tftpd-hpa
ironic_conductor_standalone_apt_packages:
- isc-dhcp-server
ironic_pxelinux_path: "/usr/lib/PXELINUX/pxelinux.0"
ironic_chainc32_path: "/usr/lib/syslinux/modules/efi64/chain.c32"