diff --git a/multi-node-aio-xenial-ansible/create_pxeboot_server.yml b/multi-node-aio-xenial-ansible/create_pxeboot_server.yml new file mode 100644 index 00000000..c9b6d23a --- /dev/null +++ b/multi-node-aio-xenial-ansible/create_pxeboot_server.yml @@ -0,0 +1,128 @@ +--- +# 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 + tftp_mirror: archive.ubuntu.com + 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 + + # These below variables rely on apache being set up and is where the preseed is set up + preseed_apache_url: pxe + preseed_path: /var/www/pxe + + # - 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 + hwaddr: "52:54:00:bd:81:40" + ip: "10.0.0.140" + distro: xenial + preseed_file: ubuntu-server-16.04-unattended-cinder.seed + + - name: cinder2 + hwaddr: "52:54:00:bd:81:41" + ip: "10.0.0.141" + 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 + hwaddr: "52:54:00:bd:81:30" + ip: "10.0.0.130" + distro: xenial + preseed_file: ubuntu-server-16.04-unattended-nova_compute.seed + + - name: compute2 + hwaddr: "52:54:00:bd:81:31" + ip: "10.0.0.131" + distro: xenial + preseed_file: ubuntu-server-16.04-unattended-nova_compute.seed + + - name: swift1 + hwaddr: "52:54:00:bd:81:50" + ip: "10.0.0.150" + distro: xenial + preseed_file: ubuntu-server-16.04-unattended-swift.seed + + - name: swift2 + hwaddr: "52:54:00:bd:81:51" + ip: "10.0.0.151" + distro: xenial + preseed_file: ubuntu-server-16.04-unattended-swift.seed + + - name: swift3 + hwaddr: "52:54:00:bd:81:52" + ip: "10.0.0.152" + distro: xenial + preseed_file: ubuntu-server-16.04-unattended-swift.seed + + roles: + - { role: proxy_install, when: proxy|length > 0 } + - { role: dhcpd_install } + - { role: atftpd_install } + - { role: tftpboot_configure } + - { role: apache_install, url: "{{ preseed_apache_url }}", publish_root: "{{ preseed_path }}" } + - { role: apache_install, url: files, publish_root: /var/www/html } diff --git a/multi-node-aio-xenial-ansible/inventory b/multi-node-aio-xenial-ansible/inventory new file mode 100644 index 00000000..df8b5f69 --- /dev/null +++ b/multi-node-aio-xenial-ansible/inventory @@ -0,0 +1,2 @@ +[all] +localhost ansible_connection=local