hammer_cli_foreman_ansible 0.3.0 → 0.3.4

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: ea1e6d4d10fce881ba9d9b9e1afe20c2b86700ec3985f16c127031c90fb7b9b9
4
- data.tar.gz: 3a8cec45314b93712e0e6ef8d2a2996d86bff7582a4af42f6bb74b0cb7c431cc
3
+ metadata.gz: 22b04f4732021b83a5f201c450ae645183a249b1fac74f9573eebc5b893e4761
4
+ data.tar.gz: 1e9a7ce94688a284ebd784178cc479ce19e83e1a5ba5c2e28d259ca1a5508565
5
5
  SHA512:
6
- metadata.gz: 5ed1d68cad5e740dc654700ff22b10c8a7dc94cd331c37a85ad0fc4997ae2e2c58791808264693ebe5c27252f161b7f248513bc47cf01977c198f08ceb9cf6da
7
- data.tar.gz: d8932b3db21c3b407aafa8a2607d42c8f08f390c1a827f5747d5799b80c2750dadba0870d972ce0f7047c8ee7c156dd0fc8c171aef8aea24769233bb1242760d
6
+ metadata.gz: 8444e5efcd1d36fef6925ae3fb2a6320c74da8d8a9e05e18efc257214ec2d7607bb8267f8d4451177f875fb69dc38da57c6ef844dfb84d57c3a506d98a410039
7
+ data.tar.gz: c3622e78574949e8ea728f18cbe6fc8368a2f6d4052c3015da1151d4ce0a7ad83d4c9fb872cca12d257dea6d3763377f49426c9c0018b19571b47fef111890ec
@@ -11,6 +11,8 @@ module HammerCLIForemanAnsible
11
11
  require 'hammer_cli_foreman_ansible/host'
12
12
  require 'hammer_cli_foreman_ansible/hostgroup'
13
13
 
