Having a little trouble getting my proxy to be

I have what I think is a start to a smart-proxy which will handle registatration of hosts with a FreeIPA server . . . I can't get the Foreman front-end to make any calls to my proxy, though! I guess I'm missing something important, but I can't figure out what!

  • ./lib/proxy_api/realm.rb
  • module ProxyAPI
    class Realm < Resource
  • Two methods
  • set
  • delete
  • ./app/models/orchestration/realm.rb
  • module Orchestration::Realm
  • Methods
  • initialize_realm
  • delRegistration
  • calls realm.del_host
  • setRegistration
  • calls realm.add_host
  • queue_realm
  • queue_realm_create
  • queue_realm_destroy
  • app/models/host/managed.rb
  • include Orchestration::Realm

Any help here would be really appreciated! If seeing the entire source would help, it can be found at
https://github.com/guymatz/foreman as branch 1809-add_IPA_support<https://github.com/guymatz/foreman/tree/1809-add_IPA_support>

Thanks so much!

Regards,
Guy

P.S. - If it helps any, the smart-proxy code can be found at https://github.com/guymatz/smart-proxy under the same branch name as above

> From: "Guy Matz" <gmatz@collective.com>
> To: foreman-dev@googlegroups.com
> Sent: Tuesday, June 4, 2013 10:44:22 AM
> Subject: [foreman-dev] Having a little trouble getting my proxy to be
>
> I have what I think is a start to a smart-proxy which will handle
> registatration of hosts with a FreeIPA server . . . I can't get the Foreman
> front-end to make any calls to my proxy, though! I guess I'm missing
> something important, but I can't figure out what!

So you're having trouble getting foreman to connect to the proxy through the web interface? My initial reaction is that there is probably an iptables rule blocking it.

··· ----- Original Message -----
  • ./lib/proxy_api/realm.rb
    * module ProxyAPI
    class Realm < Resource
    * Two methods
    • set
    • delete
  • ./app/models/orchestration/realm.rb
    * module Orchestration::Realm
    • Methods
      * initialize_realm
      * delRegistration
      • calls realm.del_host
     *   setRegistration
        *   calls realm.add_host
     *   queue_realm
     *   queue_realm_create
     *   queue_realm_destroy
    
  • app/models/host/managed.rb
    * include Orchestration::Realm

Any help here would be really appreciated! If seeing the entire source would
help, it can be found at
GitHub - guymatz/foreman: an application that automates the lifecycle of servers as branch
1809-add_IPA_supporthttps://github.com/guymatz/foreman/tree/1809-add_IPA_support

Thanks so much!

Regards,
Guy

P.S. - If it helps any, the smart-proxy code can be found at
GitHub - guymatz/smart-proxy: RESTful proxies for DNS, DHCP, TFTP and Puppet under the same branch name as above


You received this message because you are subscribed to the Google Groups
“foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No, Sorry . … my problem is that on "Host Create" the foreman
front-end is not calling the methods I've set up - I think I've set up!

  • to be executed on the foreman server to make calls to the foreman proxy.

Running the following from my foreman server executes correctly on the
IPA proxy:
curl -H "Accept: application/json" -d "fqdn=utest.collmedia.net"
http://ipadevmstr.collmedia.net:8443/realm/

So the smart-proxy is OK, but the foreman server doesn't know how to
call it.

Thanks again,
Guy

··· On 06/04/2013 10:47 AM, Sam Kottler wrote: > > ----- Original Message ----- >> From: "Guy Matz" >> To: foreman-dev@googlegroups.com >> Sent: Tuesday, June 4, 2013 10:44:22 AM >> Subject: [foreman-dev] Having a little trouble getting my proxy to be >> >> I have what I think is a start to a smart-proxy which will handle >> registatration of hosts with a FreeIPA server . . . I can't get the Foreman >> front-end to make any calls to my proxy, though! I guess I'm missing >> something important, but I can't figure out what! > So you're having trouble getting foreman to connect to the proxy through the web interface? My initial reaction is that there is probably an iptables rule blocking it. > >> * ./lib/proxy_api/realm.rb >> * module ProxyAPI >> class Realm < Resource >> * Two methods >> * set >> * delete >> * ./app/models/orchestration/realm.rb >> * module Orchestration::Realm >> * Methods >> * initialize_realm >> * delRegistration >> * calls realm.del_host >> * setRegistration >> * calls realm.add_host >> * queue_realm >> * queue_realm_create >> * queue_realm_destroy >> * app/models/host/managed.rb >> * include Orchestration::Realm >> >> Any help here would be really appreciated! If seeing the entire source would >> help, it can be found at >> https://github.com/guymatz/foreman as branch >> 1809-add_IPA_support >> >> Thanks so much! >> >> Regards, >> Guy >> >> P.S. - If it helps any, the smart-proxy code can be found at >> https://github.com/guymatz/smart-proxy under the same branch name as above >> >> -- >> You received this message because you are subscribed to the Google Groups >> "foreman-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-dev+unsubscribe@googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >>

