Skip to content

Commit

Permalink
Updated README (#61)
Browse files Browse the repository at this point in the history
* Updated README

* Removed target blanks£

* Fixed internal links

* Updated metadata

* Travis update

* Add yumrepo core module in fixtures for Puppet 6 tests

* Chasing travis errors

* Chasing travis errors

* Chasing travis errors

* Removed tests on EOL ruby (where bundler cant be installed)

* Small
  • Loading branch information
alvagante committed Jan 7, 2019
1 parent 675d120 commit 71248b6
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 130 deletions.
1 change: 1 addition & 0 deletions .fixtures.yml
Expand Up @@ -5,6 +5,7 @@ fixtures:
"vcsrepo": "git://github.com/puppetlabs/puppetlabs-vcsrepo.git"
"puppi": "git://github.com/example42/puppi.git"
"tinydata": "git://github.com/example42/tinydata.git"
"yumrepo": "https://github.com/puppetlabs/puppetlabs-yumrepo_core"
symlinks:
"tp": "#{source_dir}"

26 changes: 14 additions & 12 deletions .travis.yml
Expand Up @@ -3,26 +3,28 @@
sudo: false
language: ruby
cache: bundler
script:
- 'bundle exec rake validate lint spec'
# - 'bundle exec danger'

before_install:
- rm Gemfile.lock || true
- gem update --system
- gem update bundler
- gem --version
- bundle -v

script:
- 'SPEC_OPTS="--format documentation" bundle exec rake validate lint spec'
# - 'bundle exec danger'

matrix:
fast_finish: true
include:
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.4.0"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.8.0"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4"
- rvm: 2.4.1
env: PUPPET_GEM_VERSION="~> 4"
- rvm: 2.4.1
env: PUPPET_GEM_VERSION="~> 5.0.0"
- rvm: 2.4.1
- rvm: 2.4.4
env: PUPPET_GEM_VERSION="~> 5"
- rvm: 2.5.1
env: PUPPET_GEM_VERSION="~> 6"

notifications:
email:
- al@example42.com
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# CHANGELOG

# 2.3.3
* Updated README

# 2.3.2
* Approved status request [MODULES-5811] - https://tickets.puppetlabs.com/browse/MODULES-5811
* Skip danger in travis CI
Expand Down
271 changes: 158 additions & 113 deletions README.md
Expand Up @@ -6,24 +6,69 @@

#### Table of Contents

1. [The Universal Installer](#the-universal-installer)
1. [Provided Puppet defines](#provided-puppet-defined)
1. [Usage on the command line](#usage-on-the-command-line)
1. [Prerequisites and limitations](#prerequisites-and-limitations)
1. [Usage in Puppet code](#usage-in-puppet-code)
* [Installation options](#installation-options)
* [Installation alternatives](#installation-alternatives)
* [Managing configurations](#managing-configurations)
* [Managing directories](#managing-directories)
* [Managing repositories](#managing-repositories)
1. [Using alternative data sources](#using-alternative-data-sources)
1. [Testing and playing with Tiny Puppet](#testing-and-playing-with-tiny-puppet)
1. [Module description - What Tiny Puppet does?](#module-description)
* [Features](#features)
* [Use cases](#use-cases)
2. [Setup](#setup)
* [What tp affects](#what-tp-affects)
* [Getting started with tp](#getting-started-with-tp)
3. [Usage - Configuration options and additional functionality](#usage)
* [Usage in Puppet code](#usage-in-puppet-code)
* [Installation options](#installation-options)
* [Installation alternatives](#installation-alternatives)
* [Managing configurations](#managing-configurations)
* [Managing directories](#managing-directories)
* [Managing repositories](#managing-repositories)
* [Usage on the command line](#usage-on-the-command-line)
4. [Reference](#reference)
* [Classes](#classes)
* [Defined Types](#defined-types)
* [Types](#types)
* [Functions](#functions)
* [Tasks](#tasks)
5. [Prerequisites and limitations](#prerequisites-and-limitations)
6. [Tests](#tests)



## Module description

The tp (short for Tiny Puppet) module allows you to manage any application on any (Linux flavours, Solaris, Darwin, Windows) Operating System.

It provides Puppet defined types to install packages and manage services (`tp::install`), eventually handling relevant repos (`tp::repo`) and then manage their configuration files (`tp::conf`) and directories (`tp::dir`).

### Features

* Quick, easy to use, standard, coherent, powerful interface to applications installation and their config files management.
* Out of the box and easily expandable support for most common Operating Systems
* Modular data source design. Support for an easily growing [set of applications](https://github.com/example42/tinydata/tree/master/data).
* Smooth coexistence with any existing Puppet modules setup: you decide what to manage
* Application data stored in a configurable separated module ([tinydata](https://github.com/example42/tinydata) is the default source for applications data)
* Optional shell command (`tp`) which can be used to install, test, query for logs any tp managed application.

### Use cases

Tiny Puppet is intended to be used in profiles, as replacement for dedicated componenent modules, or in the same modules, to ease the management of the provided files and packages.

## The Universal Installer
The expected users are both experienced sysadmins who know exactly how to configure their applications and absolute beginners who want to simply install an application, without knowing how it's package is called on the underlying system or how to install its repositories or dependencies.

To see real world usage of tp defines give a look to the [profiles](https://github.com/example42/puppet-psick/tree/master/manifests) in the psick module.


## Setup

[Tiny Puppet](http://www.tiny-puppet.com) is single Puppet module that can manage virtually any application on any Operating System.
### What tp affects

It can be used inside Puppet manifests:
* any application package which is possible to install with the OS native package manager
* eventually application specific package repository files or release packages (if relevant tinydata is present)
* configuration files of any application (for which there's tinydata). Content is up to the user.
* full directories, whose source can also be a scm repository

### Getting started with tp

Tiny Puppet is typically used in profiles, custom classes where we place the code we need to manage applications in the way we need.

This is a simple case, where the content of a configuration file is based on a template with custom values.

class profile::openssh (
String $template = 'profile/openssh/sshd_config.erb',
Expand All @@ -37,103 +82,11 @@ It can be used inside Puppet manifests:
}
}

or directly from the command line:

puppet module install example42-tp
puppet tp setup
tp install <app>
tp log [app]
tp test


Features:

- Quick, easy to use, standard, coherent, powerful interface to applications installation and their config files management.

- Out of the box and easily expandable support for most common Operating Systems

- Modular data source design. Support for an easily growing [set of applications](https://github.com/example42/tinydata/tree/master/data).

- Smooth coexistence with any existing Puppet modules setup: you decide what to manage

- Application data stored in a configurable separated module ([tinydata](https://github.com/example42/tinydata) is the default source for applications data)

- A Puppet face and command line to install any app or query the installed ones

It is intended to be used in profiles, as replacement for dedicated componenent modules, or in the same modules, to ease the management of the provided files and packages.

The expected users are both experienced sysadmins who know exactly how to configure their applications and absolute beginners who want to simply install an application, without knowing how it's package is called on the underlying system or how to install its repositories or dependencies.

To see real world usage of tp defines give a look to the [profiles](https://github.com/example42/puppet-psick/tree/master/manifests) in the psick module.

## Provided Puppet defines

Tiny Puppet provides the following Puppet user defines:

- ```tp::install```. It installs an application and starts its service, by default
- ```tp::conf```. It allows to manage configuration files
- ```tp::dir```. Manages the content of directories
- ```tp::stdmod```. Manages the installation of an application using StdMod compliant parameters
- ```tp::test```. Allows quick and easy (acceptance) testing of an application
- ```tp::repo```. Manages extra repositories for the supported applications
- ```tp::puppi```. Puppi integration (Don't worry, fully optional)


## Usage on the command line

Tiny Puppet adds the tp command to Puppet. Just have it in your modulepath and install the tp command with:

puppet tp setup

With the tp command you can install on the local OS the given application, taking care of naming differences, additional repos or prerequisites.

tp install <application>
tp uninstall <application>

tp test # Test all the applications installed by tp
tp test <application> # Test the specified application

tp log # Tail all the logs of all the applications installed by tp
tp log <application> # Tail the log of the specified application

Each of these commands can be inkoed also via the tp puppet face:

puppet tp <command> <arguments>


## Prerequisites and limitations

Current version of Tiny Puppet is compatible only with Puppet 4.4 or later and PE 2016.1.1 or later.

To use it Puppet 3 you have to use tp version 1.x with the 3.x compatible defines (with the ```3``` suffix).

If tp doesn't correctly install a specific application on the OS you want, please **TELL US**.
It's very easy and quick to add new apps or support for new OS in tinydata.

Currently most of the applications are supported on RedHat and Debian derivatives Linux distributions, but as long as you provide a valid installable package name, tp can install **any** application given in the title, even if there's no specific Tinydata for it..

Tiny Puppet requires these Puppet modules:

- The [tinydata](https://github.com/example42/tinydata) module

- Puppet Labs' [stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) module.

In order to work on some OS you need some additional modules and software:

- On **Windows** you need [Chocolatey](https://chocolatey.org/) and [puppetlabs-chocolatey](https://forge.puppet.com/puppetlabs/chocolatey) module with chocolatey package provider.

- On **Mac OS** you need [Home Brew](https://brew.io/) and [thekevjames-homebrew](https://forge.puppet.com/thekevjames/homebrew) or equivalent module with homebrew package provider.

If you use the relevant defines, other dependencies are needed:

- Define ```tp::concat``` requires [puppetlabs-concat](https://github.com/puppetlabs/puppetlabs-concat) module.

- Define ```tp::dir``` , when used with the ```vcsrepo``` argument, requires [puppetlabs-vcsrepo](https://github.com/puppetlabs/puppetlabs-vcsrepo) module.
## Usage

- Define ```tp::puppi``` requires [example42-puppi](https://github.com/example42/puppi) module.


## Usage in Puppet code
### Usage in Puppet code

Install an application with default settings (package installed, service started)

Expand Down Expand Up @@ -352,7 +305,7 @@ If, for whatever reason, you don't want to automatically manage a repository for
auto_repo => false,
}

## Using alternative data sources
### Using alternative data sources

By default Tiny Puppet uses the [tinydata](https://github.com/example42/tinydata) module to retrieve data for different applications, but it's possible to use a custom one:

Expand All @@ -377,11 +330,103 @@ If you want to use your own data module for all your applications, you might pre
Starting from version 2.3.0 (with tinydata version > 0.3.0) tp can even install applications for which there's no tinydata defined. In this case just the omonimous package is (tried to be) installed and a warning about missing tinydata is shown.


## Testing and playing with Tiny Puppet
### Usage on the command line

Tiny Puppet adds the tp command to Puppet. Just have it in your modulepath and install the tp command with:

puppet tp setup

With the tp command you can install on the local OS the given application, taking care of naming differences, additional repos or prerequisites.

tp install <application>
tp uninstall <application>

tp test # Test all the applications installed by tp
tp test <application> # Test the specified application

tp log # Tail all the logs of all the applications installed by tp
tp log <application> # Tail the log of the specified application

Each of these commands can be inkoed also via the tp puppet face:

puppet tp <command> <arguments>



## Reference

The tp modules provides the following resources.

### Classes

* ```tp``` Offers antry points for data driven management of tp resources, and the possibility to install the tp command

### Defined types

- ```tp::install```. It installs an application and starts its service, by default
- ```tp::conf```. It allows to manage configuration files
- ```tp::dir```. Manages the content of directories
- ```tp::stdmod```. Manages the installation of an application using StdMod compliant parameters
- ```tp::test```. Allows quick and easy (acceptance) testing of an application
- ```tp::repo```. Manages extra repositories for the supported applications
- ```tp::puppi```. Puppi integration (Don't worry, fully optional)

### Types

* [tp-settings], validates all the possible setting for tinydata

### Functions

* [tp::content], manages content for files based on supplied (erb) template, epp, and content
* [tp::ensure2bool], converts ensure values to boolean
* [tp::ensure2dir], converts ensure values to esnure values to be used for directories
* [tp::install], wrapper around the tp::install define, it tries to avoid eventual duplicated resources issues
* [tp::is_something], returna true if input of any type exists and is not empty

### Tasks

* [`tp::test`], runs a tp test command on a system to check status of [tp] installed applications

Refer to in code documentation for full reference.

Check [Puppetmodule.info](http://www.puppetmodule.info/modules/example42-tp/) for online version.


## Prerequisites and limitations

Current version of Tiny Puppet is compatible with Puppet 4.4 or later and PE 2016.1.1 or later.

To use it on Puppet 3 you have to use tp version 1.x with the 3.x compatible defines (with the ```3``` suffix).

If tp doesn't correctly install a specific application on the OS you want, please **TELL US**.
It's very easy and quick to add new apps or support for new OS in tinydata.

Currently most of the applications are supported on RedHat and Debian derivatives Linux distributions, but as long as you provide a valid installable package name, tp can install **any** application given in the title, even if there's no specific Tinydata for it..

Tiny Puppet requires these Puppet modules:

- The [tinydata](https://github.com/example42/tinydata) module

- Puppet Labs' [stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) module.

In order to work on some OS you need some additional modules and software:

- On **Windows** you need [Chocolatey](https://chocolatey.org/) and [puppetlabs-chocolatey](https://forge.puppet.com/puppetlabs/chocolatey) module with chocolatey package provider.

- On **Mac OS** you need [Home Brew](https://brew.io/) and [thekevjames-homebrew](https://forge.puppet.com/thekevjames/homebrew) or equivalent module with homebrew package provider.

If you use the relevant defines, other dependencies are needed:

- Define ```tp::concat``` requires [puppetlabs-concat](https://github.com/puppetlabs/puppetlabs-concat) module.

- Define ```tp::dir``` , when used with the ```vcsrepo``` argument, requires [puppetlabs-vcsrepo](https://github.com/puppetlabs/puppetlabs-vcsrepo) module.

- Define ```tp::puppi``` requires [example42-puppi](https://github.com/example42/puppi) module.


## Tests

You can experiment and play with Tiny Puppet and see a lot of use examples on [Example42's PSICK control-repo](https://github.com/example42/psick).

Acceptance tests are done to verify tp support for different applications on different Operating Systems. They are in the [TP acceptance](https://github.com/example42/tp-acceptance) repo.

Check this [**Compatibility Matrix**](https://github.com/example42/tp-acceptance/blob/master/tests/app_summary.md) for a quick overview on how different applications are currently supported on different Operating Systems.

2 changes: 1 addition & 1 deletion manifests/repo.pp
Expand Up @@ -132,7 +132,7 @@
}
'RedHat': {
if !defined(Yumrepo[$title])
and ( $settings[repo_url] or $settings[yum_mirrorlist] ){
and ( $settings[repo_url] or $settings[yum_mirrorlist] ) {
$yumrepo_title = pick($settings[repo_filename],$title)
yumrepo { $yumrepo_title:
enabled => $enabled_num,
Expand Down

0 comments on commit 71248b6

Please sign in to comment.