Code Monkey home page Code Monkey logo

ansible-role-tftp's Introduction

Ansible role tftp

Build Status

An Ansible role for installing a TFTP (Trivial File Transfer Protocol) server on RHEL/CentOS 7. Specifically, the responsibilities of this role are to:

  • install the necessary packages
  • manage the configuration
  • manage SELinux settings

For more relevant documentation on TFTP, see:

Requirements

none.

Role Variables

The following variables can be set by the administrator:

Variable Default Comments (type)
tftp_anon_write false Boolean that specifies whether SELinux allows modifying files.
tftp_config /usr/lib/systemd/system/tftp.service Path to the systemd unit file for tftp
tftp_group root Group of the tftp_root_directory
tftp_home_dir false Boolean that specifies whether SELinux
tftp_mode 0755 Permissions of the tftp_root_directory
tftp_root_directory /var/lib/tftpboot The path to the root directory served by tftp.
tftp_server_args --secure Command line arguments to be passed to the server executable
tftp_server_foreman_support false Enable Foreman support by creating suitable tftpd.map
tftp_setype tftpdir_rw_t SELinux context for the tftp root directory
tftp_user root Owner of the tftp_root_directory

Dependencies

No dependencies.

Example Playbook

See the test playbook

Testing

Tests for this role are provided in the form of a Vagrant environment that is kept in a separate branch, tests. I use git-worktree(1) to include the test code into the working directory. Instructions for running the tests:

  1. Fetch the tests branch: git fetch origin tests
  2. Create a Git worktree for the test code: git worktree add tests tests (remark: this requires at least Git v2.5.0). This will create a directory tests/.
  3. cd tests/
  4. vagrant up will then create a VM and apply the second of the two available testing playbooks enumerated below.

The test playbooks:

  • test-minimal.yml applies the role to a VM, with default settings (no role variables are set).

  • test.yml applies the role to a VM, changing some default values. The playbook also puts a file named README into the TFTP root directory. After applying this playbook, you should be able to fetch that file from your host system (assuming the tftp client is installed):

    $ tftp 127.0.0.1 6969 -c get README

The TFTP port (69) on the VM is forwarded through the NAT interface to port 6969 on your host system, hence the 127.0.0.1 and port number in the command line.

Contributing

Issues, feature requests, ideas are appreciated and can be posted in the Issues section. Pull requests are also very welcome. Preferably, create a topic branch and when submitting, squash your commits into one (with a descriptive message).

License

BSD

Author Information

Bert Van Vreckem ([email protected])

Contributions by:

ansible-role-tftp's People

Contributors

bertvv avatar trinitronx avatar unixunion avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.