You need to add some orchestration code to do this, e.g.
app/models/orchestration/dns.rb but specifically for realms. These bits
of code then call the ones in lib/proxy_api/. This gets included into
the host in app/models/host/managed.rb ("include Orchestration::Compute").

You could also try foreman_hooks for now to trigger it, but the current
release I think is a bit broken on 1.1.

··· On 04/06/13 16:15, Guy Matz wrote: > No, Sorry . .. my problem is that on "Host Create" the foreman > front-end is not calling the methods I've set up - I think I've set up! > - to be executed on the foreman server to make calls to the foreman proxy. > > Running the following from my foreman server executes correctly on the > IPA proxy: > curl -H "Accept: application/json" -d "fqdn=utest.collmedia.net" > http://ipadevmstr.collmedia.net:8443/realm/ > > So the smart-proxy is OK, but the foreman server doesn't know how to > call it.


Dominic Cleal
Red Hat Engineering

Right! Thanks, So in my original email I said that I have the following set up:

  • ./lib/proxy_api/realm.rb
  • module ProxyAPI
    class Realm < Resource
  • Two methods
  • set
  • delete
  • ./app/models/orchestration/realm.rb
  • module Orchestration::Realm
  • Methods
  • initialize_realm
  • delRegistration
  • calls realm.del_host
  • setRegistration
  • calls realm.add_host
  • queue_realm
  • queue_realm_create
  • queue_realm_destroy
  • app/models/host/managed.rb
  • include Orchestration::Realm

This is, I think, just as you outline below, but still the foreman server doesn't seem to make use of them . . . It seems I'm missing some little bit here, but I can't tell what. :frowning:

Thanks again,
Guy

··· On 06/04/2013 11:28 AM, Dominic Cleal wrote:

On 04/06/13 16:15, Guy Matz wrote:

No, Sorry . … my problem is that on “Host Create” the foreman
front-end is not calling the methods I’ve set up - I think I’ve set up!

  • to be executed on the foreman server to make calls to the foreman proxy.

Running the following from my foreman server executes correctly on the
IPA proxy:
curl -H “Accept: application/json” -d "fqdn=utest.collmedia.net"
http://ipadevmstr.collmedia.net:8443/realm/

So the smart-proxy is OK, but the foreman server doesn’t know how to
call it.

You need to add some orchestration code to do this, e.g.
app/models/orchestration/dns.rb but specifically for realms. These bits
of code then call the ones in lib/proxy_api/. This gets included into
the host in app/models/host/managed.rb (“include Orchestration::Compute”).

You could also try foreman_hooks for now to trigger it, but the current
release I think is a bit broken on 1.1.

Sorry, that should have been

  • ./lib/proxy_api/realm.rb
  • module ProxyAPI
    class Realm < Resource
  • Two methods
  • add_host
  • del_host
··· On 06/04/2013 12:30 PM, Guy Matz wrote: Right! Thanks, So in my original email I said that I have the following set up:
  • ./lib/proxy_api/realm.rb
  • module ProxyAPI
    class Realm < Resource
  • Two methods
  • set
  • delete
  • ./app/models/orchestration/realm.rb
  • module Orchestration::Realm
  • Methods
  • initialize_realm
  • delRegistration
  • calls realm.del_host
  • setRegistration
  • calls realm.add_host
  • queue_realm
  • queue_realm_create
  • queue_realm_destroy
  • app/models/host/managed.rb
  • include Orchestration::Realm

This is, I think, just as you outline below, but still the foreman server doesn’t seem to make use of them . . . It seems I’m missing some little bit here, but I can’t tell what. :frowning:

Thanks again,
Guy

On 06/04/2013 11:28 AM, Dominic Cleal wrote:

