2017-02-03 18:12:32 +00:00
---
# 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.
#
# create_pxeboot_server.yml
#
# This playbook contains all the data to deploy a PXE server with TFTP/ Apache and the preseed
# environment for Ubuntu Xenial. This is to replace Cobbler.
- hosts : all
become : yes
become_method : sudo
vars :
proxy : "{{ lookup('env','http_proxy') }}"
# - List of DHCP Subnets
dhcp_list :
- netmask : 255.255 .255 .0
gateway : 10.0 .0 .200
dns : "{{ ansible_dns.nameservers.0 }}"
subnet : 10.0 .0 .0 # Subnet mask
default_lease_time : 21600 # Subnet Default lease time - The default is used if this is not defined
max_lease_time : 43200 # Subnet Max lease time - The default is used if this is not defined
tftp_boot_path : /pxelinux.0 # Path for tftp of where to boot from first - The default is used if this is not defined
tftp_server : 10.0 .0 .200 # The server hosting the TFTP server - The default is used if this is not defined
dhcp_default_domain_name : openstackci.local # The domain-name option - the above global default is used if this is not defined
# - tftpboot_configure
2017-07-19 23:51:49 -05:00
tftp_mirror : 10.0 .0 .200
2017-02-03 18:12:32 +00:00
tftp_proxy : "{{ proxy }}"
webserver_ip_address : 10.0 .0 .200
ntp_server : "{{ lookup('pipe','grep -m 1 pool /etc/ntp.conf').split(' ').1 }}" # Check in NTP directory, look for the first pool match and use as our NTP server
atftpd_path : /srv/tftp
tftp_source : /srv/tftp/pxelinux.cfg
atftp_user : atftp
atftp_group : atftp
2017-07-19 23:51:49 -05:00
distro_name : ubuntu-16.04.2-server-amd64.iso
distro_url : "http://releases.ubuntu.com/16.04/{{ distro_name }}"
2017-02-03 18:12:32 +00:00
# These below variables rely on apache being set up and is where the preseed is set up
2017-07-19 23:51:49 -05:00
apache_url : files
apache_path : /var/www/html
tftp_directories :
- pxe
- ubuntu
2017-02-03 18:12:32 +00:00
# - List of static DHCP hosts - These are iterated though and each will be created
# last byte of hwaddr matches last two digits of ip address
server_list :
- name : cinder1
2017-07-19 23:51:49 -05:00
hwaddr : "52:54:00:bd:81:30"
ip : "10.0.0.130"
2017-02-03 18:12:32 +00:00
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-cinder.seed
- name : cinder2
2017-07-19 23:51:49 -05:00
hwaddr : "52:54:00:bd:81:31"
ip : "10.0.0.131"
2017-02-03 18:12:32 +00:00
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-cinder.seed
- name : infra1
hwaddr : "52:54:00:bd:81:00"
ip : "10.0.0.100"
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-infra.seed
- name : infra2
hwaddr : "52:54:00:bd:81:01"
ip : "10.0.0.101"
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-infra.seed
- name : infra3
hwaddr : "52:54:00:bd:81:02"
ip : "10.0.0.102"
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-infra.seed
- name : logging1
hwaddr : "52:54:00:bd:81:10"
ip : "10.0.0.110"
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-logging.seed
- name : compute1
2017-07-19 23:51:49 -05:00
hwaddr : "52:54:00:bd:81:20"
ip : "10.0.0.120"
2017-02-03 18:12:32 +00:00
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-nova_compute.seed
- name : compute2
2017-07-19 23:51:49 -05:00
hwaddr : "52:54:00:bd:81:21"
ip : "10.0.0.121"
2017-02-03 18:12:32 +00:00
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-nova_compute.seed
- name : swift1
2017-07-19 23:51:49 -05:00
hwaddr : "52:54:00:bd:81:40"
ip : "10.0.0.140"
2017-02-03 18:12:32 +00:00
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-swift.seed
- name : swift2
2017-07-19 23:51:49 -05:00
hwaddr : "52:54:00:bd:81:41"
ip : "10.0.0.141"
2017-02-03 18:12:32 +00:00
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-swift.seed
- name : swift3
2017-07-19 23:51:49 -05:00
hwaddr : "52:54:00:bd:81:42"
ip : "10.0.0.142"
2017-02-03 18:12:32 +00:00
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-swift.seed
2017-07-19 23:51:49 -05:00
- name : deploy1
hwaddr : "52:54:00:bd:81:50"
ip : "10.0.0.150"
distro : xenial
preseed_file : ubuntu-server-16.04-unattended-deploy.seed
2017-02-03 18:12:32 +00:00
roles :
- { role: proxy_install, when : proxy|length > 0 }
- { role : dhcpd_install }
- { role : atftpd_install }
2017-07-19 23:51:49 -05:00
- { role : apache_install }
- { role : tftpboot_configure }