Make oscc_file_contents optional

The openstack infra team is moving the managmeent of clouds.yaml files
from puppet to ansible. To keep puppet and ansible from fighting with
each other over the contents of this file make the contents optional
here. If provided puppet will manage them otherwise puppet doesn't touch
the clouds.yaml file.

Change-Id: I037abf2fb64a63af160ea6e25ce300197f7f513f
This commit is contained in:
Clark Boylan 2018-08-30 15:19:24 -07:00
parent 173d2cf49d
commit f5ac2b3944
2 changed files with 26 additions and 22 deletions

View File

@ -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'],
],
}
}
}

View File

@ -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'],
],
}
}
}