Access global parameters from foreman in facter

Hi all,

Is it possible to have access to foreman global parameters from facts?

Something like:
variable = Facter.global_pataremeter

Obviously this is not working for me.

Best regards,
Cristian Falcas

You mean inside a puppet manifest? If so, they are defined as top level
variables $::my_parameter

··· On Wed 27 Nov 2013 02:45:30 PM CET, Cristian Falcas wrote: > Hi all, > > Is it possible to have access to foreman global parameters from facts? > > Something like: > variable = Facter.global_pataremeter > > Obviously this is not working for me. > > Best regards, > Cristian Falcas >


David Caro

Red Hat S.L.
Continuous Integration Engineer - EMEA ENG Virtualization R&D

Email: dcaro@redhat.com
Web: www.redhat.com
RHT Global #: 82-62605

No, I was referring to facts scripts.

··· On Thu, Nov 28, 2013 at 10:43 AM, David Caro wrote: > On Wed 27 Nov 2013 02:45:30 PM CET, Cristian Falcas wrote: >> Hi all, >> >> Is it possible to have access to foreman global parameters from facts? >> >> Something like: >> variable = Facter.global_pataremeter >> >> Obviously this is not working for me. >> >> Best regards, >> Cristian Falcas >> > > You mean inside a puppet manifest? If so, they are defined as top level > variables $::my_parameter > > -- > David Caro > > Red Hat S.L. > Continuous Integration Engineer - EMEA ENG Virtualization R&D > > Email: dcaro@redhat.com > Web: www.redhat.com > RHT Global #: 82-62605 >

Then I think that it would be a lot harder, as it's generated by the
foreman server when accessed as external node classifier by puppet
master, and not by the host that runs facter, so as far as I see, that
host does not have access to that information. But I might be ignoring
something.

If you really need to access those parameters, you might want do create
a puppet class that adds those facts, but you might need more than one
run to refresh them, or call the enc directly from facter… but both
solutions sound really ugly to me :S

··· On Thu 28 Nov 2013 10:27:40 AM CET, Cristian Falcas wrote: > No, I was referring to facts scripts. > > > On Thu, Nov 28, 2013 at 10:43 AM, David Caro wrote: >> On Wed 27 Nov 2013 02:45:30 PM CET, Cristian Falcas wrote: >>> Hi all, >>> >>> Is it possible to have access to foreman global parameters from facts? >>> >>> Something like: >>> variable = Facter.global_pataremeter >>> >>> Obviously this is not working for me. >>> >>> Best regards, >>> Cristian Falcas >>> >> >> You mean inside a puppet manifest? If so, they are defined as top level >> variables $::my_parameter >> >> -- >> David Caro >> >> Red Hat S.L. >> Continuous Integration Engineer - EMEA ENG Virtualization R&D >> >> Email: dcaro@redhat.com >> Web: www.redhat.com >> RHT Global #: 82-62605 >> >


David Caro

Red Hat S.L.
Continuous Integration Engineer - EMEA ENG Virtualization R&D

Email: dcaro@redhat.com
Web: www.redhat.com
RHT Global #: 82-62605