foreman_ansible 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/ansible_inventories_controller.rb +9 -4
- data/app/services/foreman_ansible/ansible_info.rb +1 -1
- data/app/views/ansible_variables/_fields.erb +1 -1
- data/app/views/foreman_ansible/job_templates/ansible_roles_-_ansible_default.erb +7 -4
- data/app/views/foreman_ansible/job_templates/connect_red_hat_receptor_controller_-_ansible_default.erb +26 -0
- data/config/routes.rb +1 -1
- data/lib/foreman_ansible/version.rb +1 -1
- data/test/unit/services/inventory_creator_test.rb +0 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a373c417d10ac003b1ef65a607ecbef52965a0342c71b93b5cb5280556375ca4
|
4
|
+
data.tar.gz: ccf7c205d0c30ec2fe8125d527045a94617f44d625cb5be41d64cb836c8cb5f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09fdb9dd6193c49a4934242867611b3ae2b72abca9c5cd24053d19d64ee8ff6785f44b672171e239660366e595211008461f5da7e9cf0859a20d7ab7a85eff3c'
|
7
|
+
data.tar.gz: 57fc874d5005e7949f2d264a506f0217a962b3b374eba0ecb6228fe8e041db277b114fda4f262b2bbfd43637eb66ef89d711de11b4fb6886bdb9a60e70dd12ac
|
@@ -3,6 +3,11 @@ module Api
|
|
3
3
|
class AnsibleInventoriesController < ::Api::V2::BaseController
|
4
4
|
include ::Api::Version2
|
5
5
|
|
6
|
+
resource_description do
|
7
|
+
api_version 'v2'
|
8
|
+
api_base_url '/ansible/api'
|
9
|
+
end
|
10
|
+
|
6
11
|
api :POST, '/ansible_inventories/hosts',
|
7
12
|
N_('Show Ansible inventory for hosts')
|
8
13
|
param :host_ids, Array, N_('IDs of hosts included in inventory'),
|
@@ -13,6 +18,10 @@ module Api
|
|
13
18
|
param :host_ids, Array, N_('IDs of hosts included in inventory'),
|
14
19
|
:required => true
|
15
20
|
|
21
|
+
def hosts
|
22
|
+
show_inventory :host_ids, :id
|
23
|
+
end
|
24
|
+
|
16
25
|
api :POST, '/ansible_inventories/hostgroups',
|
17
26
|
N_('Show Ansible inventory for hostgroups')
|
18
27
|
param :hostgroup_ids, Array, N_('IDs of hostgroups included in inventory'),
|
@@ -23,10 +32,6 @@ module Api
|
|
23
32
|
param :hostgroup_ids, Array, N_('IDs of hostgroups included in inventory'),
|
24
33
|
:required => true
|
25
34
|
|
26
|
-
def hosts
|
27
|
-
show_inventory :host_ids, :id
|
28
|
-
end
|
29
|
-
|
30
35
|
def hostgroups
|
31
36
|
show_inventory :hostgroup_ids, :hostgroup_id
|
32
37
|
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
) %>
|
16
16
|
|
17
17
|
<% version = Foreman::Version.new %>
|
18
|
-
<% if version.major.to_i
|
18
|
+
<% if version.major.to_i > 1 || version.minor.to_i >= 22 %>
|
19
19
|
<%= param_type_selector(f, false, :onchange => 'keyTypeChange(this)', :disabled => !f.object.override) %>
|
20
20
|
<% else %>
|
21
21
|
<%= param_type_selector(f, :onchange => 'keyTypeChange(this)', :disabled => !f.object.override) %>
|
@@ -15,7 +15,10 @@ model: JobTemplate
|
|
15
15
|
- name: Display all parameters known for the Foreman host
|
16
16
|
debug:
|
17
17
|
var: foreman
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
tasks:
|
19
|
+
- name: Apply roles
|
20
|
+
include_role:
|
21
|
+
name: "{{ role }}"
|
22
|
+
loop: "{{ foreman_ansible_roles }}"
|
23
|
+
loop_control:
|
24
|
+
loop_var: role
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%#
|
2
|
+
name: Connect Red Hat receptor controller
|
3
|
+
snippet: false
|
4
|
+
template_inputs:
|
5
|
+
- name: satellite_user
|
6
|
+
required: true
|
7
|
+
input_type: user
|
8
|
+
advanced: false
|
9
|
+
value_type: plain
|
10
|
+
- name: satellite_password
|
11
|
+
required: true
|
12
|
+
input_type: user
|
13
|
+
advanced: false
|
14
|
+
value_type: plain
|
15
|
+
model: JobTemplate
|
16
|
+
job_category: Ansible Playbook
|
17
|
+
provider_type: Ansible
|
18
|
+
kind: job_template
|
19
|
+
%>
|
20
|
+
|
21
|
+
---
|
22
|
+
- hosts: all
|
23
|
+
vars:
|
24
|
+
satellite_url: "<%= foreman_server_url %>"
|
25
|
+
roles:
|
26
|
+
- satellite-receptor
|
data/config/routes.rb
CHANGED
@@ -72,7 +72,7 @@ Rails.application.routes.draw do
|
|
72
72
|
:module => :v2,
|
73
73
|
:defaults => { :apiv => 'v2' },
|
74
74
|
:apiv => /v1|v2/,
|
75
|
-
:constraints => ApiConstraints.new(:version => 2) do
|
75
|
+
:constraints => ApiConstraints.new(:version => 2, :default => true) do
|
76
76
|
resources :ansible_roles, :only => [:show, :index, :destroy] do
|
77
77
|
collection do
|
78
78
|
put :import
|
@@ -32,8 +32,6 @@ module ForemanAnsible
|
|
32
32
|
test 'settings are respected if param cannot be found' do
|
33
33
|
AnsibleProvider.stubs(:find_ip_or_hostname).with(@host).returns(@host.name)
|
34
34
|
extra_options = { 'ansible_user' => 'someone', 'ansible_port' => 2000 }
|
35
|
-
Setting.expects(:[]).with('Enable_Smart_Variables_in_ENC').
|
36
|
-
returns(nil).at_least_once
|
37
35
|
Setting.expects(:[]).with('ansible_ssh_private_key_file').
|
38
36
|
returns(nil).at_least_once
|
39
37
|
Setting.expects(:[]).with('remote_execution_ssh_port').
|
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: 5.0.
|
4
|
+
version: 5.0.1
|
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: 2020-
|
11
|
+
date: 2020-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- app/views/foreman_ansible/job_templates/ansible_roles_-_ansible_default.erb
|
187
187
|
- app/views/foreman_ansible/job_templates/ansible_roles_-_install_from_galaxy.erb
|
188
188
|
- app/views/foreman_ansible/job_templates/ansible_roles_-_install_from_git.erb
|
189
|
+
- app/views/foreman_ansible/job_templates/connect_red_hat_receptor_controller_-_ansible_default.erb
|
189
190
|
- app/views/foreman_ansible/job_templates/maintenance_plan.erb
|
190
191
|
- app/views/foreman_ansible/job_templates/module_action_-_ansible_default.erb
|
191
192
|
- app/views/foreman_ansible/job_templates/package_action_-_ansible_default.erb
|