diff --git a/deployment_scripts/hiera-override.pp b/deployment_scripts/hiera-override.pp index 0f89b75..a2b6a2a 100644 --- a/deployment_scripts/hiera-override.pp +++ b/deployment_scripts/hiera-override.pp @@ -153,10 +153,21 @@ amqp_hosts: <%= @amqp_hosts %> ensure => 'installed', } - file_line {"${plugin_name}_hiera_override": - path => '/etc/hiera.yaml', - line => " - override/${plugin_name}", - after => ' - override/module/%{calling_module}', + # hiera file changes between 7.0 and 8.0 so we need to handle the override the + # different yaml formats via these exec hacks. It should be noted that the + # fuel hiera task will wipe out these this update to the hiera.yaml + exec { "${plugin_name}_hiera_override_7.0": + command => "sed '/ - override\/plugins/a\ - override\/${plugin_name}' /etc/hiera.yaml", + path => '/bin:/usr/bin', + unless => "grep -q '^ - override/${plugin_name}' /etc/hiera.yaml", + onlyif => 'grep -q "^ - override/plugins" /etc/hiera.yaml' + } + + exec { "${plugin_name}_hiera_override_8.0": + command => "sed '/ - override\/plugins/a\ - override\/${plugin_name}' /etc/hiera.yaml", + path => '/bin:/usr/bin', + unless => "grep -q '^ - override/${plugin_name}' /etc/hiera.yaml", + onlyif => 'grep -q "^ - override/plugins" /etc/hiera.yaml' } #FIXME(mattymo): https://bugs.launchpad.net/fuel/+bug/1479317