diff --git a/manifests/nodepool_builder.pp b/manifests/nodepool_builder.pp index db35c88..c29e948 100644 --- a/manifests/nodepool_builder.pp +++ b/manifests/nodepool_builder.pp @@ -16,7 +16,7 @@ # == Class: openstackci::nodepool_builder # class openstackci::nodepool_builder ( - $oscc_file_contents, + $oscc_file_contents = undef, $mysql_root_password = '', $mysql_password = '', $nodepool_ssh_public_key = undef, @@ -114,16 +114,18 @@ class openstackci::nodepool_builder ( ], } - file { '/home/nodepool/.config/openstack/clouds.yaml': - ensure => present, - owner => 'nodepool', - group => 'nodepool', - mode => '0400', - content => $oscc_file_contents, - require => [ - File['/home/nodepool/.config/openstack'], - User['nodepool'], - ], + if $oscc_file_contents { + file { '/home/nodepool/.config/openstack/clouds.yaml': + ensure => present, + owner => 'nodepool', + group => 'nodepool', + mode => '0400', + content => $oscc_file_contents, + require => [ + File['/home/nodepool/.config/openstack'], + User['nodepool'], + ], + } } } diff --git a/manifests/nodepool_launcher.pp b/manifests/nodepool_launcher.pp index 6ab2dfd..80d115f 100644 --- a/manifests/nodepool_launcher.pp +++ b/manifests/nodepool_launcher.pp @@ -16,7 +16,7 @@ # == Class: openstackci::nodepool_launcher # class openstackci::nodepool_launcher ( - $oscc_file_contents, + $oscc_file_contents = undef, $nodepool_ssh_private_key = undef, $mysql_root_password = '', $mysql_password = '', @@ -90,15 +90,17 @@ class openstackci::nodepool_launcher ( ], } - file { '/home/nodepool/.config/openstack/clouds.yaml': - ensure => present, - owner => 'nodepool', - group => 'nodepool', - mode => '0400', - content => $oscc_file_contents, - require => [ - File['/home/nodepool/.config/openstack'], - User['nodepool'], - ], + if $oscc_file_contents { + file { '/home/nodepool/.config/openstack/clouds.yaml': + ensure => present, + owner => 'nodepool', + group => 'nodepool', + mode => '0400', + content => $oscc_file_contents, + require => [ + File['/home/nodepool/.config/openstack'], + User['nodepool'], + ], + } } }