From 16b06320cd3bb3121446717c05b6bc13ae2ff133 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 27 Jul 2011 18:41:27 +0200 Subject: init of trocla module --- manifests/config.pp | 8 ++++++++ manifests/master.pp | 17 +++++++++++++++++ manifests/master/ree.pp | 14 ++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 manifests/config.pp create mode 100644 manifests/master.pp create mode 100644 manifests/master/ree.pp (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp new file mode 100644 index 0000000..3a4a356 --- /dev/null +++ b/manifests/config.pp @@ -0,0 +1,8 @@ +class trocla::config { + file{"${settings::confdir}/trocla.yaml": + source => [ "puppet:///modules/site-trocla/${fqdn}/trocla.yaml", + 'puppet:///modules/site-trocla/trocla.yaml' ], + require => Package['trocla'], + owner => root, group => puppet, mode => 0640; + } +} diff --git a/manifests/master.pp b/manifests/master.pp new file mode 100644 index 0000000..62c975e --- /dev/null +++ b/manifests/master.pp @@ -0,0 +1,17 @@ +# Class: trocla::master +# +# This module manages the necessary things for trocla on a master. +# +# [Remember: No empty lines between comments and class definition] +class trocla::master { + + require rubygems::moneta + require rubygems::highline + + package{'trocla': + ensure => present, + provider => gem, + } + + include trocla::config +} diff --git a/manifests/master/ree.pp b/manifests/master/ree.pp new file mode 100644 index 0000000..92cc07b --- /dev/null +++ b/manifests/master/ree.pp @@ -0,0 +1,14 @@ +# Class: trocla::master::ree +# +# This module manages the necessary things for trocla on a master. +# +# [Remember: No empty lines between comments and class definition] +class trocla::master::ree { + + require ruby-enterprise::gems::moneta + require ruby-enterprise::gems::highline + + ruby-enterprise::gem{'trocla': } + + include trocla::config +} -- cgit v1.2.3 From d36c75a9597a1c31f448c530c17cebb72193306b Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 27 Jul 2011 19:12:55 +0200 Subject: make a better config deployment --- manifests/config.pp | 25 +++++++++++++++++++------ manifests/master.pp | 2 -- manifests/master/ree.pp | 2 -- 3 files changed, 19 insertions(+), 10 deletions(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index 3a4a356..78f5602 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,8 +1,21 @@ -class trocla::config { - file{"${settings::confdir}/trocla.yaml": - source => [ "puppet:///modules/site-trocla/${fqdn}/trocla.yaml", - 'puppet:///modules/site-trocla/trocla.yaml' ], - require => Package['trocla'], - owner => root, group => puppet, mode => 0640; +class trocla::config($ruby='system') { + if $trocla::default_config::ruby == 'system' or $trocla::default_config::ruby == 'both' { + require trocla::master + } + if $trocla::default_config::ruby == 'ree' or $trocla::default_config::ruby == 'both' { + require trocla::master::ree + } + + # deploy default config file and link it for trocla cli lookup + file{ + "${settings::confdir}/trocla.yaml": + content => "---\nadapter_options:\n :path: ${settings::confdir}/trocla_data.yaml\n", + owner => root, group => puppet, mode => 0640; + '/etc/trocla.yaml': + ensure => link, + target => "${settings::confdir}/trocla.yaml", + "${settings::confdir}/trocla_data.yaml": + ensure => present, + owner => puppet, group => 0, mode => 0600; } } diff --git a/manifests/master.pp b/manifests/master.pp index 62c975e..2748b73 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -12,6 +12,4 @@ class trocla::master { ensure => present, provider => gem, } - - include trocla::config } diff --git a/manifests/master/ree.pp b/manifests/master/ree.pp index 92cc07b..08d9a8e 100644 --- a/manifests/master/ree.pp +++ b/manifests/master/ree.pp @@ -9,6 +9,4 @@ class trocla::master::ree { require ruby-enterprise::gems::highline ruby-enterprise::gem{'trocla': } - - include trocla::config } -- cgit v1.2.3 From 6457e95758e5c7aff9e995ab49fd032e3cb80b79 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 27 Jul 2011 19:32:49 +0200 Subject: fix typo --- manifests/config.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index 78f5602..eb8a8ed 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -13,7 +13,7 @@ class trocla::config($ruby='system') { owner => root, group => puppet, mode => 0640; '/etc/trocla.yaml': ensure => link, - target => "${settings::confdir}/trocla.yaml", + target => "${settings::confdir}/trocla.yaml"; "${settings::confdir}/trocla_data.yaml": ensure => present, owner => puppet, group => 0, mode => 0600; -- cgit v1.2.3 From 8ffd1eab30b4bed765457c73ea40b994bff38b7e Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 27 Jul 2011 19:45:54 +0200 Subject: bring config filename in line with what trocla uses --- manifests/config.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index eb8a8ed..9ce8730 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -8,12 +8,12 @@ class trocla::config($ruby='system') { # deploy default config file and link it for trocla cli lookup file{ - "${settings::confdir}/trocla.yaml": + "${settings::confdir}/troclarc.yaml": content => "---\nadapter_options:\n :path: ${settings::confdir}/trocla_data.yaml\n", owner => root, group => puppet, mode => 0640; - '/etc/trocla.yaml': + '/etc/troclarc.yaml': ensure => link, - target => "${settings::confdir}/trocla.yaml"; + target => "${settings::confdir}/troclarc.yaml"; "${settings::confdir}/trocla_data.yaml": ensure => present, owner => puppet, group => 0, mode => 0600; -- cgit v1.2.3 From 7374cf944fbc1b52c438ce7e5345f94427ea876e Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 3 Aug 2011 17:25:54 +0200 Subject: fix variable lookup --- manifests/config.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index 9ce8730..c53aef1 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,8 +1,8 @@ class trocla::config($ruby='system') { - if $trocla::default_config::ruby == 'system' or $trocla::default_config::ruby == 'both' { + if $trocla::config::ruby == 'system' or $trocla::config::ruby == 'both' { require trocla::master } - if $trocla::default_config::ruby == 'ree' or $trocla::default_config::ruby == 'both' { + if $trocla::config::ruby == 'ree' or $trocla::config::ruby == 'both' { require trocla::master::ree } -- cgit v1.2.3 From 2afdc26738eb78469e761b67ac4cb6152944cfc9 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 16:16:47 +0200 Subject: new style for 2.7 --- manifests/master/ree.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/master/ree.pp b/manifests/master/ree.pp index 08d9a8e..ed981e0 100644 --- a/manifests/master/ree.pp +++ b/manifests/master/ree.pp @@ -5,8 +5,8 @@ # [Remember: No empty lines between comments and class definition] class trocla::master::ree { - require ruby-enterprise::gems::moneta - require ruby-enterprise::gems::highline + require ruby_enterprise::gems::moneta + require ruby_enterprise::gems::highline - ruby-enterprise::gem{'trocla': } + ruby_enterprise::gem{'trocla': } } -- cgit v1.2.3 From 69885ba60aed1e48b18424a93d4ccf2efc57b7f3 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 14 Jan 2013 23:02:47 +0100 Subject: adapt to new moneta version --- manifests/config.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index c53aef1..a08d885 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -9,7 +9,7 @@ class trocla::config($ruby='system') { # deploy default config file and link it for trocla cli lookup file{ "${settings::confdir}/troclarc.yaml": - content => "---\nadapter_options:\n :path: ${settings::confdir}/trocla_data.yaml\n", + content => "---\nadapter_options:\n :file: ${settings::confdir}/trocla_data.yaml\n", owner => root, group => puppet, mode => 0640; '/etc/troclarc.yaml': ensure => link, -- cgit v1.2.3 From 27775313728aa85d8c127f7d37fccd97054fe965 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 14 Jan 2013 23:04:38 +0100 Subject: linting --- manifests/config.pp | 15 ++++++++++----- manifests/master.pp | 6 +++--- manifests/master/ree.pp | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index a08d885..2c00684 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,3 +1,4 @@ +# deploy a trocla config class trocla::config($ruby='system') { if $trocla::config::ruby == 'system' or $trocla::config::ruby == 'both' { require trocla::master @@ -10,12 +11,16 @@ class trocla::config($ruby='system') { file{ "${settings::confdir}/troclarc.yaml": content => "---\nadapter_options:\n :file: ${settings::confdir}/trocla_data.yaml\n", - owner => root, group => puppet, mode => 0640; + owner => root, + group => puppet, + mode => '0640'; '/etc/troclarc.yaml': - ensure => link, - target => "${settings::confdir}/troclarc.yaml"; + ensure => link, + target => "${settings::confdir}/troclarc.yaml"; "${settings::confdir}/trocla_data.yaml": - ensure => present, - owner => puppet, group => 0, mode => 0600; + ensure => present, + owner => puppet, + group => 0, + mode => '0600'; } } diff --git a/manifests/master.pp b/manifests/master.pp index 2748b73..0123a56 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -7,9 +7,9 @@ class trocla::master { require rubygems::moneta require rubygems::highline - + package{'trocla': - ensure => present, - provider => gem, + ensure => present, + provider => gem, } } diff --git a/manifests/master/ree.pp b/manifests/master/ree.pp index ed981e0..c8d58f0 100644 --- a/manifests/master/ree.pp +++ b/manifests/master/ree.pp @@ -7,6 +7,6 @@ class trocla::master::ree { require ruby_enterprise::gems::moneta require ruby_enterprise::gems::highline - + ruby_enterprise::gem{'trocla': } } -- cgit v1.2.3 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. --- manifests/config.pp | 36 +++++++++++++++++++----------------- manifests/init.pp | 6 ++++++ manifests/master.pp | 14 +++++++++++--- 3 files changed, 36 insertions(+), 20 deletions(-) create mode 100644 manifests/init.pp (limited to 'manifests') 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, } -- cgit v1.2.3 From 9fb3286e24548cb3a6a6722e57a005737246fb5a Mon Sep 17 00:00:00 2001 From: Justice London Date: Fri, 2 Aug 2013 15:56:32 -0400 Subject: Change to allow you to define to install rubygem requirements --- manifests/master.pp | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'manifests') diff --git a/manifests/master.pp b/manifests/master.pp index 5d5788f..64444b1 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -3,21 +3,33 @@ # This module manages the necessary things for trocla on a master. # # [Remember: No empty lines between comments and class definition] -class trocla::master { +class trocla::master ( + $install_deps = false, + $use_rubygems = true, +) { -# require rubygems::moneta -# require rubygems::highline - - package { 'moneta': - ensure => present, - provider => gem, + #Select if the upstream rubygems modules should be required for install + if $use_rubygems { + require rubygems::moneta + require rubygems::highline } - package { 'highline': - ensure => present, - provider => gem, + + #Manually install requirements via gem + if $install_deps { + package { 'moneta': + ensure => present, + provider => gem, + } + package { 'highline': + ensure => present, + provider => gem, + } } + + #Main trocla install package {'trocla': ensure => present, provider => gem, } + } -- cgit v1.2.3 From f7ac3063564d4560f5a80ea45e84011b127b0b62 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 2 Oct 2013 09:28:54 +0200 Subject: remove init class, this confused ppl and better readme follows --- manifests/init.pp | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 manifests/init.pp (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp deleted file mode 100644 index cf5223e..0000000 --- a/manifests/init.pp +++ /dev/null @@ -1,6 +0,0 @@ -#Main definition class for trocla. Just calls master -class trocla { - - include trocla::master - -} -- cgit v1.2.3 From 9da000c6511e85e030e431b7d951d325c2c98681 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 2 Oct 2013 10:28:01 +0200 Subject: Improve the overall experience of the module. - Extending the README - Add a trocla::yaml class for a simple quickstart. - Fixes issues: #4 & #5 --- manifests/config.pp | 26 +++++++++++++++++--------- manifests/dependencies.pp | 12 ++++++++++++ manifests/master.pp | 17 ++++++++--------- manifests/master/ree.pp | 3 ++- manifests/yaml.pp | 22 ++++++++++++++++++++++ 5 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 manifests/dependencies.pp create mode 100644 manifests/yaml.pp (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index ebae2f1..a3a6e01 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,18 +1,26 @@ #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 +# [*adapter*] Defines the adapter type to use for trocla agent. +# By default it's YAML +# [*adapter_options*] This will contain a hash of the adapter options to pass the +# trocla configuration. +# [*password_length*] Define the length of default passwords to create. 16 by default +# [*random_passwords*] Should trocla generate random passwords +# if none can be found. *true* by default. +# [*manage_dependencies*] Whether to manage the dependencies or not. Default *true* class trocla::config ( - $adapter = undef, - $keysize = 16, - $adapter_options = { 'default' => '' }, + $adapter = 'YAML', + $password_length = 16, + $random_passwords = true, + $adapter_options = {}, + $manage_dependencies = true, ) { - require trocla::master + if $manage_dependencies { + 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": ensure => present, diff --git a/manifests/dependencies.pp b/manifests/dependencies.pp new file mode 100644 index 0000000..0b2bb73 --- /dev/null +++ b/manifests/dependencies.pp @@ -0,0 +1,12 @@ +class trocla::dependencies( + $provider = gem, +) { + package { 'moneta': + ensure => present, + provider => $provider, + } + package { 'highline': + ensure => present, + provider => $provider, + } +} diff --git a/manifests/master.pp b/manifests/master.pp index 64444b1..8bc5cd9 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -2,10 +2,14 @@ # # This module manages the necessary things for trocla on a master. # -# [Remember: No empty lines between comments and class definition] +# [*install_deps*]: Whether to directly install the necessary dependencies +# [*use_rubygems*]: Use the rubygems module to manage your dependencies +# [*provider*]: Which provider to use to install your dependencies, if you +# don't use the rubygems module class trocla::master ( $install_deps = false, $use_rubygems = true, + $provider = gem, ) { #Select if the upstream rubygems modules should be required for install @@ -16,20 +20,15 @@ class trocla::master ( #Manually install requirements via gem if $install_deps { - package { 'moneta': - ensure => present, - provider => gem, - } - package { 'highline': - ensure => present, - provider => gem, + class{'trocla::dependencies': + provider => $provider, } } #Main trocla install package {'trocla': ensure => present, - provider => gem, + provider => $provider, } } diff --git a/manifests/master/ree.pp b/manifests/master/ree.pp index c8d58f0..bf2c400 100644 --- a/manifests/master/ree.pp +++ b/manifests/master/ree.pp @@ -1,6 +1,7 @@ # Class: trocla::master::ree # -# This module manages the necessary things for trocla on a master. +# This module manages the necessary things for trocla on a master for +# RubyEnterprise installation. # # [Remember: No empty lines between comments and class definition] class trocla::master::ree { diff --git a/manifests/yaml.pp b/manifests/yaml.pp new file mode 100644 index 0000000..4650a5a --- /dev/null +++ b/manifests/yaml.pp @@ -0,0 +1,22 @@ +class trocla::yaml( + $password_length = 16 + $random_passwords = true, + $data_file = "{$settings::server_datadir}/trocla_data.yaml", +) { + + class{'trocla::config': + password_length => $password_length, + random_passwords => $random_passwords, + adapter => 'YAML', + adapter_options => { + file => $data_file, + }, + } + + file{$data_file: + ensure => file, + owner => puppet, + group => 0, + mode => 0600; + } +} -- cgit v1.2.3 From db287f27fc099659ecb8f84a20259519321d6993 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 2 Oct 2013 10:32:20 +0200 Subject: typo --- manifests/yaml.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/yaml.pp b/manifests/yaml.pp index 4650a5a..8b05135 100644 --- a/manifests/yaml.pp +++ b/manifests/yaml.pp @@ -1,5 +1,5 @@ class trocla::yaml( - $password_length = 16 + $password_length = 16, $random_passwords = true, $data_file = "{$settings::server_datadir}/trocla_data.yaml", ) { -- cgit v1.2.3 From 2446ca831ff1a8609333d820a920a37e842ac852 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 2 Oct 2013 11:05:34 +0200 Subject: linting --- manifests/dependencies.pp | 3 +++ manifests/yaml.pp | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/dependencies.pp b/manifests/dependencies.pp index 0b2bb73..9a4be15 100644 --- a/manifests/dependencies.pp +++ b/manifests/dependencies.pp @@ -1,3 +1,6 @@ +# manage trocla's dependencies +# +# [*provider*] How to install the dependencies. class trocla::dependencies( $provider = gem, ) { diff --git a/manifests/yaml.pp b/manifests/yaml.pp index 8b05135..dc20c2e 100644 --- a/manifests/yaml.pp +++ b/manifests/yaml.pp @@ -1,7 +1,17 @@ +# A class for an eady start with trocla. +# This will install and configure trocla with the +# default yaml storage. +# +# [*password_length*] The default length of new passwords: 16 +# [*random_passwords*] Whether trocla should generate random +# passwords or not. Default: true +# [*data_file*] Where to store the passwords. +# Default: {$settings::server_datadir}/trocla_data.yaml" +# This will likely be: /var/lib/puppet/server_data/trocla_data.yaml class trocla::yaml( $password_length = 16, $random_passwords = true, - $data_file = "{$settings::server_datadir}/trocla_data.yaml", + $data_file = "${settings::server_datadir}/trocla_data.yaml", ) { class{'trocla::config': @@ -17,6 +27,6 @@ class trocla::yaml( ensure => file, owner => puppet, group => 0, - mode => 0600; + mode => '0600'; } } -- cgit v1.2.3 From cc243b354e51a55b704469b92fb1f5a26555d663 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 24 Jan 2015 21:11:32 +0100 Subject: moneta dependencies require ruby-devel --- manifests/master.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'manifests') diff --git a/manifests/master.pp b/manifests/master.pp index 8bc5cd9..f78a11b 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -14,6 +14,7 @@ class trocla::master ( #Select if the upstream rubygems modules should be required for install if $use_rubygems { + require ruby::devel require rubygems::moneta require rubygems::highline } -- cgit v1.2.3 From f3e39b3a6a8680916219fad9815d5997b05d1feb Mon Sep 17 00:00:00 2001 From: Michael Weiser Date: Mon, 16 Feb 2015 18:29:28 +0100 Subject: Fix dependency handling --- manifests/dependencies.pp | 6 +----- manifests/master.pp | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'manifests') diff --git a/manifests/dependencies.pp b/manifests/dependencies.pp index 9a4be15..b033269 100644 --- a/manifests/dependencies.pp +++ b/manifests/dependencies.pp @@ -4,11 +4,7 @@ class trocla::dependencies( $provider = gem, ) { - package { 'moneta': - ensure => present, - provider => $provider, - } - package { 'highline': + package { [ 'moneta', 'highline', 'bcrypt' ]: ensure => present, provider => $provider, } diff --git a/manifests/master.pp b/manifests/master.pp index 8bc5cd9..f7bb32f 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -7,8 +7,8 @@ # [*provider*]: Which provider to use to install your dependencies, if you # don't use the rubygems module class trocla::master ( - $install_deps = false, - $use_rubygems = true, + $install_deps = true, + $use_rubygems = false, $provider = gem, ) { -- cgit v1.2.3 From 91d91c253b792b5a176159e083eb1a3f301a7e86 Mon Sep 17 00:00:00 2001 From: Timo Goebel Date: Sun, 1 Mar 2015 19:13:57 +0100 Subject: add support for encryption and ssl_options --- manifests/config.pp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp index a3a6e01..7b23a3e 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -5,6 +5,10 @@ # By default it's YAML # [*adapter_options*] This will contain a hash of the adapter options to pass the # trocla configuration. +# [*encryption*] Defines the encryption method for password stored in the backend. +# By default no encryption is used. +# [*ssl_options*] This will contain a hash of the ssl options to pass the +# trocla configuration. # [*password_length*] Define the length of default passwords to create. 16 by default # [*random_passwords*] Should trocla generate random passwords # if none can be found. *true* by default. @@ -14,6 +18,8 @@ class trocla::config ( $password_length = 16, $random_passwords = true, $adapter_options = {}, + $encryption = undef, + $ssl_options = {}, $manage_dependencies = true, ) { if $manage_dependencies { -- cgit v1.2.3 From 9a3305ea0e30ad9d4fb4b1144c1b4d25955ca6b1 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 5 Apr 2015 19:21:13 +0200 Subject: dependencies should either be managed by the package or gem --- manifests/dependencies.pp | 11 ----------- manifests/master.pp | 22 ---------------------- 2 files changed, 33 deletions(-) delete mode 100644 manifests/dependencies.pp (limited to 'manifests') diff --git a/manifests/dependencies.pp b/manifests/dependencies.pp deleted file mode 100644 index b033269..0000000 --- a/manifests/dependencies.pp +++ /dev/null @@ -1,11 +0,0 @@ -# manage trocla's dependencies -# -# [*provider*] How to install the dependencies. -class trocla::dependencies( - $provider = gem, -) { - package { [ 'moneta', 'highline', 'bcrypt' ]: - ensure => present, - provider => $provider, - } -} diff --git a/manifests/master.pp b/manifests/master.pp index 90c92b1..8ea324b 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -2,34 +2,12 @@ # # This module manages the necessary things for trocla on a master. # -# [*install_deps*]: Whether to directly install the necessary dependencies -# [*use_rubygems*]: Use the rubygems module to manage your dependencies -# [*provider*]: Which provider to use to install your dependencies, if you -# don't use the rubygems module class trocla::master ( - $install_deps = true, - $use_rubygems = false, $provider = gem, ) { - - #Select if the upstream rubygems modules should be required for install - if $use_rubygems { - require ruby::devel - require rubygems::moneta - require rubygems::highline - } - - #Manually install requirements via gem - if $install_deps { - class{'trocla::dependencies': - provider => $provider, - } - } - #Main trocla install package {'trocla': ensure => present, provider => $provider, } - } -- cgit v1.2.3 From 505d820e21c46bb578d796a91de1806d22b17549 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Sep 2015 18:16:27 +0200 Subject: if the provider is not gem we should name the package correctly --- manifests/master.pp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'manifests') diff --git a/manifests/master.pp b/manifests/master.pp index 8ea324b..ad47914 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -10,4 +10,10 @@ class trocla::master ( ensure => present, provider => $provider, } + + if $provider != 'gem' { + Package['trocla']{ + name => 'rubygem-trocla' + } + } } -- cgit v1.2.3 From 8ca75f6d074b83ee48d9ce713cdb3e28e57d2cf8 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 28 Jan 2016 00:55:26 +0100 Subject: update module to make it work with all the new features of trocla 0.2.2 --- manifests/ca/params.pp | 11 +++++++++ manifests/config.pp | 63 ++++++++++++++++++++++++++++++----------------- manifests/master.pp | 13 ++++++---- manifests/master/hiera.pp | 6 +++++ manifests/master/ree.pp | 13 ---------- manifests/params.pp | 6 +++++ manifests/yaml.pp | 22 +++++++---------- 7 files changed, 81 insertions(+), 53 deletions(-) create mode 100644 manifests/ca/params.pp create mode 100644 manifests/master/hiera.pp delete mode 100644 manifests/master/ree.pp create mode 100644 manifests/params.pp (limited to 'manifests') diff --git a/manifests/ca/params.pp b/manifests/ca/params.pp new file mode 100644 index 0000000..bb61248 --- /dev/null +++ b/manifests/ca/params.pp @@ -0,0 +1,11 @@ +# input for a ca from trocla, so that you need only +# +# trocla('some_ca','x509',$trocla::ca::params::ca_options) +class trocla::ca::params( + $trocla_options = { + 'profiles' => ['sysdomain_nc','x509long'], + 'CN' => "automated-ca ${name} for ${::domain}", + }, +) { + $ca_options = merge($trocla_options,{ become_ca => true, render => { certonly => true }}) +} diff --git a/manifests/config.pp b/manifests/config.pp index 7b23a3e..8c52db7 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,35 +1,55 @@ #Installs configuration files for the trocla agent/CLI # #Options -# [*adapter*] Defines the adapter type to use for trocla agent. -# By default it's YAML -# [*adapter_options*] This will contain a hash of the adapter options to pass the -# trocla configuration. -# [*encryption*] Defines the encryption method for password stored in the backend. -# By default no encryption is used. -# [*ssl_options*] This will contain a hash of the ssl options to pass the -# trocla configuration. -# [*password_length*] Define the length of default passwords to create. 16 by default -# [*random_passwords*] Should trocla generate random passwords -# if none can be found. *true* by default. -# [*manage_dependencies*] Whether to manage the dependencies or not. Default *true* +# [*options*] Options for trocla. Default: empty hash. +# [*profiles*] Profiles for trocla. Default: empty hash. +# [*x509_profile_domain_constraint*] +# A profile for x509 name constraint that matches +# the own domain by default. +# This will add a profile for x509 certs with the +# option 'name_constraints' set to this array of +# domains. +# [*store*] Defines the store to be used for trocla. By default +# it's not set, meaning trocla's default (moneta) will +# be used. +# [*store_options*] This will contain a hash of the options to pass the +# trocla store configuration. +# [*encryption*] Defines the encryption method for password stored in +# the backend. By default it's not set, meaning trocla's +# default (none) will be used. +# [*encryption_options*] This will contain a hash of the options for the +# encryption. Default: empty Hash +# [*manage_dependencies*] Whether to manage the dependencies or not. +# Default *true* class trocla::config ( - $adapter = 'YAML', - $password_length = 16, - $random_passwords = true, - $adapter_options = {}, - $encryption = undef, - $ssl_options = {}, - $manage_dependencies = true, + $options = {}, + $profiles = {}, + $x509_profile_domain_constraints = [$::domain], + $store = undef, + $store_options = {}, + $encryption = undef, + $encryption_options = {}, + $manage_dependencies = true, ) { + include ::trocla::params if $manage_dependencies { - require trocla::master + require ::trocla::master + } + + if empty($x509_profile_domain_constraints) { + $merged_profiles = $profiles + } else { + $default_profiles = { + "${trocla::params::sysdomain_profile_name}" => { + name_constraints => $x509_profile_domain_constraints + } + } + $merged_profiles = merge($default_profiles,$profiles) } # Deploy default config file and link it for trocla cli lookup file{ "${settings::confdir}/troclarc.yaml": - ensure => present, content => template('trocla/troclarc.yaml.erb'), owner => root, group => puppet, @@ -38,5 +58,4 @@ class trocla::config ( ensure => link, target => "${settings::confdir}/troclarc.yaml"; } - } diff --git a/manifests/master.pp b/manifests/master.pp index ad47914..43e203d 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -3,15 +3,18 @@ # This module manages the necessary things for trocla on a master. # class trocla::master ( - $provider = gem, + $provider = 'default', ) { - #Main trocla install package {'trocla': - ensure => present, - provider => $provider, + ensure => 'installed', } - if $provider != 'gem' { + if $provider != 'default' { + Package['trocla']{ + provider => $provider, + } + } + if $provider != 'gem' and $::osfamily == 'RedHat' { Package['trocla']{ name => 'rubygem-trocla' } diff --git a/manifests/master/hiera.pp b/manifests/master/hiera.pp new file mode 100644 index 0000000..75b8bb3 --- /dev/null +++ b/manifests/master/hiera.pp @@ -0,0 +1,6 @@ +# manage trocla/hiera integration +class trocla::master::hiera { + package{'rubygem-hiera-backend-trocla': + ensure => present, + } +} diff --git a/manifests/master/ree.pp b/manifests/master/ree.pp deleted file mode 100644 index bf2c400..0000000 --- a/manifests/master/ree.pp +++ /dev/null @@ -1,13 +0,0 @@ -# Class: trocla::master::ree -# -# This module manages the necessary things for trocla on a master for -# RubyEnterprise installation. -# -# [Remember: No empty lines between comments and class definition] -class trocla::master::ree { - - require ruby_enterprise::gems::moneta - require ruby_enterprise::gems::highline - - ruby_enterprise::gem{'trocla': } -} diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..f99aa2a --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,6 @@ +# a set of default params for various trocla usages +class trocla::params( + $sysdomain_profile_name = 'sysdomain_nc' +){ + +} diff --git a/manifests/yaml.pp b/manifests/yaml.pp index dc20c2e..8ac0071 100644 --- a/manifests/yaml.pp +++ b/manifests/yaml.pp @@ -2,24 +2,20 @@ # This will install and configure trocla with the # default yaml storage. # -# [*password_length*] The default length of new passwords: 16 -# [*random_passwords*] Whether trocla should generate random -# passwords or not. Default: true # [*data_file*] Where to store the passwords. -# Default: {$settings::server_datadir}/trocla_data.yaml" -# This will likely be: /var/lib/puppet/server_data/trocla_data.yaml +# Default: /var/lib/trocla/trocla_data.yaml +# This should be managed using the package. class trocla::yaml( - $password_length = 16, - $random_passwords = true, - $data_file = "${settings::server_datadir}/trocla_data.yaml", + $data_file = '/var/lib/trocla/trocla_data.yaml', ) { class{'trocla::config': - password_length => $password_length, - random_passwords => $random_passwords, - adapter => 'YAML', - adapter_options => { - file => $data_file, + store => 'moneta', + store_options => { + adapter => 'YAML', + adapter_options => { + file => $data_file, + }, }, } -- cgit v1.2.3 From b478a4eb162d5a3a117c44ef9b49f20462facf50 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 29 Jan 2016 19:14:12 +0100 Subject: also manage directory as puppet user needs write perms as well --- manifests/yaml.pp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'manifests') diff --git a/manifests/yaml.pp b/manifests/yaml.pp index 8ac0071..aca164b 100644 --- a/manifests/yaml.pp +++ b/manifests/yaml.pp @@ -6,7 +6,8 @@ # Default: /var/lib/trocla/trocla_data.yaml # This should be managed using the package. class trocla::yaml( - $data_file = '/var/lib/trocla/trocla_data.yaml', + $manage_data_dir = true, + $data_file = '/var/lib/trocla/trocla_data.yaml', ) { class{'trocla::config': @@ -19,10 +20,20 @@ class trocla::yaml( }, } - file{$data_file: - ensure => file, - owner => puppet, - group => 0, - mode => '0600'; + if $manage_data_dir { + $data_dir = dirname($data_file) + file{$data_dir: + ensure => directory, + owner => puppet, + group => 0, + mode => '0600'; + } + } + file{ + $data_file: + ensure => file, + owner => puppet, + group => 0, + mode => '0600'; } } -- cgit v1.2.3 From 9af8b4274e47b9c89be3368fa6981fd6ab464cb9 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 29 Jan 2016 19:33:23 +0100 Subject: make sure we manage things after the package --- manifests/yaml.pp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/yaml.pp b/manifests/yaml.pp index aca164b..7727219 100644 --- a/manifests/yaml.pp +++ b/manifests/yaml.pp @@ -26,7 +26,8 @@ class trocla::yaml( ensure => directory, owner => puppet, group => 0, - mode => '0600'; + mode => '0600', + require => Package['trocla']; } } file{ @@ -34,6 +35,7 @@ class trocla::yaml( ensure => file, owner => puppet, group => 0, - mode => '0600'; + mode => '0600', + require => Package['trocla']; } } -- cgit v1.2.3 From 2935a074cb9fa748b49181112755dce0168df2cc Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 27 Mar 2016 17:15:40 +0200 Subject: make a ca by default very very long --- manifests/ca/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/ca/params.pp b/manifests/ca/params.pp index bb61248..437e990 100644 --- a/manifests/ca/params.pp +++ b/manifests/ca/params.pp @@ -3,7 +3,7 @@ # trocla('some_ca','x509',$trocla::ca::params::ca_options) class trocla::ca::params( $trocla_options = { - 'profiles' => ['sysdomain_nc','x509long'], + 'profiles' => ['sysdomain_nc','x509veryverylong'], 'CN' => "automated-ca ${name} for ${::domain}", }, ) { -- cgit v1.2.3