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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93abbabed7119b4567e837415bee3a5e25a043b9267499cdfa6b45e27d1352d4
4
- data.tar.gz: 5f7a23457ea9bd84adcb6ff1769e7c8d679e4dd907cd0fe43798fad55002b560
3
+ metadata.gz: a373c417d10ac003b1ef65a607ecbef52965a0342c71b93b5cb5280556375ca4
4
+ data.tar.gz: ccf7c205d0c30ec2fe8125d527045a94617f44d625cb5be41d64cb836c8cb5f3
5
5
  SHA512:
6
- metadata.gz: 3cd8e665ed9e8d157664596130d6ece62f05921fa7073ce3e901716378ebddcf5855b082a79a3d0c8df65382fdb68d905938ad1d4f9541b5af5d88918770d78f
7
- data.tar.gz: 2b558e206a05a33726c73d1b367eece0a74e7f0eaaa6fe8f7a2a339097471b6d3a5500abdbacdbc18bc51d9f305972c71d3255a2fd28733d9875781df6046834
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
@@ -10,7 +10,7 @@ module ForemanAnsible
10
10
 
11
11
  variables.each_with_object({}) do |var, memo|
12
12
  value = values[var]
13
- memo[var.key] = value if value
13
+ memo[var.key] = value unless value.nil?
14
14
  memo
15
15
  end
16
16
  end
@@ -15,7 +15,7 @@
15
15
  ) %>
16
16
 
17
17
  <% version = Foreman::Version.new %>
18
- <% if version.major.to_i >= 1 && version.minor.to_i >= 22 %>
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
- roles:
19
- <%- if @host.all_ansible_roles.present? -%>
20
- <%= @host.all_ansible_roles.map { |role| " - #{role.name.strip}" }.join("\n") %>
21
- <%- end -%>
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
@@ -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
@@ -4,5 +4,5 @@
4
4
  # This way other parts of Foreman can just call ForemanAnsible::VERSION
5
5
  # and detect what version the plugin is running.
6
6
  module ForemanAnsible
7
- VERSION = '5.0.0'
7
+ VERSION = '5.0.1'
8
8
  end
@@ -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.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-01-15 00:00:00.000000000 Z
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