diff options
author | varac <varacanero@zeromail.org> | 2012-12-07 14:49:22 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2012-12-07 14:49:22 +0100 |
commit | 528aaee2f24b2b1b57435df6db42b89af6ba76de (patch) | |
tree | 329f6c60a1ab0b730eae1aef74fc3e94ced22867 /puppet/modules/site_ca_daemon/manifests/init.pp | |
parent | 51f37d8132a44e25350db66b7156892980d3e4fa (diff) |
added module site_ca_daemon
Diffstat (limited to 'puppet/modules/site_ca_daemon/manifests/init.pp')
-rw-r--r-- | puppet/modules/site_ca_daemon/manifests/init.pp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/puppet/modules/site_ca_daemon/manifests/init.pp b/puppet/modules/site_ca_daemon/manifests/init.pp new file mode 100644 index 00000000..c749da12 --- /dev/null +++ b/puppet/modules/site_ca_daemon/manifests/init.pp @@ -0,0 +1,55 @@ +class site_ca_daemon { + + #$definition_files = hiera('definition_files') + #$provider = $definition_files['provider'] + #$eip_service = $definition_files['eip_service'] + + Class[Ruby] -> Class[rubygems] -> Class[bundler::install] + + class { 'ruby': ruby_version => '1.9.3' } + + class { 'bundler::install': install_method => 'package' } + + include rubygems + #include site_ca_daemon::apache + include site_ca_daemon::couchdb + + group { 'leap_ca_daemon': + ensure => present, + allowdupe => false; + } + + user { 'leap_ca_daemon': + ensure => present, + allowdupe => false, + gid => 'leap_ca_daemon', + home => '/srv/leap_ca_daemon', + require => [ Group['leap_ca_daemon'] ]; + } + + file { '/srv/leap_ca_daemon': + ensure => directory, + owner => 'leap_ca_daemon', + group => 'leap_ca_daemon', + require => User['leap_ca_daemon']; + } + + vcsrepo { '/srv/leap_ca_daemon': + ensure => present, + revision => 'origin/deploy', + provider => git, + source => 'git://code.leap.se/leap_ca', + owner => 'leap_ca_daemon', + group => 'leap_ca_daemon', + require => [ User['leap_ca_daemon'], Group['leap_ca_daemon'] ], + notify => Exec['bundler_update'] + } + + exec { 'bundler_update': + cwd => '/srv/leap_ca_daemon', + command => '/bin/bash -c "/usr/bin/bundle check || /usr/bin/bundle install"', + unless => '/usr/bin/bundle check', + require => [ Class['bundler::install'], Vcsrepo['/srv/leap_ca_daemon'] ]; + } + +} |