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!
···
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?
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.
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.