From fca65b8710668da4646e49cc91d7524f047ab116 Mon Sep 17 00:00:00 2001 From: Justice London Date: Fri, 12 Jul 2013 18:14:53 -0400 Subject: Release of 0.0.2 module which includes template base configuration for trocla CLI. --- Modulefile | 2 +- manifests/config.pp | 36 +++++++++++++++++++----------------- manifests/init.pp | 6 ++++++ manifests/master.pp | 14 +++++++++++--- metadata.json | 4 ++-- templates/troclarc.yaml.erb | 9 +++++++++ 6 files changed, 48 insertions(+), 23 deletions(-) create mode 100644 manifests/init.pp create mode 100644 templates/troclarc.yaml.erb diff --git a/Modulefile b/Modulefile index 379f8d8..792c689 100644 --- a/Modulefile +++ b/Modulefile @@ -1,5 +1,5 @@ name 'duritong-trocla' -version '0.0.1' +version '0.0.2' author 'duritong' license '' diff --git a/manifests/config.pp b/manifests/config.pp index 2c00684..ebae2f1 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,26 +1,28 @@ -# deploy a trocla config -class trocla::config($ruby='system') { - if $trocla::config::ruby == 'system' or $trocla::config::ruby == 'both' { - require trocla::master - } - if $trocla::config::ruby == 'ree' or $trocla::config::ruby == 'both' { - require trocla::master::ree - } +#Installs configuration files for the trocla agent/CLI +# +#Options +# [*adapter*] Defines the adapter type to use for trocla agent. Generally YAML +# [*adapter_options*] This will contain a hash of the actual options to pass the +# trocla configuration. Generally you might pass the file option for key-file +# [*keysize*] Define the length of default passwords to create. 16 by default +class trocla::config ( + $adapter = undef, + $keysize = 16, + $adapter_options = { 'default' => '' }, +) { + require trocla::master - # deploy default config file and link it for trocla cli lookup +# Deploy default config file and link it for trocla cli lookup file{ "${settings::confdir}/troclarc.yaml": - content => "---\nadapter_options:\n :file: ${settings::confdir}/trocla_data.yaml\n", + ensure => present, + content => template('trocla/troclarc.yaml.erb'), owner => root, group => puppet, mode => '0640'; '/etc/troclarc.yaml': - ensure => link, - target => "${settings::confdir}/troclarc.yaml"; - "${settings::confdir}/trocla_data.yaml": - ensure => present, - owner => puppet, - group => 0, - mode => '0600'; + ensure => link, + target => "${settings::confdir}/troclarc.yaml"; } + } diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..cf5223e --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,6 @@ +#Main definition class for trocla. Just calls master +class trocla { + + include trocla::master + +} diff --git a/manifests/master.pp b/manifests/master.pp index 0123a56..5d5788f 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -5,10 +5,18 @@ # [Remember: No empty lines between comments and class definition] class trocla::master { - require rubygems::moneta - require rubygems::highline +# require rubygems::moneta +# require rubygems::highline - package{'trocla': + package { 'moneta': + ensure => present, + provider => gem, + } + package { 'highline': + ensure => present, + provider => gem, + } + package {'trocla': ensure => present, provider => gem, } diff --git a/metadata.json b/metadata.json index 427a2e4..dfb2a40 100644 --- a/metadata.json +++ b/metadata.json @@ -6,7 +6,7 @@ "project_page": "https://github.com/duritong/trocla", "source": "https://github.com/duritong/puppet-trocla", "summary": "", - "version": "0.0.1", + "version": "0.0.2", "checksums": { "Modulefile": "431cf06775a63c7cffa657b0d0911efd", "README": "d4025a6e12d37adb7b8317bc89a2f807", @@ -18,4 +18,4 @@ "manifests/master/ree.pp": "f48611c532170c9fb7f73017a8df1f6f" }, "dependencies": [] -} \ No newline at end of file +} diff --git a/templates/troclarc.yaml.erb b/templates/troclarc.yaml.erb new file mode 100644 index 0000000..3f473fe --- /dev/null +++ b/templates/troclarc.yaml.erb @@ -0,0 +1,9 @@ +--- +options: + random: true + length: <%= @keysize %> +adapter: :<%= @adapter %> +adapter_options: +<% @adapter_options.each do |key,value| -%> + :<%= key -%>: '<%= value -%>' +<% end -%> -- cgit v1.2.3