Isolating standalone Ironic mode

This commit is contained in:
root 2016-02-15 09:39:27 +00:00
parent fdfe0179a7
commit aabd2d9809
10 changed files with 109 additions and 32 deletions

View File

@ -70,16 +70,14 @@ ironic_service_in_ldap: False
# Is this Ironic installation working standalone?
# If you're wanting Ironic to work without being integrated to other OpenStack
# services, set this to True, and update the dhcp configuration appropriately
ironic_standalone: False
# Database
ironic_galera_user: ironic
ironic_galera_database: ironic
ironic_galera_password: gu1d0
# TBD(mrda): need to handle this a little better :)
#database_root_user: root
#database_root_password: sp4m3ggs
ironic_galera_password: "gu1d0" # TODO(mrda): Manage secrets
# Integrated Openstack configuration
ironic_openstack_driver_list: agent_ipmitool
@ -134,8 +132,6 @@ python_ironicclient_pip_packages:
ironic_conductor_apt_packages:
- libxml2-dev
- rabbitmq-server
- isc-dhcp-server
- tftpd-hpa
- syslinux
- syslinux-common
- libxslt1-dev
@ -145,6 +141,10 @@ ironic_conductor_apt_packages:
- open-iscsi
- ipmitool
ironic_conductor_standalone_apt_packages:
- isc-dhcp-server
- tftpd-hpa
ironic_conductor_pip_packages:
- mysql-python

44
files/dhcpd.conf Normal file
View File

@ -0,0 +1,44 @@
#
# Sample configuration file for Ironic deploys via
# openstack-ansible-ironic
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# This is the section of great importance to standalone ironic
# deployers. This host, as well as the deployment hosts, should
# be on the same network segment. And, if you have more than
# one ironic-conduftor, you should only run an isc-dhcp-server
# and tftpd-hpa server on one of these conductors.
#
# TODO(mrda): Enforce this in the os_ironic role
#
subnet 10.141.0.0 netmask 255.255.0.0 {
group {
# Repeat this host section for each ironic deployment host
host ironic_deploy_host_name {
hardware ethernet <tbd>; # deploy host mac address
fixed-address <tbd>; # deploy host IP address
allow booting;
allow bootp;
next-server <tbd>; # tftpd-hpa server IP addr
filename "pxelinux.0";
}
}
}

View File

@ -26,3 +26,9 @@
name: "tftpd-hpa"
state: restarted
failed_when: false
- name: Restart isc-dhcp-server
service:
name: "isc-dhcp-server"
state: restarted
failed_when: false

View File

@ -31,6 +31,20 @@
file:
path: "/etc/apache2/sites-enabled/000-default.conf"
state: "absent"
when: not ironic_standalone
notify:
- Restart ironic services
tags:
- ironic-httpd
- name: Enable default apache site vhost
file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: "{{ item.state }}"
with_items:
- { src: "/etc/apache2/sites-available/000-default.conf", dest: "/etc/apache2/sites-enabled/000-default.conf", state: "link" }
when: ironic_standalone
notify:
- Restart ironic services
tags:

View File

@ -27,6 +27,21 @@
- ironic-conductor
- ironic-apt-packages
- name: Install ironic-conductor standalone apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: ironic_conductor_standalone_apt_packages
when: ironic_standalone
tags:
- ironic-install
- ironic-conductor
- ironic-apt-packages
- name: Install ironic-conductor specific pip dependencies
pip:
name: "{{ item }}"

View File

@ -13,6 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Copy in sample dhcpd.conf file
copy:
src: dhcpd.conf
dest: /etc/dhcp/
when: ironic_standalone
notify:
- Restart isc-dhcp-server
tags:
- tftpd-hpa
- name: Create /tftpboot
file:
path: "/tftpboot"
@ -20,6 +30,7 @@
owner: "{{ ironic_system_user_name }}"
group: "{{ ironic_system_group_name }}"
mode: "0755"
when: ironic_standalone
tags:
- tftpd-hpa
@ -27,6 +38,7 @@
copy:
src: tftpd-hpa
dest: /etc/default/tftpd-hpa
when: ironic_standalone
notify:
- Restart tftpd-hpa
tags:
@ -36,6 +48,7 @@
copy:
src: map-file
dest: /tftpboot/map-file
when: ironic_standalone
notify:
- Restart tftpd-hpa
tags:
@ -44,30 +57,32 @@
- name: Check to see if pxlinux.0 is required
stat: path=/tftpboot/pxelinux.0
register: pxelinux_exists
when: ironic_standalone
tags:
- tftpd-hpa
- name: Check to see if chain.c32 is required
stat: path=/tftpboot/chain.c32
register: chain32_exists
when: ironic_standalone
tags:
- tftpd-hpa
- name: Check pxlinux.0 exists
stat: path=/usr/lib/syslinux/pxelinux.0
register: pxelinux_stat
when: not pxelinux_exists
when: not pxelinux_exists and ironic_standalone
tags:
- tftpd-hpa
- name: Copy syslinux pxlinux.0
command: cp /usr/lib/syslinux/pxelinux.0 /tftpboot/pxelinux.0
when: not pxelinux_exists and pxelinux_stat.stat.exists
when: not pxelinux_exists and pxelinux_stat.stat.exists and ironic_standalone
tags:
- tftpd-hpa
- name: Copy syslinux chain.c32
command: cp /usr/lib/syslinux/chain.c32 /tftpboot/chain.c32
when: not chain32_exists and chain32_stat.stat.exists
when: not chain32_exists and chain32_stat.stat.exists and ironic_standalone
tags:
- tftpd-hpa

View File

@ -41,24 +41,12 @@
tags:
- ironic-db-setup
#- name: Create database schema
## command: "{{ ironic_bin }}/ironic-dbsync --config-file /etc/ironic/ironic.conf create_schema"
# sudo: yes
# sudo_user: "{{ ironic_system_user_name }}"
# notify:
# - Restart ironic services
# when: ironic_db.changed == True
# tags:
# - ironic-db-setup
# - ironic-conductor
- name: Update database schema
command: "{{ ironic_bin }}/ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade"
sudo: yes
sudo_user: "{{ ironic_system_user_name }}"
notify:
- Restart ironic services
# when: ironic_db.changed == False
tags:
- ironic-db-setup
- ironic-conductor

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: create the system group
- name: Create the system group
group:
name: "{{ ironic_system_group_name }}"
state: "present"

View File

@ -13,15 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#- include: ironic_upstart_common_init.yml
# vars:
# program_name: "{{ ironic_api_program_name }}"
# service_name: "{{ ironic_service_name }}"
# system_user: "{{ ironic_system_user_name }}"
# system_group: "{{ ironic_system_group_name }}"
# service_home: "{{ ironic_system_home_folder }}"
# when: inventory_hostname in groups['ironic_api']
- include: ironic_upstart_common_init.yml
vars:
program_name: "{{ ironic_conductor_program_name }}"

View File

@ -1,3 +1,7 @@
# {{ ansible_managed }}
Listen {{ ironic_service_port }}
{% if ironic_standalone %}
Listen 80
{% endif %}