From 20f6732f682ac459d804604b19bc4f42431872b8 Mon Sep 17 00:00:00 2001 From: Larry Smith Jr Date: Tue, 4 Apr 2017 11:43:43 -0400 Subject: [PATCH] Updated to add netboot Signed-off-by: Larry Smith Jr --- README.md | 45 +++++++++++++++++++++--------------------- defaults/main.yml | 11 +++++++++-- meta/main.yml | 3 ++- tasks/config_tftpd.yml | 13 ++++++++++++ 4 files changed, 47 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 7287f66..7382b23 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ Role Name ========= -Installs and configures tftpd-hpa role. - -[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-tftpd-hpa.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-tftpd-hpa) +An [Ansible] role to install/configure [tftpd-hpa] Requirements ------------ @@ -13,12 +11,19 @@ None Role Variables -------------- -```` +``` --- # defaults file for ansible-tftpd-hpa -tftp_directory: '/var/lib/tftpboot' #defines tftp root directory -tftp_options: '--secure -c' #defines tftp options for daemon...(-c allow new files to be created) -```` + +# Defines tftp root directory +tftp_directory: '/var/lib/tftpboot' + +# Defines tftp options for daemon...(-c allow new files to be created) +tftp_options: '--secure -c' + +tftp_netboot_file: 'netboot.tar.gz' +tftp_netboot_url: 'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-amd64/current/images/netboot' +``` Dependencies ------------ @@ -28,25 +33,15 @@ None Example Playbook ---------------- -#### GitHub -```` -- hosts: all +``` +--- +- hosts: tftp_servers become: true vars: roles: - role: ansible-tftpd-hpa tasks: -```` - -#### Galaxy -```` -- hosts: all - become: true - vars: - roles: - - role: mrlesmithjr.tftpd-hpa - tasks: -```` +``` License ------- @@ -56,4 +51,10 @@ BSD Author Information ------------------ -An optional section for the role authors to include contact information, or a website (HTML is not allowed). +Larry Smith Jr. +- @mrlesmithjr +- http://everythingshouldbevirtual.com +- mrlesmithjr [at] gmail.com + +[Ansible]: +[tftpd-hpa]: diff --git a/defaults/main.yml b/defaults/main.yml index efffa24..f6c1b7d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,11 @@ --- # defaults file for ansible-tftpd-hpa -tftp_directory: '/var/lib/tftpboot' #defines tftp root directory -tftp_options: '--secure -c' #defines tftp options for daemon...(-c allow new files to be created) + +# Defines tftp root directory +tftp_directory: '/var/lib/tftpboot' + +# Defines tftp options for daemon...(-c allow new files to be created) +tftp_options: '--secure -c' + +tftp_netboot_file: 'netboot.tar.gz' +tftp_netboot_url: 'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-amd64/current/images/netboot' diff --git a/meta/main.yml b/meta/main.yml index 4100431..8b879f7 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,6 +1,6 @@ galaxy_info: author: Larry Smith Jr. - description: Installs and configures tftpd-hpa role. + description: An [Ansible] role to install/configure [tftpd-hpa] #company: your company (optional) # If the issue tracker for your role is not on github, uncomment the @@ -111,6 +111,7 @@ galaxy_info: - trusty # - utopic # - vivid + - xenial #- name: SLES # versions: # - all diff --git a/tasks/config_tftpd.yml b/tasks/config_tftpd.yml index cdd49e4..e756f8e 100644 --- a/tasks/config_tftpd.yml +++ b/tasks/config_tftpd.yml @@ -23,3 +23,16 @@ group: root mode: 0644 notify: restart tftpd-hpa + +- name: config_tftpd | Downloading Netboot + get_url: + url: "{{ tftp_netboot_url }}/{{ tftp_netboot_file }}" + dest: "{{ tftp_directory }}/{{ tftp_netboot_file }}" + +- name: config_tftpd | Extracting Netboot + unarchive: + src: "{{ tftp_directory }}/{{ tftp_netboot_file }}" + dest: "{{ tftp_directory }}" + copy: no + args: + creates: "{{ tftp_directory }}/pxelinux.0"