On 04/06/13 16:15, Guy Matz wrote:

No, Sorry . … my problem is that on “Host Create” the foreman
front-end is not calling the methods I’ve set up - I think I’ve set up!

  • to be executed on the foreman server to make calls to the foreman proxy.

Running the following from my foreman server executes correctly on the
IPA proxy:
curl -H “Accept: application/json” -d "fqdn=utest.collmedia.net"
http://ipadevmstr.collmedia.net:8443/realm/

So the smart-proxy is OK, but the foreman server doesn’t know how to
call it.

You need to add some orchestration code to do this, e.g.
app/models/orchestration/dns.rb but specifically for realms. These bits
of code then call the ones in lib/proxy_api/. This gets included into
the host in app/models/host/managed.rb (“include Orchestration::Compute”).

You could also try foreman_hooks for now to trigger it, but the current
release I think is a bit broken on 1.1.


You received this message because you are subscribed to the Google Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.commailto:foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

> Sorry, that should have been
>
> - ./lib/proxy_api/realm.rb
> - module ProxyAPI
> class Realm < Resource
> - Two methods
> - add_host
> - del_host
>
>
> Right! Thanks, So in my original email I said that I have the following
> set up:
>
> - ./lib/proxy_api/realm.rb
> - module ProxyAPI
> class Realm < Resource
> - Two methods
> - set
> - delete
> - ./app/models/orchestration/realm.rb
> - module Orchestration::Realm
> - Methods
> - initialize_realm
>
> did you register them as after_validations, before destory etc callbacks?

where is the code? :slight_smile:
Ohad

··· On Tue, Jun 4, 2013 at 7:38 PM, Guy Matz wrote: > On 06/04/2013 12:30 PM, Guy Matz wrote:
        • delRegistration
          • calls realm.del_host
        • setRegistration
          • calls realm.add_host
        • queue_realm
        • queue_realm_create
        • queue_realm_destroy
      • app/models/host/managed.rb
    • include Orchestration::Realm

This is, I think, just as you outline below, but still the foreman server
doesn’t seem to make use of them . . . It seems I’m missing some little
bit here, but I can’t tell what. :frowning:

Thanks again,
Guy

On 06/04/2013 11:28 AM, Dominic Cleal wrote:

On 04/06/13 16:15, Guy Matz wrote:

No, Sorry . … my problem is that on “Host Create” the foreman
front-end is not calling the methods I’ve set up - I think I’ve set up!

  • to be executed on the foreman server to make calls to the foreman proxy.

Running the following from my foreman server executes correctly on the
IPA proxy:
curl -H “Accept: application/json” -d "fqdn=utest.collmedia.net"http://ipadevmstr.collmedia.net:8443/realm/

So the smart-proxy is OK, but the foreman server doesn’t know how to
call it.

You need to add some orchestration code to do this, e.g.
app/models/orchestration/dns.rb but specifically for realms. These bits
of code then call the ones in lib/proxy_api/. This gets included into
the host in app/models/host/managed.rb (“include Orchestration::Compute”).

You could also try foreman_hooks for now to trigger it, but the current
release I think is a bit broken on 1.1.


You received this message because you are subscribed to the Google Groups
“foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups
“foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Yes, I did:

module Orchestration::Realm
def self.included(base)
base.send :include, InstanceMethods
base.class_eval do
attr_reader :realm
after_validation :queue_realm
before_destroy :queue_realm_destroy unless Rails.env == "test"
end
end

The code is in https://github.com/guymatz/foreman as branch 1809-add_IPA_support

I think I'm missing a realm_proxy from my model . . .

Thanks so much!

Regards,
Guy

P.S. - If you need it, the smart-proxy code is in https://github.com/guymatz/smart-proxy under the same branch name as above

··· On 06/04/2013 02:54 PM, Ohad Levy wrote:

On Tue, Jun 4, 2013 at 7:38 PM, Guy Matz <gmatz@collective.commailto:gmatz@collective.com> wrote:
Sorry, that should have been

  • ./lib/proxy_api/realm.rb
  • module ProxyAPI
    class Realm < Resource
  • Two methods
  • add_host
  • del_host

