summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorduritong <peter.meier+github@immerda.ch>2013-09-04 15:02:11 -0700
committerduritong <peter.meier+github@immerda.ch>2013-09-04 15:02:11 -0700
commit6043761b61716370b375d3e168b36b3bbe49b0e7 (patch)
treef1fca2b8b55997b3f644ead7fd5cb99e7694f231
parent57d9f3125bafaf3aebc228f0c718d1b104c35a4e (diff)
parent9fb3286e24548cb3a6a6722e57a005737246fb5a (diff)
Merge pull request #3 from justicel/master
Release of 0.0.2 module which includes template base configuration for t...
-rw-r--r--Modulefile2
-rw-r--r--manifests/config.pp36
-rw-r--r--manifests/init.pp6
-rw-r--r--manifests/master.pp28
-rw-r--r--metadata.json4
-rw-r--r--templates/troclarc.yaml.erb9
6 files changed, 61 insertions, 24 deletions
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..64444b1 100644
--- a/manifests/master.pp
+++ b/manifests/master.pp
@@ -3,13 +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
+ #Select if the upstream rubygems modules should be required for install
+ if $use_rubygems {
+ require rubygems::moneta
+ require rubygems::highline
+ }
+
+ #Manually install requirements via gem
+ if $install_deps {
+ package { 'moneta':
+ ensure => present,
+ provider => gem,
+ }
+ package { 'highline':
+ ensure => present,
+ provider => gem,
+ }
+ }
- package{'trocla':
+ #Main trocla install
+ 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 -%>