Module: ForemanSalt::Concerns::HostgroupExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/foreman_salt/concerns/hostgroup_extensions.rb
Instance Method Summary collapse
- #all_salt_modules ⇒ Object
- #inherited_salt_environment_id ⇒ Object
- #inherited_salt_module_ids ⇒ Object
- #inherited_salt_modules ⇒ Object
- #inherited_salt_proxy_id ⇒ Object
- #salt_environment ⇒ Object
- #salt_master ⇒ Object
- #salt_proxy ⇒ Object
Instance Method Details
#all_salt_modules ⇒ Object
21 22 23 |
# File 'app/models/foreman_salt/concerns/hostgroup_extensions.rb', line 21 def all_salt_modules ForemanSalt::SaltModule.in_environment(salt_environment).where(id: salt_module_ids + inherited_salt_module_ids) end |
#inherited_salt_environment_id ⇒ Object
53 54 55 |
# File 'app/models/foreman_salt/concerns/hostgroup_extensions.rb', line 53 def inherited_salt_environment_id self[:salt_environment_id] || nested(:salt_environment_id) end |
#inherited_salt_module_ids ⇒ Object
29 30 31 |
# File 'app/models/foreman_salt/concerns/hostgroup_extensions.rb', line 29 def inherited_salt_module_ids ancestors.map(&:salt_module_ids).flatten.uniq end |
#inherited_salt_modules ⇒ Object
25 26 27 |
# File 'app/models/foreman_salt/concerns/hostgroup_extensions.rb', line 25 def inherited_salt_modules ForemanSalt::SaltModule.where(id: inherited_salt_module_ids) end |
#inherited_salt_proxy_id ⇒ Object
41 42 43 |
# File 'app/models/foreman_salt/concerns/hostgroup_extensions.rb', line 41 def inherited_salt_proxy_id self[:salt_proxy_id] || nested(:salt_proxy_id) end |
#salt_environment ⇒ Object
45 46 47 48 49 50 51 |
# File 'app/models/foreman_salt/concerns/hostgroup_extensions.rb', line 45 def salt_environment if ancestry.present? ForemanSalt::SaltEnvironment.find_by(id: inherited_salt_environment_id) else super end end |
#salt_master ⇒ Object
57 58 59 |
# File 'app/models/foreman_salt/concerns/hostgroup_extensions.rb', line 57 def salt_master salt_proxy.to_s end |
#salt_proxy ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/models/foreman_salt/concerns/hostgroup_extensions.rb', line 33 def salt_proxy if ancestry.present? SmartProxy.with_features('Salt').find_by(id: inherited_salt_proxy_id) else super end end |