From 69e626d819317ce977007571714dd7a2f1235492 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 20 Nov 2013 13:13:36 -0500 Subject: initial tapicero configuration Change-Id: Ie53b09df0758ba01b30ed658bee04682bc180b01 --- puppet/modules/tapicero/manifests/init.pp | 126 ++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 puppet/modules/tapicero/manifests/init.pp (limited to 'puppet/modules/tapicero/manifests') diff --git a/puppet/modules/tapicero/manifests/init.pp b/puppet/modules/tapicero/manifests/init.pp new file mode 100644 index 00000000..fe33ac75 --- /dev/null +++ b/puppet/modules/tapicero/manifests/init.pp @@ -0,0 +1,126 @@ +class tapicero { + tag 'leap_service' + + $couchdb = hiera('couch') + $couchdb_port = $couchdb['port'] + + $couchdb_users = $couchdb['users'] + + $couchdb_admin_user = $couchdb_users['admin']['username'] + $couchdb_admin_password = $couchdb_users['admin']['password'] + + $couchdb_soledad_user = $couchdb_users['soledad']['username'] + $couchdb_soledad_password = $couchdb_users['soledad']['password'] + + $couchdb_leap_mx_user = $couchdb_users['leap_mx']['username'] + $couchdb_leap_mx_password = $couchdb_users['leap_mx']['password'] + + + Class['site_config::default'] -> Class['tapicero'] + + include site_config::ruby::dev + + # + # USER AND GROUP + # + + group { 'tapicero': + ensure => present, + allowdupe => false; + } + + user { 'tapicero': + ensure => present, + allowdupe => false, + gid => 'tapicero', + home => '/srv/leap/tapicero', + require => Group['tapicero']; + } + + # + # TAPICERO FILES + # + + file { + + ## + ## TAPICERO DIRECTORIES + ## + + '/srv/leap/tapicero': + ensure => directory, + owner => 'tapicero', + group => 'tapicero', + require => User['tapicero']; + + '/var/lib/leap/tapicero': + ensure => directory, + owner => 'tapicero', + group => 'tapicero', + require => User['tapicero']; + + ## + ## TAPICERO CONFIG + ## + + '/etc/leap/tapicero.yaml': + content => template('tapicero/tapicero.yaml.erb'), + owner => 'tapicero', + group => 'tapicero', + mode => '0600', + notify => Service['tapicero']; + + ## + ## TAPICERO INIT + ## + + '/etc/init.d/tapicero': + source => 'puppet:///modules/tapicero/tapicero.init', + owner => root, + group => 0, + mode => '0755', + require => Vcsrepo['/srv/leap/tapicero']; + } + + # + # TAPICERO CODE + # + + vcsrepo { '/srv/leap/tapicero': + ensure => present, + force => true, + revision => 'origin/master', + provider => git, + source => 'https://leap.se/git/tapicero', + owner => 'tapicero', + group => 'tapicero', + require => [ User['tapicero'], Group['tapicero'] ], + notify => Exec['tapicero_bundler_update'] + } + + exec { 'tapicero_bundler_update': + cwd => '/srv/leap/tapicero', + command => '/bin/bash -c "/usr/bin/bundle check || /usr/bin/bundle install --path vendor/bundle --without test development"', + unless => '/usr/bin/bundle check', + user => 'tapicero', + timeout => 600, + require => [ + Class['bundler::install'], + Vcsrepo['/srv/leap/tapicero'], + Class['site_config::ruby::dev'] ], + notify => Service['tapicero']; + } + + # + # TAPICERO DAEMON + # + + service { 'tapicero': + ensure => running, + enable => true, + hasstatus => true, + hasrestart => true, + require => File['/etc/init.d/tapicero']; + } + +} -- cgit v1.2.3 From 6d3f584bb2b1ff63cd3a1973585807d283fc9041 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 28 Nov 2013 10:02:07 -0500 Subject: remove unnecessary soledad/leap_mx hiera password variables from tapicero Change-Id: I17827fb88db9de088f638899433f5df1be9c3615 --- puppet/modules/tapicero/manifests/init.pp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'puppet/modules/tapicero/manifests') diff --git a/puppet/modules/tapicero/manifests/init.pp b/puppet/modules/tapicero/manifests/init.pp index fe33ac75..743e8a84 100644 --- a/puppet/modules/tapicero/manifests/init.pp +++ b/puppet/modules/tapicero/manifests/init.pp @@ -9,11 +9,8 @@ class tapicero { $couchdb_admin_user = $couchdb_users['admin']['username'] $couchdb_admin_password = $couchdb_users['admin']['password'] - $couchdb_soledad_user = $couchdb_users['soledad']['username'] - $couchdb_soledad_password = $couchdb_users['soledad']['password'] - - $couchdb_leap_mx_user = $couchdb_users['leap_mx']['username'] - $couchdb_leap_mx_password = $couchdb_users['leap_mx']['password'] + $couchdb_soledad_user = $couchdb_users['soledad']['username'] + $couchdb_leap_mx_user = $couchdb_users['leap_mx']['username'] Class['site_config::default'] -> Class['tapicero'] -- cgit v1.2.3