Merge pull request #41 from Divius/ironic-discoverd
Switch Ironic hardware discovery to ironic-discoverd
This commit is contained in:
commit
acfee6d99a
|
@ -0,0 +1,3 @@
|
||||||
|
This an element for installing and configuring
|
||||||
|
[ironic-discoverd](https://pypi.python.org/pypi/ironic-discoverd) -
|
||||||
|
daemon for doing hardware parameters discovery using PXE and special ramdisk.
|
|
@ -0,0 +1,3 @@
|
||||||
|
os-svc-install
|
||||||
|
os-apply-config
|
||||||
|
os-refresh-config
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# just starts the discovery dnsmasq process
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
# TODO(marios): add systemd Environment or EnvironmentFile and upstart
|
||||||
|
# env for IFACE and DISCOVERY_POOL
|
||||||
|
# IFACE=br-ctlplane
|
||||||
|
# DISCOVERY_POOL=192.0.2.100,192.0.2.120
|
||||||
|
|
||||||
|
install-packages dnsmasq dnsmasq-utils
|
||||||
|
# make sure tftpboot is labelled correctly
|
||||||
|
mkdir -p /tftpboot
|
||||||
|
restorecon -R /tftpboot
|
||||||
|
cat > /lib/systemd/system/discovery-dhcp-dnsmasq.service << eof
|
||||||
|
[Unit]
|
||||||
|
Description=Discovery dhcp dnsmasq service
|
||||||
|
After=openvswitch.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/sbin/dnsmasq --conf-file= \\
|
||||||
|
--port=0 \\
|
||||||
|
--enable-tftp \\
|
||||||
|
--tftp-root=/tftpboot \\
|
||||||
|
--dhcp-boot=pxelinux.0,localhost.localdomain,192.0.2.1 \\
|
||||||
|
--bind-interfaces \\
|
||||||
|
--pid-file=/var/run/dnsmasq.pid \\
|
||||||
|
--interface=br-ctlplane \\
|
||||||
|
--dhcp-range=192.0.2.100,192.0.2.120,29
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
Alias=discovery-dhcp-dnsmasq.service
|
||||||
|
eof
|
||||||
|
|
||||||
|
# Enable the service
|
||||||
|
os-svc-enable -n discovery-dhcp-dnsmasq
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
pip install ironic-discoverd
|
||||||
|
os-svc-daemon -n ironic-discoverd -i /usr -u root -c ironic-discoverd /etc/ironic-discoverd/discoverd.conf
|
||||||
|
install -d -m 0750 -o root -g root /etc/ironic-discoverd
|
||||||
|
install -d -m 0755 -o ironic -g ironic /tftpboot/pxelinux.cfg
|
||||||
|
|
||||||
|
# Enable the service
|
||||||
|
os-svc-enable -n ironic-discoverd
|
|
@ -0,0 +1,5 @@
|
||||||
|
[discoverd]
|
||||||
|
os_auth_url = http://{{keystone.host}}:5000/v2.0
|
||||||
|
os_username = ironic
|
||||||
|
os_password = {{ironic.service-password}}
|
||||||
|
os_tenant_name = service
|
|
@ -0,0 +1,7 @@
|
||||||
|
default discover
|
||||||
|
|
||||||
|
label discover
|
||||||
|
kernel discovery.kernel
|
||||||
|
append initrd=discovery.ramdisk ironic_callback_url=http://{{local-ipv4}}:5050/v1/continue
|
||||||
|
ipappend 3
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# (re)starts the discovery dnsmasq process. This is just for
|
||||||
|
# plumbing... there is currently no configuration (eventually use
|
||||||
|
# os-apply-config to get a dnsmasq.conf)
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
os-svc-restart -n discovery-dhcp-dnsmasq
|
||||||
|
os-svc-restart -n ironic-discoverd
|
|
@ -45,7 +45,7 @@
|
||||||
"tuskar-ui",
|
"tuskar-ui",
|
||||||
"glance-wsme",
|
"glance-wsme",
|
||||||
"dib-run-parts-update",
|
"dib-run-parts-update",
|
||||||
"discovery-dhcp",
|
"ironic-discoverd",
|
||||||
"element-manifest",
|
"element-manifest",
|
||||||
"tuskar"
|
"tuskar"
|
||||||
],
|
],
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
"ceilometer-undercloud-config",
|
"ceilometer-undercloud-config",
|
||||||
"tuskar-ui",
|
"tuskar-ui",
|
||||||
"dib-run-parts-update",
|
"dib-run-parts-update",
|
||||||
"discovery-dhcp",
|
"ironic-discoverd",
|
||||||
"element-manifest",
|
"element-manifest",
|
||||||
"tuskar"
|
"tuskar"
|
||||||
],
|
],
|
||||||
|
|
|
@ -24,14 +24,3 @@ mkdir -p "$TFTP_ROOT"
|
||||||
|
|
||||||
glance image-download --file "$TFTP_ROOT/discovery.kernel" discovery-kernel
|
glance image-download --file "$TFTP_ROOT/discovery.kernel" discovery-kernel
|
||||||
glance image-download --file "$TFTP_ROOT/discovery.ramdisk" discovery-ramdisk
|
glance image-download --file "$TFTP_ROOT/discovery.ramdisk" discovery-ramdisk
|
||||||
|
|
||||||
mkdir -p "$TFTP_ROOT/pxelinux.cfg"
|
|
||||||
|
|
||||||
cat > "$TFTP_ROOT/pxelinux.cfg/default" <<EOF
|
|
||||||
default discover
|
|
||||||
|
|
||||||
label discover
|
|
||||||
kernel discovery.kernel
|
|
||||||
append initrd=discovery.ramdisk ironic_callback_url=$CALLBACK
|
|
||||||
ipappend 3
|
|
||||||
EOF
|
|
||||||
|
|
Loading…
Reference in New Issue