ansible_tower_client 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/ansible_tower_client/base_models/job_template.rb +24 -0
- data/lib/ansible_tower_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fba830a6fa6820737e3aa09ea88b86132c10a4f08368ccb26eed957b01d674d
|
4
|
+
data.tar.gz: ed5c4e64757f58632f17cdae613a1055907883e4a037798841ef6533fc73952d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dc626b6aa63686bd5a25da898c539a2fee44e6e40a92fe576e755b58fd26e29dfa013b46d20ad32968c7aea00024b536e1ef5a0071ab3f763ea2387f4ce6d24
|
7
|
+
data.tar.gz: edaa672cb12d9309b8e0da96faaa3508902d78badc4f76b79d900700c31306ed96403c8b7a4971e0c5f5138656d5c827a5f62bfe4380df6c08273ad69e857c33
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [0.18.0] - 2018-09-13
|
9
|
+
### Added
|
10
|
+
- Raise a helpful error message when options will be ignored in JobTemplate#launch [(#119)](https://github.com/ansible/ansible_tower_client_ruby/pull/119)
|
11
|
+
|
8
12
|
## [0.17.0] - 2018-07-27
|
9
13
|
### Removed
|
10
14
|
- Reverted support for API v2 and v2 Credentials [(#117)](https://github.com/ansible/ansible_tower_client_ruby/pull/117)
|
@@ -98,7 +102,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
98
102
|
### Fixed
|
99
103
|
- Adjusted project_spec to test on a Project [(#63)](https://github.com/ansible/ansible_tower_client_ruby/pull/63)
|
100
104
|
|
101
|
-
[Unreleased]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.
|
105
|
+
[Unreleased]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.18.0...master
|
106
|
+
[0.18.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.17.0...v0.18.0
|
102
107
|
[0.17.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.16.0...v0.17.0
|
103
108
|
[0.16.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.15.0...v0.16.0
|
104
109
|
[0.15.0]: https://github.com/ansible/ansible_tower_client_ruby/compare/v0.14.0...v0.15.0
|
@@ -1,9 +1,21 @@
|
|
1
1
|
module AnsibleTowerClient
|
2
2
|
class JobTemplate < BaseModel
|
3
|
+
REQUIRED_ATTRIBUTES_FOR_OPTIONS = {
|
4
|
+
:job_tags => :ask_tags_on_launch,
|
5
|
+
:job_type => :ask_job_type_on_launch,
|
6
|
+
:limit => :ask_limit_on_launch,
|
7
|
+
:inventory => :ask_inventory_on_launch,
|
8
|
+
:credential => :ask_credential_on_launch,
|
9
|
+
}.freeze
|
10
|
+
private_constant :REQUIRED_ATTRIBUTES_FOR_OPTIONS
|
11
|
+
|
3
12
|
def launch(options = {})
|
13
|
+
validate_launch_options(options)
|
14
|
+
|
4
15
|
launch_url = "#{url}launch/"
|
5
16
|
response = api.post(launch_url, options).body
|
6
17
|
job = JSON.parse(response)
|
18
|
+
|
7
19
|
api.jobs.find(job['job'])
|
8
20
|
end
|
9
21
|
|
@@ -25,5 +37,17 @@ module AnsibleTowerClient
|
|
25
37
|
def override_raw_attributes
|
26
38
|
{ :credential => :credential_id, :inventory => :inventory_id, :project => :project_id }
|
27
39
|
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def validate_launch_options(options)
|
44
|
+
ignored_options = REQUIRED_ATTRIBUTES_FOR_OPTIONS.select do |option, checkmark|
|
45
|
+
options.values_at(option.to_sym, option.to_s).any?(&:present?) && !(respond_to?(checkmark) && send(checkmark))
|
46
|
+
end.keys
|
47
|
+
|
48
|
+
return if ignored_options.empty?
|
49
|
+
|
50
|
+
raise ArgumentError, "'PROMPT ON LAUNCH' is required for the following fields: #{ignored_options.join(', ')}"
|
51
|
+
end
|
28
52
|
end
|
29
53
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ansible_tower_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dunne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-09-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|