Skip to content

purpleidea/puppet-mgmtgraph

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#puppet-mgmtgraph

Build Status

Adds the :mgmtgraph face and puppet mgmtgraph subcommand to Puppet. It allows you to compile simple Puppet manifest into a data structure that is suitable for mgmt to consume.

Released under the terms of the Apache 2 License.

Authored by Felix Frank.

Usage

Currently, the most useful invocation of puppet mgmtgraph targets single manifests of simple structure

puppet mgmtgraph --manifest /path/to/my.pp >/tmp/mygraph.yaml

The manifest can use modules from the configured environment, but please note that this likely clashes with current limitations.

With no manifest specified, puppet mgmtgraph will behave like puppet agent and receive the catalog from the configured master, using its agent certificate. (This works courtesy of the puppet catalog face.)

puppet mgmtgraph >/tmp/mygraph.yaml

A handy shortcut for testing simple manifests is the --code parameter

puppet mgmtgraph --code 'file { "/tmp/test": ensure => present } -> package { "cowsay": ensure => installed }'

Finally, run the graph through mgmt

mgmt run --file /tmp/mygraph.yaml

Limitations

The set of supported catalog elements is still quite small:

  • file resources
  • exec resources
  • dependency edges that directly connect supported resources

Resources in classes and defines are considered, but containment, complex relationships, signaling edges etc. are unsupported and/or untested.

Basically, a supported manifest can currently look like the following:

file { 'a': ... } -> exec { 'b': ... } -> file { 'c': ... }

Anything more sophisticated will lead to erratic mileage.

Compatibility

Supports Puppet 3.x and 4.x.

Supports mgmt 0.0.3 (no earlier releases)

TODO

  • more flexibility in the DSL
  • easier DSL (e.g. add a method to get at the namevar)
  • general fallback support using puppet resource (a.k.a. the Daenny hack)

About

The mgmt translator for Puppet manifests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%