Continued work on implementing tftp service
Implemented a tftp installation, and installation of the required services and changes to support iPXE.
This commit is contained in:
parent
85a86f8d62
commit
84c2be4004
12
step1/files/xinetd.tftp
Normal file
12
step1/files/xinetd.tftp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
service tftp
|
||||||
|
{
|
||||||
|
protocol = udp
|
||||||
|
port = 69
|
||||||
|
socket_type = dgram
|
||||||
|
wait = yes
|
||||||
|
user = root
|
||||||
|
server = /usr/sbin/in.tftpd
|
||||||
|
server_args = --map-file /tftpboot/map-file /tftpboot
|
||||||
|
disable = no
|
||||||
|
flags = IPv4
|
||||||
|
}
|
@ -2,15 +2,17 @@
|
|||||||
# extend another packaging system
|
# extend another packaging system
|
||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: localhost
|
||||||
|
connection: local
|
||||||
name: "Install services required for ironic"
|
name: "Install services required for ironic"
|
||||||
sudo: yes
|
sudo: yes
|
||||||
gather_facts: no
|
gather_facts: yes
|
||||||
# Todo: Rip vars out, refactor.
|
# Todo: Rip vars out, refactor.
|
||||||
vars:
|
vars:
|
||||||
- driver: "abcd"
|
- driver: "abcd"
|
||||||
- dhcp_interface: "egfh"
|
- network_interface: "virbr0"
|
||||||
- ironic_db_password: aSecretPassword473z
|
- ironic_db_password: aSecretPassword473z
|
||||||
- mysql_password: password
|
- mysql_password: password
|
||||||
|
- testing: true
|
||||||
tasks:
|
tasks:
|
||||||
- name: "Update Package Cache"
|
- name: "Update Package Cache"
|
||||||
local_action: apt update_cache=yes
|
local_action: apt update_cache=yes
|
||||||
@ -18,12 +20,17 @@
|
|||||||
local_action: apt name={{ item }}
|
local_action: apt name={{ item }}
|
||||||
with_items:
|
with_items:
|
||||||
- mysql-server
|
- mysql-server
|
||||||
- dhcpd
|
- dnsmasq
|
||||||
- tftp-hpa
|
|
||||||
- rabbitmq-server
|
- rabbitmq-server
|
||||||
- python-pip
|
- python-pip
|
||||||
- python-mysqldb
|
- python-mysqldb
|
||||||
- python-configparser
|
- python-configparser
|
||||||
|
- ipxe
|
||||||
|
- tftp-hpa
|
||||||
|
- syslinux
|
||||||
|
- xinetd
|
||||||
|
- parted
|
||||||
|
- psmisc
|
||||||
- name: "Ensuring /opt/stack is present"
|
- name: "Ensuring /opt/stack is present"
|
||||||
local_action: file name=/opt/stack state=directory owner=root group=root
|
local_action: file name=/opt/stack state=directory owner=root group=root
|
||||||
- name: "Downloading ironic"
|
- name: "Downloading ironic"
|
||||||
@ -62,3 +69,23 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- { service_name: 'ironic-api', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
|
- { service_name: 'ironic-api', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
|
||||||
- { service_name: 'ironic-conductor', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
|
- { service_name: 'ironic-conductor', username: 'ironic', args: '--config-file /etc/ironic/ironic.conf'}
|
||||||
|
- name: "Start ironic-conductor"
|
||||||
|
local_action: service name=ironic-conductor state=started
|
||||||
|
- name: "Start ironic-api"
|
||||||
|
local_action: service name=ironic-api state=started
|
||||||
|
- name: "Setting up PXE and iPXE folders"
|
||||||
|
local_action: file name={{item}} owner=ironic group=ironic state=directory
|
||||||
|
with_items:
|
||||||
|
- /tftpboot
|
||||||
|
- /tftpboot/pxelinux.cfg
|
||||||
|
- /httpboot
|
||||||
|
- name: "Placing pxelinux.0"
|
||||||
|
local_action: copy src=/usr/lib/syslinux/pxelinux.0 dest=/tftpboot
|
||||||
|
- name: "Place tftp config file"
|
||||||
|
local_action: copy src=files/xinetd.tftp dest=/etc/xinetd.d/tftp
|
||||||
|
- name: "Ensuring xinetd is running"
|
||||||
|
local_action: service name=xinetd state=started
|
||||||
|
- name: "Sending xinetd a reload signal"
|
||||||
|
local_action: service name=xinetd state=reloaded
|
||||||
|
- name: "Copy iPXE image into place"
|
||||||
|
local_action: copy src=/usr/lib/ipxe/undionly.kpxe dest=/tftpboot/
|
||||||
|
@ -1258,17 +1258,17 @@ connection=mysql://ironic:{{ ironic_db_password }}@localhost/ironic?charset=utf8
|
|||||||
|
|
||||||
# IP address of Ironic compute node's tftp server. (string
|
# IP address of Ironic compute node's tftp server. (string
|
||||||
# value)
|
# value)
|
||||||
#tftp_server=$my_ip
|
tftp_server={{ hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] }}
|
||||||
|
|
||||||
# Ironic compute node's tftp root path. (string value)
|
# Ironic compute node's tftp root path. (string value)
|
||||||
#tftp_root=/tftpboot
|
tftp_root=/tftpboot
|
||||||
|
|
||||||
# Directory where master tftp images are stored on disk.
|
# Directory where master tftp images are stored on disk.
|
||||||
# (string value)
|
# (string value)
|
||||||
#tftp_master_path=/tftpboot/master_images
|
#tftp_master_path=/tftpboot/master_images
|
||||||
|
|
||||||
# Bootfile DHCP parameter. (string value)
|
# Bootfile DHCP parameter. (string value)
|
||||||
#pxe_bootfile_name=pxelinux.0
|
pxe_bootfile_name=undionly.kpxe
|
||||||
|
|
||||||
# Bootfile DHCP parameter for UEFI boot mode. (string value)
|
# Bootfile DHCP parameter for UEFI boot mode. (string value)
|
||||||
#uefi_pxe_bootfile_name=elilo.efi
|
#uefi_pxe_bootfile_name=elilo.efi
|
||||||
@ -1278,13 +1278,13 @@ connection=mysql://ironic:{{ ironic_db_password }}@localhost/ironic?charset=utf8
|
|||||||
#http_url=<None>
|
#http_url=<None>
|
||||||
|
|
||||||
# Ironic compute node's HTTP root path. (string value)
|
# Ironic compute node's HTTP root path. (string value)
|
||||||
#http_root=/httpboot
|
http_root=/httpboot
|
||||||
|
|
||||||
# Enable iPXE boot. (boolean value)
|
# Enable iPXE boot. (boolean value)
|
||||||
#ipxe_enabled=false
|
ipxe_enabled=true
|
||||||
|
|
||||||
# The path to the main iPXE script file. (string value)
|
# The path to the main iPXE script file. (string value)
|
||||||
#ipxe_boot_script=$pybasedir/drivers/modules/boot.ipxe
|
ipxe_boot_script=$pybasedir/drivers/modules/boot.ipxe
|
||||||
|
|
||||||
|
|
||||||
[seamicro]
|
[seamicro]
|
||||||
|
Loading…
Reference in New Issue
Block a user