Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Multiple hosts with same name in masterless puppet and exported resources

$
0
0
I'm managing /etc/hosts in openstack projects using puppet in a masterless setup using exported resources as seen below, where I use tag = openstack_project_id where the ID is a unique id of an openstack project/tennant. But the problem is when I have hosts with the same name in two different projects I run into some kind of a race condition, where hosts start to disappear randomly from /etc/hosts, I'd think the tag would prevent this but I'm not too familiar with how stored configs work in PupptDB. Any suggestions how I could fix this, since I do not have the luxury of ensuring unique hostnames if $::openstack_project_id { resources { 'host': purge => true, } @@host { "${::openstack_project_id}-${::fqdn}": name => $::fqdn, ensure => present, ip => $::ipaddress, host_aliases => $::hostname, tag => $::openstack_project_id, } Host <<| tag == $::openstack_project_id |>> } else { warning('openstack_project_id fact must be set') }

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>