theforeman / community-templates

A place to share templates for various OSes for Foreman's provisioning
GNU General Public License v3.0
144 stars 182 forks source link

This Repository is archived and templates are migrated to the relevant repositories. For more information Click Here.

Community Templates

A place for us to collaborate around templates & snippets for various OSes.

Repo metadata

So that the templates can eventually be updated automatically in Foreman, we are adding metadata to the top of every template. This metadata can be read by a plugin (such as foreman_templates) to determine information abut the template. The metadata is read until the first non-comment line, and contains, the template name, template kind, and any appropriate OS associations. For example:

#kind: user_data
#name: My Userdata
#oses:
# - CentOS 7
# - Debian
# - Ubuntu

Because all the data is contained in the metadata, filenames are arbitrary, however, for consistency we ask that they be grouped appropriately, and end in .erb.

Have a look around the repo for examples.

Testing

There is a test suite available in this repo that tries to render templates using dummy values passing the output to ksvalidator tool which can be found in Fedora and Red Hat repositories as part of pykickstart package and in Ubuntu repositories as part of python-pykickstart package.

You will need ksvalidator from Fedora 20 or later to execute tests. Pykickstart can be installed from git easily too. Use '-l' option to get list of supported versions:

$ ksvalidator -l

To start unit tests do something like:

$ ruby -Itest test/kickstart/provision_test.rb

Another set of tests is in Foreman core git repository, it's possible to run useful render test from the core git repo against this directory:

foreman$ bundle exec rake templates:render DIRECTORY=/path/to/community-templates/provisioning_templates/

It will render selected templates and output can be easily compared via git diff.

Contributing

Please fork and send a pull request. Thanks!

Notes for various templates

CoreOS

The templates use some Host Parameters to contol the flow of the template. These are:

If you don't add any SSH keys you can login with the core user using the root password.

More Information are available on the CoreOS site

Kickstart

Kickstart Files

There is one kickstart and accompanying PXE config, which works for:

Fedora 16 Fedora 17 Fedora 18 Fedora 19 Fedora 20 RHEL, CentOS 5.9 RHEL, CentOS 6.3

Poap

Cisco NX-OS PowerOn Auto Provisioning (POAP) support

More information is available here: http://projects.theforeman.org/issues/10526

Preseed

Tested on:

Host Parameters

The templates use some Host Parameters to control the flow of the template. These are:

Detailed description is available at https://www.debian.org/releases/stable/amd64/apbs04.html.en

ZTP

Junos Zero-Touch-Provisioning support

More information is available here: http://projects.theforeman.org/issues/3906

License

Copyrights are retained by their owners

This entire repository is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Exceptions

The following file(s) are not licensed under the GPLv3+ as described above and instead contain copyright and license information in their headers: