foreman_ansible 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/foreman_ansible/ansible_roles_helper.rb +1 -9
- data/app/models/concerns/foreman_ansible/hostgroup_extensions.rb +6 -0
- data/app/views/foreman_ansible/ansible_roles/_select_tab_content.html.erb +1 -1
- data/app/views/foreman_ansible/job_templates/power_action_-_ansible_default.erb +1 -1
- data/lib/foreman_ansible/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4f05964b165891e1b44e5158dcf7b2d5e77881e
|
|
4
|
+
data.tar.gz: c1629f35495a5617fa6a74a10fffadbde03564ea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e2aae785f1b33486213458fce2c68d3c3a278e09545bf7ec77fb4e2e0b4345296b69f2623dd0c47cd2468e33be4ba0de1498fb7484e58f425836741ae849e5f
|
|
7
|
+
data.tar.gz: cc39abf1727a1eab156b1ce837cd3fe16642979c35cbbfe02d61e07edc9dc28d0cd57fa2822f2c8402804e04074a76afec60c45d32e481233d835325a3ae60b6
|
|
@@ -2,19 +2,11 @@ module ForemanAnsible
|
|
|
2
2
|
# Small convenience to list all roles in the UI
|
|
3
3
|
module AnsibleRolesHelper
|
|
4
4
|
def ansible_proxy_links(hash, classes = nil)
|
|
5
|
-
|
|
5
|
+
SmartProxy.with_features('Ansible').map do |proxy|
|
|
6
6
|
display_link_if_authorized(_('From %s') % proxy.name,
|
|
7
7
|
hash.merge(:proxy => proxy),
|
|
8
8
|
:class => classes)
|
|
9
9
|
end.flatten
|
|
10
|
-
host_text = if links.any?
|
|
11
|
-
_('From Foreman host')
|
|
12
|
-
else
|
|
13
|
-
_('Import from Foreman host')
|
|
14
|
-
end
|
|
15
|
-
links.unshift display_link_if_authorized(host_text,
|
|
16
|
-
hash,
|
|
17
|
-
:class => classes)
|
|
18
10
|
end
|
|
19
11
|
|
|
20
12
|
def ansible_proxy_import(hash)
|
|
@@ -16,6 +16,12 @@ module ForemanAnsible
|
|
|
16
16
|
end.uniq
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
def inherited_and_own_ansible_roles
|
|
20
|
+
path.reduce([]) do |roles, hostgroup|
|
|
21
|
+
roles + hostgroup.ansible_roles
|
|
22
|
+
end.uniq
|
|
23
|
+
end
|
|
24
|
+
|
|
19
25
|
def host_ansible_roles
|
|
20
26
|
hosts.all.includes(:ansible_roles).flat_map(&:ansible_roles)
|
|
21
27
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
f,
|
|
4
4
|
:ansible_roles,
|
|
5
5
|
AnsibleRole,
|
|
6
|
-
f.object.all_ansible_roles.map(&:id),
|
|
6
|
+
f.object.is_a?(Hostgroup) ? (f.object.inherited_and_own_ansible_roles).map(&:id) : f.object.all_ansible_roles.map(&:id),
|
|
7
7
|
{
|
|
8
8
|
:disabled => f.object.inherited_ansible_roles.map(&:id),
|
|
9
9
|
:label => _('Available roles'),
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_ansible
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Lobato Garcia
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-07-
|
|
11
|
+
date: 2018-07-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubocop
|