diff --git a/manifests/openstackwatch.pp b/manifests/openstackwatch.pp index 48ef0dd..feed6bc 100644 --- a/manifests/openstackwatch.pp +++ b/manifests/openstackwatch.pp @@ -1,6 +1,10 @@ # == Class: jeepyb::openstackwatch class jeepyb::openstackwatch( + $swift_username = '', + $swift_password = '', + $swift_auth_url = '', + $auth_version = '', $projects = [], $mode = 'multiple', $container = 'rss', @@ -24,17 +28,19 @@ class jeepyb::openstackwatch( require => Group['openstackwatch'], } - cron { 'openstackwatch': - ensure => present, - command => '/usr/local/bin/openstackwatch /home/openstackwatch/openstackwatch.ini', - minute => $minute, - hour => $hour, - user => 'openstackwatch', - require => [ - File['/home/openstackwatch/openstackwatch.ini'], - User['openstackwatch'], - Class['jeepyb'], - ], + if $swift_password != '' { + cron { 'openstackwatch': + ensure => present, + command => '/usr/local/bin/openstackwatch /home/openstackwatch/openstackwatch.ini', + minute => $minute, + hour => $hour, + user => 'openstackwatch', + require => [ + File['/home/openstackwatch/openstackwatch.ini'], + User['openstackwatch'], + Class['jeepyb'], + ], + } } file { '/home/openstackwatch/openstackwatch.ini': diff --git a/templates/openstackwatch.ini.erb b/templates/openstackwatch.ini.erb index 0d5203f..0b10a44 100644 --- a/templates/openstackwatch.ini.erb +++ b/templates/openstackwatch.ini.erb @@ -16,10 +16,10 @@ mode = <%= mode %> [swift] # username/tenant for swift with 2.0 or just username with 1.0 (i.e: # RAX). -# username = +username = <%= swift_username %> -# passowrd or api key -# password = +# password or api key +password = <%= swift_password %> # container to upload (probably want to be public) container = <%= container %> @@ -28,10 +28,10 @@ container = <%= container %> # https://auth.api.rackspacecloud.com/v1.0 # or Rackspace UK : # https://lon.auth.api.rackspacecloud.com/v1.0 -# auth_url = https://lon.auth.api.rackspacecloud.com/v1.0 +auth_url = <%= swift_auth_url %> # auth version (1.0 for Rackspace clouds, 2.0 for keystone backend clusters) -# auth_version = 1.0 +auth_version = <%= auth_version %> # the object name where to store the combined rss uploaded_file = <%= feed %>