Hi Erez and Marek, I should have explained my setup a little more, I am generating certificates based on a Unique Identifier so the names are quite separate from the certificates used to identify with puppet, however the names in foreman need to be very accurate for everything to work smoothly.
I thought using the name value from the interface with the primary marked as true would be the best option, just wasn't sure if there was some easier option, I'm still having trying to learn how to work best with an ENC as i find it difficult to test while writing config, so figuring out how to leverage this will be interesting, if you have any tips it would be greatly appreciated. Cheers for the help, Luke On Wednesday, 7 September 2016 18:21:18 UTC+10, Erez Zarum wrote: > > 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.