On 06/04/2013 12:30 PM, Guy Matz wrote:
Right! Thanks, So in my original email I said that I have the following set up:

  • ./lib/proxy_api/realm.rb
  • module ProxyAPI
    class Realm < Resource
  • Two methods
  • set
  • delete
  • ./app/models/orchestration/realm.rb
  • module Orchestration::Realm
  • Methods
  • initialize_realm

did you register them as after_validations, before destory etc callbacks?

where is the code? :slight_smile:
Ohad

        • delRegistration
        • calls realm.del_host
        • setRegistration
        • calls realm.add_host
        • queue_realm
        • queue_realm_create
        • queue_realm_destroy
  • app/models/host/managed.rb
  • include Orchestration::Realm

This is, I think, just as you outline below, but still the foreman server doesn’t seem to make use of them . . . It seems I’m missing some little bit here, but I can’t tell what. :frowning:

Thanks again,
Guy

On 06/04/2013 11:28 AM, Dominic Cleal wrote:

On 04/06/13 16:15, Guy Matz wrote:

No, Sorry . … my problem is that on “Host Create” the foreman
front-end is not calling the methods I’ve set up - I think I’ve set up!

  • to be executed on the foreman server to make calls to the foreman proxy.

Running the following from my foreman server executes correctly on the
IPA proxy:
curl -H “Accept: application/json” -d "fqdn=utest.collmedia.nethttp://utest.collmedia.net"
http://ipadevmstr.collmedia.net:8443/realm/

So the smart-proxy is OK, but the foreman server doesn’t know how to
call it.

You need to add some orchestration code to do this, e.g.
app/models/orchestration/dns.rb but specifically for realms. These bits
of code then call the ones in lib/proxy_api/. This gets included into
the host in app/models/host/managed.rb (“include Orchestration::Compute”).

You could also try foreman_hooks for now to trigger it, but the current
release I think is a bit broken on 1.1.


You received this message because you are subscribed to the Google Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.commailto:foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.commailto:foreman-dev%2Bunsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.commailto:foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi! Sorry to be a pain again, but if anyone has any suggestions as to how I can get foreman to call my proxy, I'd really appreciate it!

Good talk last night, Sam! And on such short notice!!

Regards,
Guy

··· On 06/04/2013 03:21 PM, Guy Matz wrote: Yes, I did:

module Orchestration::Realm
def self.included(base)
base.send :include, InstanceMethods
base.class_eval do
attr_reader :realm
after_validation :queue_realm
before_destroy :queue_realm_destroy unless Rails.env == "test"
end
end

The code is in https://github.com/guymatz/foreman as branch 1809-add_IPA_support

I think I’m missing a realm_proxy from my model . . .

Thanks so much!

Regards,
Guy

P.S. - If you need it, the smart-proxy code is in https://github.com/guymatz/smart-proxy under the same branch name as above

On 06/04/2013 02:54 PM, Ohad Levy wrote:

On Tue, Jun 4, 2013 at 7:38 PM, Guy Matz <gmatz@collective.commailto:gmatz@collective.com> wrote:
Sorry, that should have been

  • ./lib/proxy_api/realm.rb
  • module ProxyAPI
    class Realm < Resource
  • Two methods
  • add_host
  • del_host

On 06/04/2013 12:30 PM, Guy Matz wrote:
Right! Thanks, So in my original email I said that I have the following set up:

  • ./lib/proxy_api/realm.rb
  • module ProxyAPI
    class Realm < Resource
  • Two methods
  • set
  • delete
  • ./app/models/orchestration/realm.rb
  • module Orchestration::Realm
  • Methods
  • initialize_realm

did you register them as after_validations, before destory etc callbacks?

where is the code? :slight_smile:
Ohad

        • delRegistration
        • calls realm.del_host
        • setRegistration
        • calls realm.add_host
        • queue_realm
        • queue_realm_create
        • queue_realm_destroy
  • app/models/host/managed.rb
  • include Orchestration::Realm

This is, I think, just as you outline below, but still the foreman server doesn’t seem to make use of them . . . It seems I’m missing some little bit here, but I can’t tell what. :frowning:

Thanks again,
Guy

On 06/04/2013 11:28 AM, Dominic Cleal wrote:

On 04/06/13 16:15, Guy Matz wrote:

No, Sorry . … my problem is that on “Host Create” the foreman
front-end is not calling the methods I’ve set up - I think I’ve set up!

  • to be executed on the foreman server to make calls to the foreman proxy.

