Hi all,
We use foreman_discovery plugin in our deployments, and we use one smart_proxy per "location", that proxy all communications to foreman and manage local stuff (discovery, dhcp, puppetmaster…). I set "proxy.url=https://foreman-proxy01.foo.example.com:8443 proxy.type=proxy" option to my default PXE template to test discovery from this smart proxy, but i wanted to handle it more genericaly for example "proxy.url=<%= smart_proxies[:tftp].url %> proxy.type=proxy" or something like that, but i don't want to have to add DNS entry for this stuff because we have a lot of DNS domains/subdomains and i wanted to handle this in one place.
···
On 13/11/15 11:31, Baptiste Agasse wrote:
> Hi all,
> We use foreman_discovery plugin in our deployments, and we use one smart_proxy per "location", that proxy all communications to foreman and manage local stuff (discovery, dhcp, puppetmaster...). I set "proxy.url=https://foreman-proxy01.foo.example.com:8443 proxy.type=proxy" option to my default PXE template to test discovery from this smart proxy, but i wanted to handle it more genericaly for example "proxy.url=<%= smart_proxies[:tftp].url %> proxy.type=proxy" or something like that, but i don't want to have to add DNS entry for this stuff because we have a lot of DNS domains/subdomains and i wanted to handle this in one place.
>
> There is any way to achieve this use case today ?
>> Hi all,
>> We use foreman_discovery plugin in our deployments, and we use one smart_proxy
>> per "location", that proxy all communications to foreman and manage local stuff
>> (discovery, dhcp, puppetmaster…). I set
>> "proxy.url=https://foreman-proxy01.foo.example.com:8443 proxy.type=proxy"
>> option to my default PXE template to test discovery from this smart proxy, but
>> i wanted to handle it more genericaly for example "proxy.url=<%=
>> smart_proxies[:tftp].url %> proxy.type=proxy" or something like that, but i
>> don't want to have to add DNS entry for this stuff because we have a lot of DNS
>> domains/subdomains and i wanted to handle this in one place.
>>
>> There is any way to achieve this use case today ?
>
> No, it's not possible if you're talking about the default PXELinux
> template as it's only rendered once and sent to all proxies.
>
> There was some work started in
> Bug #10286: Default PXE Menu should be isolated - Foreman (the linked PR) but it
> wasn't completed.
Ok, thank you, and for more general templates, like kickstart. For example to add repo for installation mirrored by pulp on the proxy, CentOS6 don't include subscription manager, so we have to add a repo. I've an error "undefined method 'smart_proxies' for Host::Managed::Jail (Host::Managed)" (safe mode is active) when I call @host.smart_proxies in kickstart template.
···
----- Le 13 Nov 15, à 12:40, Dominic Cleal dominic@cleal.org a écrit :
> On 13/11/15 11:31, Baptiste Agasse wrote:
Probably to access the TFTP smart proxy details you'd want to access @host.provision_interface.subnet.tftp_proxy.url or .hostname.
I think this would need tftp_proxy adding to the subnet Jail and a jail
adding to the SmartProxy class with url/hostname. Patches in this area
are very welcome, it's trivial to do and can be very helpful.
You can also disable safemode under settings, but it allows arbitrary
code execution - definitely not recommended.
···
On 13/11/15 14:11, Baptiste Agasse wrote:
> Hi,
>
> ----- Le 13 Nov 15, à 12:40, Dominic Cleal dominic@cleal.org a écrit :
>
>> On 13/11/15 11:31, Baptiste Agasse wrote:
>>> Hi all,
>>> We use foreman_discovery plugin in our deployments, and we use one smart_proxy
>>> per "location", that proxy all communications to foreman and manage local stuff
>>> (discovery, dhcp, puppetmaster...). I set
>>> "proxy.url=https://foreman-proxy01.foo.example.com:8443 proxy.type=proxy"
>>> option to my default PXE template to test discovery from this smart proxy, but
>>> i wanted to handle it more genericaly for example "proxy.url=<%=
>>> smart_proxies[:tftp].url %> proxy.type=proxy" or something like that, but i
>>> don't want to have to add DNS entry for this stuff because we have a lot of DNS
>>> domains/subdomains and i wanted to handle this in one place.
>>>
>>> There is any way to achieve this use case today ?
>>
>> No, it's not possible if you're talking about the default PXELinux
>> template as it's only rendered once and sent to all proxies.
>>
>> There was some work started in
>> http://projects.theforeman.org/issues/10286 (the linked PR) but it
>> wasn't completed.
>
> Ok, thank you, and for more general templates, like kickstart. For example to add repo for installation mirrored by pulp on the proxy, CentOS6 don't include subscription manager, so we have to add a repo. I've an error "undefined method 'smart_proxies' for Host::Managed::Jail (Host::Managed)" (safe mode is active) when I call @host.smart_proxies in kickstart template.