14
+ require 'hammer_cli_foreman_ansible/command_extensions'
15
+
14
16
  HammerCLI::MainCommand.lazy_subcommand(
15
17
  'ansible',
16
18
  'Manage foreman ansible',
@@ -14,7 +14,7 @@ module HammerCLIForemanAnsible
14
14
  end
15
15
 
16
16
  class InfoCommand < HammerCLIForeman::InfoCommand
17
- output AnsibleRolesCommand::InfoCommand.output_definition
17
+ output AnsibleRolesCommand::ListCommand.output_definition
18
18
  build_options
19
19
  end
20
20
 
@@ -25,6 +25,15 @@ module HammerCLIForemanAnsible
25
25
  build_options
26
26
  end
27
27
 
28
+ class SyncCommand < HammerCLIForeman::Command
29
+ action :sync
30
+ command_name 'sync'
31
+
32
+ success_message _('A task to Sync Ansible Roles was created.')
33
+ failure_message _('Could not sync roles')
34
+ build_options
35
+ end
36
+
28
37
  class ImportCommand < HammerCLIForeman::Command
29
38
  action :import
30
39
  command_name 'import'
@@ -87,7 +96,13 @@ module HammerCLIForemanAnsible
87
96
 
88
97
  output do
89
98
  collection :ansible_roles, _('Ansible roles available to be imported') do
90
- field :name, nil
99
+ field :name, _("Role Name")
100
+ field :role_action, _("Action")
101
+ field :variables, _("Variables")
102
+ field :hosts_count, ("Hosts count")
103
+ field :hostgroup_count, ("Hostgroup count")
104
+
105
+
91
106
  end
92
107
  end
93
108
 
@@ -5,6 +5,7 @@ module HammerCLIForemanAnsible
5
5
  resource :ansible_variables
6
6
 
7
7
  class ListCommand < HammerCLIForeman::ListCommand
8
+
8
9
  output do
9
10
  field :id, _('Id')
10
11
 
@@ -15,7 +16,6 @@ module HammerCLIForemanAnsible
15
16
  field :ansible_role, _('Role')
16
17
  field :ansible_role_id, _('Role Id'), Fields::Id
17
18
  end
18
-
19
19
  build_options
20
20
  end
21
21
 
@@ -29,6 +29,7 @@ module HammerCLIForemanAnsible
29
29
  field :validator_rule, _("Rule")
30
30
  end
31
31
  label _("Override values") do
32
+ field :override, _("Override"), Fields::Boolean
32
33
  field :merge_overrides, _("Merge overrides"), Fields::Boolean
33
34
  field :merge_default, _("Merge default value"), Fields::Boolean
34
35
  field :avoid_duplicates, _("Avoid duplicates"), Fields::Boolean
@@ -63,6 +64,16 @@ module HammerCLIForemanAnsible
63
64
  success_message _("Ansible variable [%{variable}] updated.")
64
65
  failure_message _("Could not update the ansible variable")
65
66
 
67
+ option "--override-value-order", "OVERRIDE_VALUE_ORDER", _("The order in which values are resolved"),
68
+ :format => HammerCLI::Options::Normalizers::List.new
69
+
70
+ def request_params
71
+ params = super
72
+ override_order = params['ansible_variable']['override_value_order']
73
+ params['ansible_variable']['override_value_order'] = override_order.join("\n") if override_order.is_a?(Array)
74
+ params
75
+ end
76
+
66
77
  build_options
67
78
  end
68
79
 
@@ -0,0 +1 @@
1
+ require 'hammer_cli_foreman_ansible/command_extensions/resolver'
@@ -0,0 +1,15 @@
1
+ module HammerCLIForemanAnsible
2
+ module ResolverExtension
3
+ def create_ansible_roles_search_options(options, mode = nil)
4
+ if self.class.to_s == 'HammerCLIKatello::IdResolver'
5
+ create_search_options_without_katello_api(options, api.resource(:ansible_roles), mode)
6
+ else
7
+ create_search_options(options, api.resource(:ansible_roles), mode)
8
+ end
9
+ end
10
+ end
11
+
12
+ ::HammerCLIForeman::IdResolver.instance_eval do
13
+ include ResolverExtension
14
+ end
15
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module HammerCLIForemanAnsible
4
4
  def self.version
5
- @version ||= Gem::Version.new '0.3.0'
5
+ @version ||= Gem::Version.new '0.3.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleh Fedorenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-29 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hammer_cli_foreman
@@ -24,48 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.12.0
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.16'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.16'
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '5.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '5.0'
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: rake
57
29
  requirement: !ruby/object:Gem::Requirement
58
30
  requirements:
59
- - - "~>"
31
+ - - ">="
60
32
  - !ruby/object:Gem::Version
61
- version: '10.0'
33
+ version: 12.3.3
62
34
  type: :development
63
35
  prerelease: false
64
36
  version_requirements: !ruby/object:Gem::Requirement
65
37
  requirements:
66
- - - "~>"
38
+ - - ">="
67
39
  - !ruby/object:Gem::Version
68
- version: '10.0'
40
+ version: 12.3.3
69
41
  description:
70
42
  email:
71
43
  - ofedoren@redhat.com
@@ -80,6 +52,8 @@ files:
80
52
  - lib/hammer_cli_foreman_ansible/ansible.rb
81
53
  - lib/hammer_cli_foreman_ansible/ansible_roles.rb
82
54
  - lib/hammer_cli_foreman_ansible/ansible_variables.rb
55
+ - lib/hammer_cli_foreman_ansible/command_extensions.rb
56
+ - lib/hammer_cli_foreman_ansible/command_extensions/resolver.rb
83
57
  - lib/hammer_cli_foreman_ansible/host.rb
84
58
  - lib/hammer_cli_foreman_ansible/hostgroup.rb
85
59
  - lib/hammer_cli_foreman_ansible/i18n.rb
@@ -104,8 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
78
  - !ruby/object:Gem::Version
105
79
  version: '0'
106
80
  requirements: []
107
- rubyforge_project:
108
- rubygems_version: 2.7.9
81
+ rubygems_version: 3.1.2
109
82
  signing_key:
110
83
  specification_version: 4
111
84
  summary: Foreman Ansible plugin for Hammer CLI