summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-10-02 10:28:01 +0200
committermh <mh@immerda.ch>2013-10-02 10:28:01 +0200
commit9da000c6511e85e030e431b7d951d325c2c98681 (patch)
treef1e6d4988d690b63b70f60b857ef86c64f442c28 /manifests
parentf7ac3063564d4560f5a80ea45e84011b127b0b62 (diff)
Improve the overall experience of the module.
- Extending the README - Add a trocla::yaml class for a simple quickstart. - Fixes issues: #4 & #5
Diffstat (limited to 'manifests')
-rw-r--r--manifests/config.pp26
-rw-r--r--manifests/dependencies.pp12
-rw-r--r--manifests/master.pp17
-rw-r--r--manifests/master/ree.pp3
-rw-r--r--manifests/yaml.pp22
5 files changed, 61 insertions, 19 deletions
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;
+ }
+}