Running the following from my foreman server executes correctly on the
IPA proxy:
curl -H “Accept: application/json” -d "fqdn=utest.collmedia.nethttp://utest.collmedia.net"
http://ipadevmstr.collmedia.net:8443/realm/

So the smart-proxy is OK, but the foreman server doesn’t know how to
call it.

You need to add some orchestration code to do this, e.g.
app/models/orchestration/dns.rb but specifically for realms. These bits
of code then call the ones in lib/proxy_api/. This gets included into
the host in app/models/host/managed.rb (“include Orchestration::Compute”).

You could also try foreman_hooks for now to trigger it, but the current
release I think is a bit broken on 1.1.


You received this message because you are subscribed to the Google Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.commailto:foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.commailto:foreman-dev%2Bunsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.commailto:foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

> Hi! Sorry to be a pain again, but if anyone has any suggestions as to
> how I can get foreman to call my proxy, I'd really appreciate it!
>
> Good talk last night, Sam! And on such short notice!!
>
Guy, I'm really sorry we are slow to respond, most of us were pretty
tighed up with current work and had very little time to do proper review,
I'll try to do it early next week…

Really appreciate your hard work! thanks!
Ohad

··· On Fri, Jun 7, 2013 at 8:42 PM, Guy Matz wrote:

Regards,

Guy

On 06/04/2013 03:21 PM, Guy Matz wrote:

Yes, I did:

module Orchestration::Realm
def self.included(base)
base.send :include, InstanceMethods
base.class_eval do
attr_reader :realm
after_validation :queue_realm
before_destroy :queue_realm_destroy unless Rails.env == “test”
end
end

The code is in GitHub - guymatz/foreman: an application that automates the lifecycle of servers as branch
1809-add_IPA_support

I think I’m missing a realm_proxy from my model . . .

Thanks so much!

Regards,
Guy

P.S. - If you need it, the smart-proxy code is in
GitHub - guymatz/smart-proxy: RESTful proxies for DNS, DHCP, TFTP and Puppet under the same branch name as above

On 06/04/2013 02:54 PM, Ohad Levy wrote:

On Tue, Jun 4, 2013 at 7:38 PM, Guy Matz gmatz@collective.com wrote:

Sorry, that should have been

  • ./lib/proxy_api/realm.rb
    • module ProxyAPI
      class Realm < Resource
    • Two methods
      • add_host
      • del_host

On 06/04/2013 12:30 PM, Guy Matz wrote:

Right! Thanks, So in my original email I said that I have the following
set up:

  • ./lib/proxy_api/realm.rb
    • module ProxyAPI
      class Realm < Resource
    • Two methods
      • set
      • delete
    • ./app/models/orchestration/realm.rb
    • module Orchestration::Realm
      • Methods
        • initialize_realm

did you register them as after_validations, before destory etc
callbacks?

where is the code? :slight_smile:
Ohad

        • delRegistration
          • calls realm.del_host
        • setRegistration
          • calls realm.add_host
        • queue_realm
        • queue_realm_create
        • queue_realm_destroy
      • app/models/host/managed.rb
    • include Orchestration::Realm

This is, I think, just as you outline below, but still the foreman server
doesn’t seem to make use of them . . . It seems I’m missing some little
bit here, but I can’t tell what. :frowning:

Thanks again,
Guy

On 06/04/2013 11:28 AM, Dominic Cleal wrote:

On 04/06/13 16:15, Guy Matz wrote:

No, Sorry . … my problem is that on “Host Create” the foreman
front-end is not calling the methods I’ve set up - I think I’ve set up!

  • to be executed on the foreman server to make calls to the foreman proxy.

Running the following from my foreman server executes correctly on the
IPA proxy:
curl -H “Accept: application/json” -d "fqdn=utest.collmedia.net"http://ipadevmstr.collmedia.net:8443/realm/

So the smart-proxy is OK, but the foreman server doesn’t know how to
call it.

You need to add some orchestration code to do this, e.g.
app/models/orchestration/dns.rb but specifically for realms. These bits
of code then call the ones in lib/proxy_api/. This gets included into
the host in app/models/host/managed.rb (“include Orchestration::Compute”).

You could also try foreman_hooks for now to trigger it, but the current
release I think is a bit broken on 1.1.


You received this message because you are subscribed to the Google Groups
“foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups
“foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups
“foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


You received this message because you are subscribed to the Google Groups
“foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.