Saturday, 23 April 2016

getting started puppet modules.

getting started puppet modules.

Modules are self-contained bundles of code(each individual is manifest) and data.
REF : puppet
Nearly all Puppet manifests belong in modules.
deafault module directory : /etc/puppet/modules

1)puppet help module.
cmd : puppet help module

def : This subcommand can find, install, and manage modules from the Puppet Forge,
a repository of user-contributed Puppet code. It can also generate empty
modules, and prepare locally developed modules for release on the Forge.

USAGE: puppet module <action> [--environment production ]
[--modulepath $basemodulepath ]

2) module action.
  build        Build a module release package.
  changes      Show modified files of an installed module.
  generate     Generate boilerplate for a new module.
  install      Install a module from the Puppet Forge or a release archive.
  list         List installed modules
  search       Search the Puppet Forge for a module.
  uninstall    Uninstall a puppet module.
  upgrade      Upgrade a puppet module.

3) puppet module directory
module directory : /etc/puppet/modules

4) createing the boilerplate for your module
cmd : sudo puppet module generate my-voice
The below will render the metadata of the module my-voice
result :
  "name": "my-voice",
  "version": "0.1.0",
  "author": "my",
  "summary": null,
  "license": "Apache 2.0",
  "source": "",
  "project_page": null,
  "issues_url": null,
  "dependencies": [
    {"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"}

5) list the puppet module.

cmd : sudo puppet module list

Warning: Missing dependency 'puppetlabs-stdlib':
  'my-voice' (v0.1.0) requires 'puppetlabs-stdlib' (>= 1.0.0)
├── accounts (???)
└── my-voice (v0.1.0)

6) Install the module from the puppetlab
cmd : sudo puppet module install puppetlabs-stdlib
output :
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from ...
Notice: Installing -- do not interrupt ...
└── puppetlabs-stdlib (v4.11.0)

7) search puppet module in puppetlabs.
output :
Notice: Searching ...
NAME                   DESCRIPTION                                                                             AUTHOR        KEYWORDS
sharumpe-apache2       Module to manage Apache2 v2.4 in OpenSuSE 13.1                                          @sharumpe
puppetlabs-apache      Installs, configures, and manages Apache virtual hosts, web services, and modules.      @puppetlabs   web httpd rhel apache2 ssl wsgi proxy
nodes-php              Puppet module to manage PHP, PECL & PEAR on debian / ubuntu - easily expandable to ...  @nodes        php pecl pear apc curl gd ssh2 apache2 fpm
saz-php                UNKNOWN                                                                                 @saz          apache debian ubuntu php apache2 fpm cli
mstanislav-apache_yum  UNKNOWN

8) install puppetlabs-apache.
sudo puppet module install puppetlabs-apache

a) sudo puppet module install puppetlabs-apt
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from ...
Notice: Installing -- do not interrupt ...
└─┬ puppetlabs-apt (v2.2.2)
  └── puppetlabs-stdlib (v4.11.0)

9) puppet module upgrade.
cmd : sudo puppet module upgrade puppetlabs-apt

No comments:

Post a Comment