It's possible to make some kind of a workaround (like with everything). You have to remember that the default enc script request the YAML from Foreman using the Puppet's agent certname. If you just change the hostname it still request the YAML using the old "hostname" (certname). If you really need this, you can use UUID generated certs or implement a small module that will trigger a rename (for example, if the certname differs from the hostname foreman gives) This rename will need to regenerate certs, etc and resend the facts to Foreman
I will take a very caution for when using it as if by mistake someone will use an old hostname (that was renamed) it can create some issues which as sometimes will be difficult to debug. As with any CM it all depends on your environment, team, workflows implemented, etc... On Wednesday, September 7, 2016 at 6:41:14 AM UTC+3, Luke Tinker wrote: > > Hi everyone, > > hopefully someone can point me in the right direction here > I started using foreman earlier this year, > > The short of what i want to achieve is have Foreman Host Name field > provided as a fact so puppet can use it to ensure the hostname is enforced, > this is so when a machine is pre-created in foreman, puppet can ensure its > hostname is always correct, > also making renaming the machine possible via foreman. > > The most obvious place to find this information is via the YAML output > values provided per host, specifically the primary interface's name value. > however is this the best source, is it possible to get the host name from > the Name* field when you go to edit a host, thus allowing for the direct > change if its name is changed? > > any assistance would be greatly appreciated, even if its a simple push in > a certain direction. > > Cheers, > Luke > > > > -- You received this message because you are subscribed to the Google Groups "Foreman users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/foreman-users. For more options, visit https://groups.google.com/d/optout.
