Cleaned up tasks and etc.
This commit is contained in:
parent
20f6732f68
commit
007d5809e6
7 changed files with 39 additions and 197 deletions
49
README.md
49
README.md
|
@ -1,39 +1,22 @@
|
||||||
Role Name
|
# ansible-tftpd-hpa
|
||||||
=========
|
|
||||||
|
|
||||||
An [Ansible] role to install/configure [tftpd-hpa]
|
An [Ansible](https://www.ansible.com) role to install/configure `tftpd-hpa`.
|
||||||
|
|
||||||
Requirements
|
## Requirements
|
||||||
------------
|
|
||||||
|
|
||||||
None
|
None
|
||||||
|
|
||||||
Role Variables
|
## Role Variables
|
||||||
--------------
|
|
||||||
|
|
||||||
```
|
[defaults/main.yml](defaults/main.yml)
|
||||||
---
|
|
||||||
# defaults file for ansible-tftpd-hpa
|
|
||||||
|
|
||||||
# Defines tftp root directory
|
## Dependencies
|
||||||
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
|
|
||||||
------------
|
|
||||||
|
|
||||||
None
|
None
|
||||||
|
|
||||||
Example Playbook
|
## Example Playbook
|
||||||
----------------
|
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
---
|
---
|
||||||
- hosts: tftp_servers
|
- hosts: tftp_servers
|
||||||
become: true
|
become: true
|
||||||
|
@ -43,18 +26,14 @@ Example Playbook
|
||||||
tasks:
|
tasks:
|
||||||
```
|
```
|
||||||
|
|
||||||
License
|
## License
|
||||||
-------
|
|
||||||
|
|
||||||
BSD
|
MIT
|
||||||
|
|
||||||
Author Information
|
## Author Information
|
||||||
------------------
|
|
||||||
|
|
||||||
Larry Smith Jr.
|
Larry Smith Jr.
|
||||||
- @mrlesmithjr
|
|
||||||
- http://everythingshouldbevirtual.com
|
|
||||||
- mrlesmithjr [at] gmail.com
|
|
||||||
|
|
||||||
[Ansible]: <https://www.ansible.com>
|
- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr)
|
||||||
[tftpd-hpa]: <https://help.ubuntu.com/community/TFTP>
|
- [EverythingShouldBeVirtual](http://www.everythingshouldbevirtual.com)
|
||||||
|
- [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com)
|
|
@ -2,10 +2,11 @@
|
||||||
# defaults file for ansible-tftpd-hpa
|
# defaults file for ansible-tftpd-hpa
|
||||||
|
|
||||||
# Defines tftp root directory
|
# Defines tftp root directory
|
||||||
tftp_directory: '/var/lib/tftpboot'
|
tftp_directory: /var/lib/tftpboot
|
||||||
|
|
||||||
# Defines tftp options for daemon...(-c allow new files to be created)
|
# Defines tftp options for daemon...(-c allow new files to be created)
|
||||||
tftp_options: '--secure -c'
|
tftp_options: --secure -c
|
||||||
|
|
||||||
tftp_netboot_file: 'netboot.tar.gz'
|
tftp_netboot_enable: false
|
||||||
tftp_netboot_url: 'http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-amd64/current/images/netboot'
|
tftp_netboot_file: netboot.tar.gz
|
||||||
|
tftp_netboot_url: http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-amd64/current/images/netboot
|
||||||
|
|
|
@ -2,5 +2,6 @@
|
||||||
# handlers file for ansible-tftpd-hpa
|
# handlers file for ansible-tftpd-hpa
|
||||||
- name: restart tftpd-hpa
|
- name: restart tftpd-hpa
|
||||||
service:
|
service:
|
||||||
name: "tftpd-hpa"
|
name: tftpd-hpa
|
||||||
state: restarted
|
state: restarted
|
||||||
|
become: true
|
||||||
|
|
136
meta/main.yml
136
meta/main.yml
|
@ -1,150 +1,18 @@
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Larry Smith Jr.
|
author: Larry Smith Jr.
|
||||||
description: An [Ansible] role to install/configure [tftpd-hpa]
|
description: An [Ansible] role to install/configure [tftpd-hpa]
|
||||||
#company: your company (optional)
|
license: MIT
|
||||||
|
|
||||||
# If the issue tracker for your role is not on github, uncomment the
|
|
||||||
# next line and provide a value
|
|
||||||
# issue_tracker_url: http://example.com/issue/tracker
|
|
||||||
|
|
||||||
# Some suggested licenses:
|
|
||||||
# - BSD (default)
|
|
||||||
# - MIT
|
|
||||||
# - GPLv2
|
|
||||||
# - GPLv3
|
|
||||||
# - Apache
|
|
||||||
# - CC-BY
|
|
||||||
license: license (GPLv2, CC-BY, etc)
|
|
||||||
|
|
||||||
min_ansible_version: 1.2
|
min_ansible_version: 1.2
|
||||||
|
|
||||||
# Optionally specify the branch Galaxy will use when accessing the GitHub
|
|
||||||
# repo for this role. During role install, if no tags are available,
|
|
||||||
# Galaxy will use this branch. During import Galaxy will access files on
|
|
||||||
# this branch. If travis integration is cofigured, only notification for this
|
|
||||||
# branch will be accepted. Otherwise, in all cases, the repo's default branch
|
|
||||||
# (usually master) will be used.
|
|
||||||
#github_branch:
|
|
||||||
|
|
||||||
#
|
|
||||||
# Below are all platforms currently available. Just uncomment
|
|
||||||
# the ones that apply to your role. If you don't see your
|
|
||||||
# platform on this list, let us know and we'll get it added!
|
|
||||||
#
|
|
||||||
platforms:
|
platforms:
|
||||||
#- name: EL
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - 5
|
|
||||||
# - 6
|
|
||||||
# - 7
|
|
||||||
#- name: GenericUNIX
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - any
|
|
||||||
#- name: Solaris
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - 10
|
|
||||||
# - 11.0
|
|
||||||
# - 11.1
|
|
||||||
# - 11.2
|
|
||||||
# - 11.3
|
|
||||||
#- name: Fedora
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - 16
|
|
||||||
# - 17
|
|
||||||
# - 18
|
|
||||||
# - 19
|
|
||||||
# - 20
|
|
||||||
# - 21
|
|
||||||
# - 22
|
|
||||||
#- name: Windows
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - 2012R2
|
|
||||||
#- name: SmartOS
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - any
|
|
||||||
#- name: opensuse
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - 12.1
|
|
||||||
# - 12.2
|
|
||||||
# - 12.3
|
|
||||||
# - 13.1
|
|
||||||
# - 13.2
|
|
||||||
#- name: Amazon
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - 2013.03
|
|
||||||
# - 2013.09
|
|
||||||
#- name: GenericBSD
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - any
|
|
||||||
#- name: FreeBSD
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - 8.0
|
|
||||||
# - 8.1
|
|
||||||
# - 8.2
|
|
||||||
# - 8.3
|
|
||||||
# - 8.4
|
|
||||||
# - 9.0
|
|
||||||
# - 9.1
|
|
||||||
# - 9.1
|
|
||||||
# - 9.2
|
|
||||||
- name: Ubuntu
|
- name: Ubuntu
|
||||||
versions:
|
versions:
|
||||||
# - all
|
|
||||||
# - lucid
|
|
||||||
# - maverick
|
|
||||||
# - natty
|
|
||||||
# - oneiric
|
|
||||||
# - precise
|
|
||||||
# - quantal
|
|
||||||
# - raring
|
|
||||||
# - saucy
|
|
||||||
- trusty
|
- trusty
|
||||||
# - utopic
|
|
||||||
# - vivid
|
|
||||||
- xenial
|
- xenial
|
||||||
#- name: SLES
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - 10SP3
|
|
||||||
# - 10SP4
|
|
||||||
# - 11
|
|
||||||
# - 11SP1
|
|
||||||
# - 11SP2
|
|
||||||
# - 11SP3
|
|
||||||
#- name: GenericLinux
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - any
|
|
||||||
#- name: Debian
|
|
||||||
# versions:
|
|
||||||
# - all
|
|
||||||
# - etch
|
|
||||||
# - jessie
|
|
||||||
# - lenny
|
|
||||||
# - squeeze
|
|
||||||
# - wheezy
|
|
||||||
|
|
||||||
galaxy_tags:
|
galaxy_tags:
|
||||||
# List tags for your role here, one per line. A tag is
|
|
||||||
# a keyword that describes and categorizes the role.
|
|
||||||
# Users find roles by searching for tags. Be sure to
|
|
||||||
# remove the '[]' above if you add tags to this list.
|
|
||||||
#
|
|
||||||
# NOTE: A tag is limited to a single word comprised of
|
|
||||||
# alphanumeric characters. Maximum 20 tags per role.
|
|
||||||
- system
|
- system
|
||||||
- network
|
- network
|
||||||
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
# List your role dependencies here, one per line.
|
|
||||||
# Be sure to remove the '[]' above if you add dependencies
|
|
||||||
# to this list.
|
|
||||||
|
|
|
@ -5,34 +5,31 @@
|
||||||
state: directory
|
state: directory
|
||||||
owner: tftp
|
owner: tftp
|
||||||
group: tftp
|
group: tftp
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: config_tftpd | configuring tftpd
|
- name: config_tftpd | configuring tftpd
|
||||||
template:
|
template:
|
||||||
src: "etc/default/tftpd-hpa.j2"
|
src: etc/default/tftpd-hpa.j2
|
||||||
dest: "/etc/default/tftpd-hpa"
|
dest: /etc/default/tftpd-hpa
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0644
|
|
||||||
notify: restart tftpd-hpa
|
|
||||||
|
|
||||||
- name: config_tftpd | configuring inetd
|
|
||||||
template:
|
|
||||||
src: "etc/inetd.conf.j2"
|
|
||||||
dest: "/etc/inetd.conf"
|
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
become: true
|
||||||
notify: restart tftpd-hpa
|
notify: restart tftpd-hpa
|
||||||
|
|
||||||
- name: config_tftpd | Downloading Netboot
|
- name: config_tftpd | Downloading Netboot
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ tftp_netboot_url }}/{{ tftp_netboot_file }}"
|
url: "{{ tftp_netboot_url }}/{{ tftp_netboot_file }}"
|
||||||
dest: "{{ tftp_directory }}/{{ tftp_netboot_file }}"
|
dest: "{{ tftp_directory }}/{{ tftp_netboot_file }}"
|
||||||
|
become: true
|
||||||
|
when: tftp_netboot_enable
|
||||||
|
|
||||||
- name: config_tftpd | Extracting Netboot
|
- name: config_tftpd | Extracting Netboot
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "{{ tftp_directory }}/{{ tftp_netboot_file }}"
|
src: "{{ tftp_directory }}/{{ tftp_netboot_file }}"
|
||||||
dest: "{{ tftp_directory }}"
|
dest: "{{ tftp_directory }}"
|
||||||
copy: no
|
copy: false
|
||||||
args:
|
args:
|
||||||
creates: "{{ tftp_directory }}/pxelinux.0"
|
creates: "{{ tftp_directory }}/pxelinux.0"
|
||||||
|
become: true
|
||||||
|
when: tftp_netboot_enable
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: debian | updating apt-cache
|
- name: debian | Installing tftpd-hpa
|
||||||
apt:
|
apt:
|
||||||
update_cache: true
|
name: tftpd-hpa
|
||||||
cache_valid_time: 86400
|
state: present
|
||||||
|
become: true
|
||||||
- name: debian | installing packages
|
|
||||||
apt:
|
|
||||||
name: "{{ item }}"
|
|
||||||
with_items:
|
|
||||||
- tftpd-hpa
|
|
||||||
- inetutils-inetd
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# /etc/default/tftpd-hpa
|
{{ ansible_managed|comment }}
|
||||||
|
|
||||||
TFTP_USERNAME="tftp"
|
TFTP_USERNAME="tftp"
|
||||||
TFTP_DIRECTORY="{{ tftp_directory }}"
|
TFTP_DIRECTORY="{{ tftp_directory }}"
|
||||||
TFTP_ADDRESS="[::]:69"
|
TFTP_ADDRESS="[::]:69"
|
||||||
TFTP_OPTIONS="{{ tftp_options }}"
|
TFTP_OPTIONS="{{ tftp_options }}"
|
||||||
|
|
||||||
|
RUN_DAEMON="yes"
|
||||||
|
|
Loading…
Reference in a new issue