diff --git a/manifests/bdii.pp b/manifests/bdii.pp new file mode 100644 index 0000000..946616b --- /dev/null +++ b/manifests/bdii.pp @@ -0,0 +1,52 @@ +class argus_server::bdii( + $site_name = $argus_server::site_name, + $bdii_config_dir = $argus_server::bdii_config_dir +) { + + # ARGUS configuration files + + file { '/var/lib/bdii/gip/provider/glite-info-glue2-provider-service-argus': + ensure => 'present', + owner => 'ldap', + group => 'ldap', + mode => '0655', + content => template("${module_name}/glite-info-glue2-provider-service-argus.erb"), + require => Package['glite-info-provider-service'], + notify => Service['bdii'], + } + + service { 'bdii': + ensure => running, + enable => true, + hasstatus => true, + hasrestart => true, + require => Package['bdii'], + } + + + file {"${bdii_config_dir}/glite-info-glue2-argus-pap.conf": + ensure => 'link', + target => "${bdii_config_dir}/glite-info-glue2-argus-pap.conf.template", + require => Package['glite-info-provider-service'], + } + + file {"${bdii_config_dir}/glite-info-glue2-argus-pdp.conf": + ensure => 'link', + target => "${bdii_config_dir}/glite-info-glue2-argus-pdp.conf.template", + require => Package['glite-info-provider-service'], + } + + file {"${bdii_config_dir}/glite-info-glue2-argus-pep.conf": + ensure => 'link', + target => "${bdii_config_dir}/glite-info-glue2-argus-pep.conf.template", + require => Package['glite-info-provider-service'], + } + + file {"${bdii_config_dir}/glite-info-glue2-service-argus.conf": + ensure => 'link', + target => "${bdii_config_dir}/glite-info-glue2-service-argus.conf.template", + require => Package['glite-info-provider-service'], + } + + +} diff --git a/manifests/config.pp b/manifests/config.pp index cece4da..cf9fe9b 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -13,6 +13,7 @@ $servicekey = $argus_server::servicekey, $servicecert_source = $argus_server::servicecert_source, $servicekey_source = $argus_server::servicekey_source, + $configure_bdii = $argus_server::configure_bdii ) { # ARGUS configuration files @@ -51,6 +52,10 @@ content => template("${module_name}/pepd.ini.erb"), notify => Service['argus-pepd'], } + + if $configure_bdii { + class { 'argus_server::bdii':} + } if $manage_certificate { if $servicecert_source != '' { diff --git a/manifests/init.pp b/manifests/init.pp index 953f061..36e4843 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,8 +13,10 @@ class argus_server ( $argus_host_dn, $admin_password, + $site_name = 'MY-DUMMY-SITE', $argus_host = $::fqdn, $packages = ['java-1.8.0-openjdk', 'argus-authz', 'bdii', 'glite-info-provider-service'], + $bdii_config_dir = '/etc/glite/info/service', $pap_poll_interval = 3600, $pdp_retention_interval = 240, $pap_policy = {}, @@ -22,6 +24,8 @@ $centralban_host = 'argusngi.gridpp.rl.ac.uk', $centralban_dn = '/C=UK/O=eScience/OU=CLRC/L=RAL/CN=argusngi.gridpp.rl.ac.uk', $manage_certificate = true, + $manage_argus_policy = true, + $configure_bdii = false, $servicecert = '/etc/grid-security/hostcert.pem', $servicekey = '/etc/grid-security/hostkey.pem', $servicecert_source = '', @@ -39,10 +43,17 @@ fail("OS family ${facts['os']['family']} is not supported by this module") } } + if $manage_argus_policy { + class { 'argus_server::install': } + class { 'argus_server::config': } + class { 'argus_server::services': } + class { 'argus_server::policy': } + Class['argus_server::install'] -> Class['argus_server::config'] -> Class['argus_server::services'] -> Class['argus_server::policy'] - class { 'argus_server::install': } - class { 'argus_server::config': } - class { 'argus_server::services': } - class { 'argus_server::policy': } - Class['argus_server::install'] -> Class['argus_server::config'] -> Class['argus_server::services'] -> Class['argus_server::policy'] -} + } else { + class { 'argus_server::install': } + class { 'argus_server::config': } + class { 'argus_server::services': } + Class['argus_server::install'] -> Class['argus_server::config'] -> Class['argus_server::services'] + } +} diff --git a/manifests/services.pp b/manifests/services.pp index b0ca308..65ba999 100644 --- a/manifests/services.pp +++ b/manifests/services.pp @@ -10,7 +10,7 @@ require => Class['fetchcrl::install'], unless => '/bin/ls /etc/grid-security/certificates/*.r0 1>/dev/null 2>&1' } - + if $manage_certificate { exec { 'hostcert update': command => $argus_server::restart_cmd, refreshonly => true, @@ -18,8 +18,8 @@ File[$servicecert], File[$servicekey], ], + } } - service { 'argus-pap': ensure => 'running', enable => true, diff --git a/templates/glite-info-glue2-provider-service-argus.erb b/templates/glite-info-glue2-provider-service-argus.erb new file mode 100644 index 0000000..6c93176 --- /dev/null +++ b/templates/glite-info-glue2-provider-service-argus.erb @@ -0,0 +1,11 @@ +#!/bin/sh + +## +# Argus services GLUE2 info provider +# Created by Puppet Module +# +# See: /etc/argus/info-glue2 +## + +/usr/bin/glite-info-glue2-multi /etc/argus/info-glue2/glite-info-glue2-argus-pap.conf,/etc/argus/info-glue2/glite-info-glue2-argus-pdp.conf,/etc/argus/info-glue2/glite-info-glue2-argus-pep.conf <%= @site_name %> /etc/argus/info-glue2/glite-info-glue2-service-argus.conf +