foreman_maintain 0.4.4 → 0.4.5

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
  SHA1:
3
- metadata.gz: 8b3244cbf0c35c7e4794fcca31be180489bacdab
4
- data.tar.gz: 2c31ba26f1d8880ddd6b555415a309623f1bc19c
3
+ metadata.gz: c4ff15bf113b8dc5c9bc105d245fae484cac3e93
4
+ data.tar.gz: c62005960774cf6df93fa6f8d5acf0b16fa3750b
5
5
  SHA512:
6
- metadata.gz: 97f28a046f0dc4fcc72f40147221547abacde3eab40b8cdc175b3b027000f7028f6f65010c3673033ca2dc2866945e000cde1b72e2b007c1c6340d22f18da786
7
- data.tar.gz: b4779ec4433cb5a98985b00d5037af229ad8b7c9774c6ded70ca9461ddc1e8f7e7fc269ee40953aa6cf4cc4c1b976dfa1a072dbc1030423397337cc1ab070f80
6
+ metadata.gz: 0e9f94074cd0fd7bbcbaaf2f8664a0922a9018088b283e7aca1d104fb8771bed8c7ca8d21eb3f59743832135d4ec0e731229169b01df1eca787e4b938e0c77cc
7
+ data.tar.gz: 781471467f7530d25e051d6e5c838cb3a369df87b35a13931ffe2bea8aa146595eb5e1c26c7be9a7a919d79a0c7fdfaa4b6a64a418f7f1d644593a45697f6a0e
@@ -32,3 +32,9 @@
32
32
  # Mention true/false.
33
33
  # Value true will to enable cron service stop/restart on maintenance-mode start/stop
34
34
  # :manage_crond: false
35
+
36
+ # URL of the Foreman/Satellite server
37
+ # :foreman_url:
38
+
39
+ # Port on which Foreman server is listening
40
+ # :foreman_port: 443
@@ -5,7 +5,7 @@ module Checks::ForemanTasks
5
5
  for_feature :foreman_tasks
6
6
  description 'Check for paused tasks'
7
7
  tags :default
8
- after :services_up, :hammer_ping
8
+ after :services_up, :server_ping
9
9
  end
10
10
 
11
11
  def run
@@ -0,0 +1,16 @@
1
+ class Checks::ServerPing < ForemanMaintain::Check
2
+ metadata do
3
+ description 'Check whether all services are running using the ping call'
4
+ tags :default
5
+ after :services_up
6
+ end
7
+
8
+ def run
9
+ response = feature(:instance).ping
10
+ restart_procedure = Procedures::Service::Restart.new(
11
+ :only => response.data[:failing_services],
12
+ :wait_for_server_response => true
13
+ )
14
+ assert(response.success?, response.message, :next_steps => restart_procedure)
15
+ end
16
+ end
@@ -9,7 +9,7 @@ class Checks::ServicesUp < ForemanMaintain::Check
9
9
  failed_services = feature(:service).existing_services.reject(&:running?)
10
10
  restart_procedure = Procedures::Service::Restart.new(
11
11
  :only => failed_services,
12
- :wait_for_hammer_ping => !!feature(:katello)
12
+ :wait_for_server_response => true
13
13
  )
14
14
  assert(failed_services.empty?,
15
15
  'Following services are not running: ' + failed_services.map(&:to_s).join(', '),
@@ -37,16 +37,6 @@ class Features::Hammer < ForemanMaintain::Feature
37
37
  ready?
38
38
  end
39
39
 
40
- def hammer_ping_cmd
41
- cmd_output = exec_hammer_cmd('--output json ping', true)
42
- return init_result_obj(false, cmd_output) if cmd_output.is_a?(String)
43
- resources_failed = find_resources_which_failed(cmd_output.first)
44
- return init_result_obj if resources_failed.empty?
45
- services = map_resources_with_services(resources_failed)
46
- msg_to_show = "#{resources_failed.join(', ')} resource(s) are failing."
47
- init_result_obj(false, msg_to_show, services)
48
- end
49
-
50
40
  def ready?
51
41
  setup_admin_access if @ready.nil?
52
42
  @ready
@@ -129,45 +119,6 @@ class Features::Hammer < ForemanMaintain::Feature
129
119
  configuration[:foreman][:username] != 'admin'
130
120
  end
131
121
 
132
- def find_resources_which_failed(hammer_ping_output)
133
- resources_failed = []
134
- hammer_ping_output.each do |resource, resp_obj|
135
- resources_failed << resource if /FAIL/ =~ resp_obj['Status']
136
- end
137
- resources_failed
138
- end
139
-
140
- def related_services(resource)
141
- case resource
142
- when 'candlepin_auth'
143
- %w[postgresql tomcat]
144
- when 'candlepin'
145
- %w[postgresql tomcat]
146
- when 'pulp_auth'
147
- %w[pulp_resource_manager pulp_workers pulp_celerybeat]
148
- when 'pulp'
149
- %w[pulp_resource_manager pulp_workers pulp_celerybeat]
150
- when 'foreman_tasks'
151
- [feature(:foreman_tasks).service_name]
152
- end
153
- end
154
-
155
- def map_resources_with_services(resources)
156
- service_names = []
157
- resources.each do |resource|
158
- service_names.concat(related_services(resource))
159
- end
160
- service_names
161
- end
162
-
163
- def init_result_obj(success_val = true, message = '', data = [])
164
- {
165
- :success => success_val,
166
- :message => message,
167
- :data => data
168
- }
169
- end
170
-
171
122
  def exec_hammer_cmd(cmd, required_json = false)
172
123
  response = run(cmd)
173
124
  json_str = parse_json(response) if required_json
@@ -1,3 +1,6 @@
1
+ require 'net/http'
2
+ require 'json'
3
+
1
4
  class Features::Instance < ForemanMaintain::Feature
2
5
  metadata do
3
6
  label :instance
@@ -44,4 +47,102 @@ class Features::Instance < ForemanMaintain::Feature
44
47
  def foreman_proxy_with_content?
45
48
  feature(:foreman_proxy) && feature(:foreman_proxy).with_content? && !feature(:katello)
46
49
  end
50
+
51
+ def ping
52
+ if feature(:katello)
53
+ katello_ping
54
+ elsif external_proxy?
55
+ proxy_ping
56
+ else
57
+ foreman_ping
58
+ end
59
+ end
60
+
61
+ def server_connection
62
+ net = Net::HTTP.new(ForemanMaintain.config.foreman_url, ForemanMaintain.config.foreman_port)
63
+ net.use_ssl = true
64
+ net
65
+ end
66
+
67
+ private
68
+
69
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
70
+ def katello_ping
71
+ res = server_connection.get('/katello/api/ping')
72
+ logger.debug('Called /katello/api/ping')
73
+ logger.debug("Response: #{res.code}, #{res.body}")
74
+ response = JSON.parse(res.body)
75
+ if res.code != '200' # foreman error
76
+ result = create_response(false, response['message'] || response['displayMessage'])
77
+ else # valid response
78
+ failing_components = pick_failing_components(response['services'])
79
+ if failing_components.empty? # all okay
80
+ result = create_response(true, 'Success')
81
+ else # some components not okay
82
+ result = create_response(false,
83
+ "Some components are failing: #{failing_components.join(', ')}",
84
+ component_services(failing_components))
85
+ end
86
+ end
87
+ result
88
+ rescue StandardError => e # server error, server down
89
+ create_response(false, "Couldn't connect to the server: #{e.message}")
90
+ end
91
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
92
+
93
+ def foreman_ping
94
+ res = server_connection.get('/apidoc/apipie_checksum')
95
+ logger.debug('Called /apidoc/apipie_checksum')
96
+ logger.debug("Response: #{res.code}, #{res.body}")
97
+
98
+ if res.code != '200' # foreman error
99
+ create_response(false, response.message)
100
+ else # valid response
101
+ create_response(true, 'Success')
102
+ end
103
+ rescue StandardError => e # server error, server down
104
+ create_response(false, "Couldn't connect to the server: #{e.message}")
105
+ end
106
+
107
+ def proxy_ping
108
+ feature(:foreman_proxy).features
109
+ create_response(true, 'Success')
110
+ rescue StandardError => e # server error, proxy down
111
+ create_response(false, "Couldn't connect to the proxy: #{e.message}")
112
+ end
113
+
114
+ def pick_failing_components(components)
115
+ components.each_with_object([]) do |(name, data), failing|
116
+ failing << name unless data['status'] == 'ok'
117
+ end
118
+ end
119
+
120
+ def create_response(succeeded, message, failing_services = nil)
121
+ data = {}
122
+ data[:failing_services] = failing_services
123
+ ForemanMaintain::Utils::Response.new(succeeded, message, :data => data)
124
+ end
125
+
126
+ def installer_scenario_answers
127
+ feature(:installer).answers
128
+ end
129
+
130
+ def component_features_map
131
+ {
132
+ 'candlepin_auth' => %w[candlepin candlepin_database],
133
+ 'candlepin' => %w[candlepin candlepin_database],
134
+ 'pulp_auth' => %w[pulp mongo],
135
+ 'pulp' => %w[pulp mongo],
136
+ 'foreman_tasks' => %w[foreman_tasks]
137
+ }
138
+ end
139
+
140
+ def component_services(components)
141
+ components = Array(components)
142
+ cf_map = component_features_map
143
+ # map ping components to features
144
+ features = components.map { |component| cf_map[component] }.flatten.uniq
145
+ # map features to existing services
146
+ features.map { |name| feature(name.to_sym).services }.flatten.uniq.select(&:exist?)
147
+ end
47
148
  end
@@ -5,9 +5,8 @@ module Procedures::Service
5
5
  metadata do
6
6
  description 'Restart applicable services'
7
7
  Base.common_params(self)
8
- param :wait_for_hammer_ping,
9
- 'Wait for hammer ping to return successfully before terminating'
10
- preparation_steps { Procedures::HammerSetup.new if feature(:katello) }
8
+ param :wait_for_server_response,
9
+ 'Wait for server ping to return successfully before terminating'
11
10
  end
12
11
 
13
12
  RETRIES_FOR_SERVICES_RESTART = 5
@@ -16,21 +15,22 @@ module Procedures::Service
16
15
  def run
17
16
  run_service_action('stop', common_options)
18
17
  run_service_action('start', common_options)
19
- hammer_ping_retry if @wait_for_hammer_ping
18
+ server_ping_retry if @wait_for_server_response
20
19
  end
21
20
 
22
- def hammer_ping_retry
23
- with_spinner('Checking hammer ping') do |spinner|
21
+ def server_ping_retry
22
+ with_spinner('Checking server response') do |spinner|
24
23
  RETRIES_FOR_SERVICES_RESTART.times do |retry_count|
25
24
  spinner.update retry_message(retry_count)
26
- result = feature(:hammer).hammer_ping_cmd
27
- if result[:success]
28
- spinner.update 'Hammer ping returned successfully!'
25
+ response = feature(:instance).ping
26
+ if response.success?
27
+ spinner.update 'Server responded successfully!'
29
28
  break
30
29
  elsif retry_count < (RETRIES_FOR_SERVICES_RESTART - 1)
31
- apply_sleep_before_retry(spinner, result)
30
+ puts "\n#{response.message}"
31
+ apply_sleep_before_retry(spinner)
32
32
  else
33
- raise 'Hammer ping failed!'
33
+ raise 'Server response check failed!'
34
34
  end
35
35
  end
36
36
  end
@@ -41,8 +41,7 @@ module Procedures::Service
41
41
  'checking status of hammer ping'
42
42
  end
43
43
 
44
- def apply_sleep_before_retry(spinner, result)
45
- puts "\n#{result[:message]}"
44
+ def apply_sleep_before_retry(spinner)
46
45
  spinner.update "Waiting #{PING_RETRY_INTERVAL} seconds before retry."
47
46
  sleep PING_RETRY_INTERVAL
48
47
  end
@@ -19,8 +19,8 @@ module ForemanMaintain::Scenarios
19
19
  context.map(:exclude,
20
20
  Procedures::Service::Restart => :exclude)
21
21
 
22
- context.map(:wait_for_hammer_ping,
23
- Procedures::Service::Restart => :wait_for_hammer_ping)
22
+ context.map(:wait_for_server_response,
23
+ Procedures::Service::Restart => :wait_for_server_response)
24
24
  end
25
25
  end
26
26
 
@@ -58,6 +58,8 @@ module Scenarios::Satellite_6_6_z
58
58
  end
59
59
 
60
60
  def compose
61
+ add_step(Procedures::ForemanDocker::RemoveForemanDocker.new)
62
+ add_step(Procedures::Foreman::ApipieCache.new)
61
63
  add_step(Procedures::Service::Start.new)
62
64
  add_steps(find_procedures(:post_migrations))
63
65
  end
@@ -34,15 +34,16 @@ module ForemanMaintain
34
34
  subcommand 'restart', 'Restart applicable services' do
35
35
  service_options
36
36
  if feature(:katello)
37
- option ['-p', '--wait-for-hammer-ping'], :flag,
38
- 'Wait for hammer ping to return successfully before terminating'
37
+ option ['-p', '--wait-for-server-response', '--wait-for-hammer-ping'], :flag,
38
+ 'Wait for hammer ping to return successfully before terminating',
39
+ :attribute_name => :wait_for_server_response
39
40
  end
40
41
 
41
42
  def execute
42
43
  scenario = Scenarios::ServiceRestart.new(
43
44
  :only => only,
44
45
  :exclude => exclude,
45
- :wait_for_hammer_ping => option_wrapper('wait_for_hammer_ping?')
46
+ :wait_for_server_response => option_wrapper(:wait_for_server_response?)
46
47
  )
47
48
 
48
49
  run_scenario(scenario)
@@ -4,7 +4,8 @@ module ForemanMaintain
4
4
  attr_accessor :pre_setup_log_messages,
5
5
  :config_file, :definitions_dirs, :log_level, :log_dir, :log_file_size,
6
6
  :log_filename, :storage_file, :backup_dir, :foreman_proxy_cert_path,
7
- :db_backup_dir, :completion_cache_file, :disable_commands, :manage_crond
7
+ :db_backup_dir, :completion_cache_file, :disable_commands, :manage_crond,
8
+ :foreman_url, :foreman_port
8
9
 
9
10
  def initialize(options)
10
11
  @pre_setup_log_messages = []
@@ -20,6 +21,8 @@ module ForemanMaintain
20
21
  @options.fetch(:completion_cache_file, '~/.cache/foreman_maintain_completion.yml')
21
22
  )
22
23
  @disable_commands = @options.fetch(:disable_commands, [])
24
+ @foreman_url = @options.fetch(:foreman_url, `hostname -f`.chomp)
25
+ @foreman_port = @options.fetch(:foreman_port, 443)
23
26
  end
24
27
 
25
28
  private
@@ -1,3 +1,4 @@
1
+ require 'foreman_maintain/utils/response'
1
2
  require 'foreman_maintain/utils/command_runner'
2
3
  require 'foreman_maintain/utils/disk'
3
4
  require 'foreman_maintain/utils/bash'
@@ -0,0 +1,16 @@
1
+ module ForemanMaintain
2
+ module Utils
3
+ class Response
4
+ attr_reader :data, :message
5
+ def initialize(success, message, data: {})
6
+ @success = success
7
+ @message = message
8
+ @data = data
9
+ end
10
+
11
+ def success?
12
+ !!@success
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '0.4.4'.freeze
2
+ VERSION = '0.4.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_maintain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-01 00:00:00.000000000 Z
11
+ date: 2019-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -107,38 +107,99 @@ extra_rdoc_files:
107
107
  - LICENSE
108
108
  - README.md
109
109
  files:
110
- - LICENSE
111
- - README.md
112
110
  - bin/foreman-maintain
113
111
  - bin/foreman-maintain-complete
114
112
  - bin/foreman-maintain-rotate-tar
115
113
  - bin/passenger-recycler
116
- - config/foreman-maintain.completion
117
- - config/foreman_maintain.yml.example
118
- - config/foreman_maintain.yml.packaging
119
- - config/hammer.yml.example
120
- - config/passenger-recycler.yaml
121
- - definitions/checks/backup/certs_tar_exist.rb
122
- - definitions/checks/backup/directory_ready.rb
123
- - definitions/checks/candlepin/db_up.rb
124
- - definitions/checks/candlepin/validate_db.rb
125
- - definitions/checks/check_epel_repository.rb
126
- - definitions/checks/check_hotfix_installed.rb
127
- - definitions/checks/check_tmout.rb
114
+ - lib/foreman_maintain/check.rb
115
+ - lib/foreman_maintain/cli/advanced/procedure/abstract_by_tag_command.rb
116
+ - lib/foreman_maintain/cli/advanced/procedure/abstract_procedure_command.rb
117
+ - lib/foreman_maintain/cli/advanced/procedure/by_tag_command.rb
118
+ - lib/foreman_maintain/cli/advanced/procedure/run_command.rb
119
+ - lib/foreman_maintain/cli/advanced/procedure_command.rb
120
+ - lib/foreman_maintain/cli/advanced/prebuild_bash_completion.rb
121
+ - lib/foreman_maintain/cli/health_command.rb
122
+ - lib/foreman_maintain/cli/upgrade_command.rb
123
+ - lib/foreman_maintain/cli/advanced_command.rb
124
+ - lib/foreman_maintain/cli/restore_command.rb
125
+ - lib/foreman_maintain/cli/transform_clamp_options.rb
126
+ - lib/foreman_maintain/cli/base.rb
127
+ - lib/foreman_maintain/cli/maintenance_mode_command.rb
128
+ - lib/foreman_maintain/cli/packages_command.rb
129
+ - lib/foreman_maintain/cli/backup_command.rb
130
+ - lib/foreman_maintain/cli/service_command.rb
131
+ - lib/foreman_maintain/concerns/logger.rb
132
+ - lib/foreman_maintain/concerns/scenario_metadata.rb
133
+ - lib/foreman_maintain/concerns/hammer.rb
134
+ - lib/foreman_maintain/concerns/reporter.rb
135
+ - lib/foreman_maintain/concerns/base_database.rb
136
+ - lib/foreman_maintain/concerns/finders.rb
137
+ - lib/foreman_maintain/concerns/directory_marker.rb
138
+ - lib/foreman_maintain/concerns/system_service.rb
139
+ - lib/foreman_maintain/concerns/metadata.rb
140
+ - lib/foreman_maintain/concerns/system_helpers.rb
141
+ - lib/foreman_maintain/csv_parser.rb
142
+ - lib/foreman_maintain/dependency_graph.rb
143
+ - lib/foreman_maintain/procedure.rb
144
+ - lib/foreman_maintain/reporter/cli_reporter.rb
145
+ - lib/foreman_maintain/runner/stored_execution.rb
146
+ - lib/foreman_maintain/runner/execution.rb
147
+ - lib/foreman_maintain/top_level_modules.rb
148
+ - lib/foreman_maintain/utils/curl_response.rb
149
+ - lib/foreman_maintain/utils/disk/nil_device.rb
150
+ - lib/foreman_maintain/utils/disk/stats.rb
151
+ - lib/foreman_maintain/utils/disk/device.rb
152
+ - lib/foreman_maintain/utils/disk/io_device.rb
153
+ - lib/foreman_maintain/utils/backup.rb
154
+ - lib/foreman_maintain/utils/bash.rb
155
+ - lib/foreman_maintain/utils/disk.rb
156
+ - lib/foreman_maintain/utils/facter.rb
157
+ - lib/foreman_maintain/utils/hash_tools.rb
158
+ - lib/foreman_maintain/utils/mongo_core.rb
159
+ - lib/foreman_maintain/utils/service/abstract.rb
160
+ - lib/foreman_maintain/utils/service/remote_db.rb
161
+ - lib/foreman_maintain/utils/service/systemd.rb
162
+ - lib/foreman_maintain/utils/system_helpers.rb
163
+ - lib/foreman_maintain/utils/command_runner.rb
164
+ - lib/foreman_maintain/utils/service.rb
165
+ - lib/foreman_maintain/utils/response.rb
166
+ - lib/foreman_maintain/yaml_storage.rb
167
+ - lib/foreman_maintain/context.rb
168
+ - lib/foreman_maintain/error.rb
169
+ - lib/foreman_maintain/executable.rb
170
+ - lib/foreman_maintain/feature.rb
171
+ - lib/foreman_maintain/upgrade_runner.rb
172
+ - lib/foreman_maintain/detector.rb
173
+ - lib/foreman_maintain/core_ext.rb
174
+ - lib/foreman_maintain/reporter.rb
175
+ - lib/foreman_maintain/runner.rb
176
+ - lib/foreman_maintain/scenario.rb
177
+ - lib/foreman_maintain/cli.rb
178
+ - lib/foreman_maintain/package_manager.rb
179
+ - lib/foreman_maintain/package_manager/dnf.rb
180
+ - lib/foreman_maintain/package_manager/base.rb
181
+ - lib/foreman_maintain/package_manager/yum.rb
182
+ - lib/foreman_maintain/param.rb
183
+ - lib/foreman_maintain/version.rb
184
+ - lib/foreman_maintain/config.rb
185
+ - lib/foreman_maintain/utils.rb
186
+ - lib/foreman_maintain.rb
128
187
  - definitions/checks/disk/available_space.rb
129
188
  - definitions/checks/disk/performance.rb
130
- - definitions/checks/foreman/check_corrupted_roles.rb
131
- - definitions/checks/foreman/db_up.rb
132
- - definitions/checks/foreman/puppet_class_duplicates.rb
133
- - definitions/checks/foreman_openscap/invalid_report_associations.rb
134
189
  - definitions/checks/foreman_proxy/verify_dhcp_config_syntax.rb
135
190
  - definitions/checks/foreman_tasks/invalid/check_old.rb
136
191
  - definitions/checks/foreman_tasks/invalid/check_pending_state.rb
137
192
  - definitions/checks/foreman_tasks/invalid/check_planning_state.rb
138
- - definitions/checks/foreman_tasks/not_paused.rb
139
193
  - definitions/checks/foreman_tasks/not_running.rb
140
- - definitions/checks/hammer_ping.rb
141
- - definitions/checks/maintenance_mode/check_consistency.rb
194
+ - definitions/checks/foreman_tasks/not_paused.rb
195
+ - definitions/checks/backup/certs_tar_exist.rb
196
+ - definitions/checks/backup/directory_ready.rb
197
+ - definitions/checks/candlepin/db_up.rb
198
+ - definitions/checks/candlepin/validate_db.rb
199
+ - definitions/checks/foreman/db_up.rb
200
+ - definitions/checks/foreman/puppet_class_duplicates.rb
201
+ - definitions/checks/foreman/check_corrupted_roles.rb
202
+ - definitions/checks/foreman_openscap/invalid_report_associations.rb
142
203
  - definitions/checks/mongo/db_up.rb
143
204
  - definitions/checks/mongo/tools_installed.rb
144
205
  - definitions/checks/puppet/provide_upgrade_guide.rb
@@ -148,41 +209,67 @@ files:
148
209
  - definitions/checks/repositories/validate.rb
149
210
  - definitions/checks/restore/validate_backup.rb
150
211
  - definitions/checks/restore/validate_hostname.rb
151
- - definitions/checks/root_user.rb
152
- - definitions/checks/services_up.rb
153
212
  - definitions/checks/system_registration.rb
213
+ - definitions/checks/root_user.rb
214
+ - definitions/checks/check_epel_repository.rb
215
+ - definitions/checks/check_hotfix_installed.rb
216
+ - definitions/checks/check_tmout.rb
217
+ - definitions/checks/maintenance_mode/check_consistency.rb
154
218
  - definitions/checks/version_locking_enabled.rb
155
219
  - definitions/checks/yum_exclude.rb
156
- - definitions/features/candlepin.rb
157
- - definitions/features/candlepin_database.rb
158
- - definitions/features/cron.rb
159
- - definitions/features/downstream.rb
220
+ - definitions/checks/server_ping.rb
221
+ - definitions/checks/services_up.rb
160
222
  - definitions/features/foreman_1_11_x.rb
161
- - definitions/features/foreman_1_7_x.rb
223
+ - definitions/features/downstream.rb
224
+ - definitions/features/upstream.rb
162
225
  - definitions/features/foreman_database.rb
163
- - definitions/features/foreman_openscap.rb
164
226
  - definitions/features/foreman_proxy.rb
227
+ - definitions/features/cron.rb
228
+ - definitions/features/pulp.rb
229
+ - definitions/features/candlepin.rb
230
+ - definitions/features/foreman_openscap.rb
165
231
  - definitions/features/foreman_server.rb
166
232
  - definitions/features/foreman_tasks.rb
167
233
  - definitions/features/gofer.rb
168
- - definitions/features/hammer.rb
169
234
  - definitions/features/installer.rb
170
- - definitions/features/instance.rb
171
- - definitions/features/iptables.rb
172
235
  - definitions/features/katello.rb
236
+ - definitions/features/candlepin_database.rb
237
+ - definitions/features/foreman_1_7_x.rb
238
+ - definitions/features/iptables.rb
173
239
  - definitions/features/mongo.rb
174
- - definitions/features/package_manager.rb
175
- - definitions/features/pulp.rb
176
240
  - definitions/features/puppet_server.rb
177
241
  - definitions/features/service.rb
242
+ - definitions/features/tar.rb
243
+ - definitions/features/package_manager.rb
178
244
  - definitions/features/sync_plans.rb
245
+ - definitions/features/hammer.rb
246
+ - definitions/features/instance.rb
179
247
  - definitions/features/system_repos.rb
180
- - definitions/features/tar.rb
181
- - definitions/features/upstream.rb
248
+ - definitions/procedures/foreman_tasks/ui_investigate.rb
249
+ - definitions/procedures/foreman_tasks/fetch_tasks_status.rb
250
+ - definitions/procedures/foreman_tasks/resume.rb
251
+ - definitions/procedures/foreman_tasks/delete.rb
252
+ - definitions/procedures/installer/upgrade.rb
253
+ - definitions/procedures/packages/install.rb
254
+ - definitions/procedures/packages/enable_version_locking.rb
255
+ - definitions/procedures/packages/lock_versions.rb
256
+ - definitions/procedures/packages/locking_status.rb
257
+ - definitions/procedures/packages/unlock_versions.rb
258
+ - definitions/procedures/packages/update.rb
259
+ - definitions/procedures/repositories/setup.rb
260
+ - definitions/procedures/repositories/disable.rb
261
+ - definitions/procedures/sync_plans/disable.rb
262
+ - definitions/procedures/sync_plans/enable.rb
263
+ - definitions/procedures/crond/start.rb
264
+ - definitions/procedures/crond/stop.rb
265
+ - definitions/procedures/iptables/add_maintenance_mode_chain.rb
266
+ - definitions/procedures/iptables/remove_maintenance_mode_chain.rb
267
+ - definitions/procedures/passenger_recycler.rb
268
+ - definitions/procedures/foreman_docker/remove_foreman_docker.rb
269
+ - definitions/procedures/knowledge_base_article.rb
182
270
  - definitions/procedures/backup/accessibility_confirmation.rb
183
271
  - definitions/procedures/backup/clean.rb
184
272
  - definitions/procedures/backup/compress_data.rb
185
- - definitions/procedures/backup/config_files.rb
186
273
  - definitions/procedures/backup/metadata.rb
187
274
  - definitions/procedures/backup/offline/candlepin_db.rb
188
275
  - definitions/procedures/backup/offline/foreman_db.rb
@@ -190,75 +277,55 @@ files:
190
277
  - definitions/procedures/backup/online/candlepin_db.rb
191
278
  - definitions/procedures/backup/online/foreman_db.rb
192
279
  - definitions/procedures/backup/online/mongo.rb
193
- - definitions/procedures/backup/online/pg_global_objects.rb
194
280
  - definitions/procedures/backup/online/safety_confirmation.rb
281
+ - definitions/procedures/backup/online/pg_global_objects.rb
195
282
  - definitions/procedures/backup/prepare_directory.rb
196
- - definitions/procedures/backup/pulp.rb
197
283
  - definitions/procedures/backup/snapshot/clean_mount.rb
198
- - definitions/procedures/backup/snapshot/logical_volume_confirmation.rb
199
284
  - definitions/procedures/backup/snapshot/mount_base.rb
200
285
  - definitions/procedures/backup/snapshot/mount_candlepin_db.rb
201
286
  - definitions/procedures/backup/snapshot/mount_foreman_db.rb
287
+ - definitions/procedures/backup/snapshot/prepare_mount.rb
288
+ - definitions/procedures/backup/snapshot/logical_volume_confirmation.rb
202
289
  - definitions/procedures/backup/snapshot/mount_mongo.rb
203
290
  - definitions/procedures/backup/snapshot/mount_pulp.rb
204
- - definitions/procedures/backup/snapshot/prepare_mount.rb
291
+ - definitions/procedures/backup/config_files.rb
292
+ - definitions/procedures/backup/pulp.rb
205
293
  - definitions/procedures/candlepin/delete_orphaned_records_from_env_content.rb
206
- - definitions/procedures/crond/start.rb
207
- - definitions/procedures/crond/stop.rb
208
- - definitions/procedures/foreman/apipie_cache.rb
209
- - definitions/procedures/foreman/fix_corrupted_roles.rb
210
- - definitions/procedures/foreman_docker/remove_foreman_docker.rb
211
294
  - definitions/procedures/foreman_openscap/invalid_report_associations.rb
212
- - definitions/procedures/foreman_proxy/features.rb
213
- - definitions/procedures/foreman_tasks/delete.rb
214
- - definitions/procedures/foreman_tasks/fetch_tasks_status.rb
215
- - definitions/procedures/foreman_tasks/resume.rb
216
- - definitions/procedures/foreman_tasks/ui_investigate.rb
217
295
  - definitions/procedures/hammer_setup.rb
218
- - definitions/procedures/installer/upgrade.rb
219
- - definitions/procedures/iptables/add_maintenance_mode_chain.rb
220
- - definitions/procedures/iptables/remove_maintenance_mode_chain.rb
221
- - definitions/procedures/knowledge_base_article.rb
222
- - definitions/procedures/maintenance_mode/is_enabled.rb
223
- - definitions/procedures/packages/enable_version_locking.rb
224
- - definitions/procedures/packages/install.rb
225
- - definitions/procedures/packages/lock_versions.rb
226
- - definitions/procedures/packages/locking_status.rb
227
- - definitions/procedures/packages/unlock_versions.rb
228
- - definitions/procedures/packages/update.rb
229
- - definitions/procedures/passenger_recycler.rb
230
296
  - definitions/procedures/pulp/migrate.rb
231
- - definitions/procedures/puppet/delete_empty_ca_cert_request_files.rb
232
297
  - definitions/procedures/remote_execution/remove_existing_settingsd.rb
233
- - definitions/procedures/repositories/disable.rb
234
- - definitions/procedures/repositories/setup.rb
235
298
  - definitions/procedures/restore/candlepin_dump.rb
236
- - definitions/procedures/restore/configs.rb
237
299
  - definitions/procedures/restore/confirmation.rb
238
300
  - definitions/procedures/restore/drop_databases.rb
239
- - definitions/procedures/restore/ensure_mongo_engine_matches.rb
240
301
  - definitions/procedures/restore/extract_files.rb
241
302
  - definitions/procedures/restore/foreman_dump.rb
242
- - definitions/procedures/restore/installer_reset.rb
243
303
  - definitions/procedures/restore/mongo_dump.rb
244
304
  - definitions/procedures/restore/pg_global_objects.rb
245
305
  - definitions/procedures/restore/postgres_owner.rb
306
+ - definitions/procedures/restore/configs.rb
307
+ - definitions/procedures/restore/ensure_mongo_engine_matches.rb
308
+ - definitions/procedures/restore/installer_reset.rb
246
309
  - definitions/procedures/selinux/set_file_security.rb
247
- - definitions/procedures/service/base.rb
248
310
  - definitions/procedures/service/daemon_reload.rb
249
311
  - definitions/procedures/service/disable.rb
250
312
  - definitions/procedures/service/enable.rb
251
313
  - definitions/procedures/service/list.rb
252
- - definitions/procedures/service/restart.rb
253
314
  - definitions/procedures/service/start.rb
254
- - definitions/procedures/service/status.rb
255
315
  - definitions/procedures/service/stop.rb
256
- - definitions/procedures/sync_plans/disable.rb
257
- - definitions/procedures/sync_plans/enable.rb
258
- - definitions/scenarios/backup.rb
259
- - definitions/scenarios/maintenance_mode.rb
316
+ - definitions/procedures/service/status.rb
317
+ - definitions/procedures/service/base.rb
318
+ - definitions/procedures/service/restart.rb
319
+ - definitions/procedures/foreman/fix_corrupted_roles.rb
320
+ - definitions/procedures/foreman/apipie_cache.rb
321
+ - definitions/procedures/maintenance_mode/is_enabled.rb
322
+ - definitions/procedures/puppet/delete_empty_ca_cert_request_files.rb
323
+ - definitions/procedures/foreman_proxy/features.rb
260
324
  - definitions/scenarios/restore.rb
261
325
  - definitions/scenarios/services.rb
326
+ - definitions/scenarios/upgrade_to_satellite_6_6_z.rb
327
+ - definitions/scenarios/maintenance_mode.rb
328
+ - definitions/scenarios/version_locking.rb
262
329
  - definitions/scenarios/upgrade_to_satellite_6_2.rb
263
330
  - definitions/scenarios/upgrade_to_satellite_6_2_z.rb
264
331
  - definitions/scenarios/upgrade_to_satellite_6_3.rb
@@ -267,81 +334,15 @@ files:
267
334
  - definitions/scenarios/upgrade_to_satellite_6_4_z.rb
268
335
  - definitions/scenarios/upgrade_to_satellite_6_5.rb
269
336
  - definitions/scenarios/upgrade_to_satellite_6_5_z.rb
337
+ - definitions/scenarios/backup.rb
270
338
  - definitions/scenarios/upgrade_to_satellite_6_6.rb
271
- - definitions/scenarios/upgrade_to_satellite_6_6_z.rb
272
- - definitions/scenarios/version_locking.rb
273
- - lib/foreman_maintain.rb
274
- - lib/foreman_maintain/check.rb
275
- - lib/foreman_maintain/cli.rb
276
- - lib/foreman_maintain/cli/advanced/prebuild_bash_completion.rb
277
- - lib/foreman_maintain/cli/advanced/procedure/abstract_by_tag_command.rb
278
- - lib/foreman_maintain/cli/advanced/procedure/abstract_procedure_command.rb
279
- - lib/foreman_maintain/cli/advanced/procedure/by_tag_command.rb
280
- - lib/foreman_maintain/cli/advanced/procedure/run_command.rb
281
- - lib/foreman_maintain/cli/advanced/procedure_command.rb
282
- - lib/foreman_maintain/cli/advanced_command.rb
283
- - lib/foreman_maintain/cli/backup_command.rb
284
- - lib/foreman_maintain/cli/base.rb
285
- - lib/foreman_maintain/cli/health_command.rb
286
- - lib/foreman_maintain/cli/maintenance_mode_command.rb
287
- - lib/foreman_maintain/cli/packages_command.rb
288
- - lib/foreman_maintain/cli/restore_command.rb
289
- - lib/foreman_maintain/cli/service_command.rb
290
- - lib/foreman_maintain/cli/transform_clamp_options.rb
291
- - lib/foreman_maintain/cli/upgrade_command.rb
292
- - lib/foreman_maintain/concerns/base_database.rb
293
- - lib/foreman_maintain/concerns/directory_marker.rb
294
- - lib/foreman_maintain/concerns/finders.rb
295
- - lib/foreman_maintain/concerns/hammer.rb
296
- - lib/foreman_maintain/concerns/logger.rb
297
- - lib/foreman_maintain/concerns/metadata.rb
298
- - lib/foreman_maintain/concerns/reporter.rb
299
- - lib/foreman_maintain/concerns/scenario_metadata.rb
300
- - lib/foreman_maintain/concerns/system_helpers.rb
301
- - lib/foreman_maintain/concerns/system_service.rb
302
- - lib/foreman_maintain/config.rb
303
- - lib/foreman_maintain/context.rb
304
- - lib/foreman_maintain/core_ext.rb
305
- - lib/foreman_maintain/csv_parser.rb
306
- - lib/foreman_maintain/dependency_graph.rb
307
- - lib/foreman_maintain/detector.rb
308
- - lib/foreman_maintain/error.rb
309
- - lib/foreman_maintain/executable.rb
310
- - lib/foreman_maintain/feature.rb
311
- - lib/foreman_maintain/package_manager.rb
312
- - lib/foreman_maintain/package_manager/base.rb
313
- - lib/foreman_maintain/package_manager/dnf.rb
314
- - lib/foreman_maintain/package_manager/yum.rb
315
- - lib/foreman_maintain/param.rb
316
- - lib/foreman_maintain/procedure.rb
317
- - lib/foreman_maintain/reporter.rb
318
- - lib/foreman_maintain/reporter/cli_reporter.rb
319
- - lib/foreman_maintain/runner.rb
320
- - lib/foreman_maintain/runner/execution.rb
321
- - lib/foreman_maintain/runner/stored_execution.rb
322
- - lib/foreman_maintain/scenario.rb
323
- - lib/foreman_maintain/top_level_modules.rb
324
- - lib/foreman_maintain/upgrade_runner.rb
325
- - lib/foreman_maintain/utils.rb
326
- - lib/foreman_maintain/utils/backup.rb
327
- - lib/foreman_maintain/utils/bash.rb
328
- - lib/foreman_maintain/utils/command_runner.rb
329
- - lib/foreman_maintain/utils/curl_response.rb
330
- - lib/foreman_maintain/utils/disk.rb
331
- - lib/foreman_maintain/utils/disk/device.rb
332
- - lib/foreman_maintain/utils/disk/io_device.rb
333
- - lib/foreman_maintain/utils/disk/nil_device.rb
334
- - lib/foreman_maintain/utils/disk/stats.rb
335
- - lib/foreman_maintain/utils/facter.rb
336
- - lib/foreman_maintain/utils/hash_tools.rb
337
- - lib/foreman_maintain/utils/mongo_core.rb
338
- - lib/foreman_maintain/utils/service.rb
339
- - lib/foreman_maintain/utils/service/abstract.rb
340
- - lib/foreman_maintain/utils/service/remote_db.rb
341
- - lib/foreman_maintain/utils/service/systemd.rb
342
- - lib/foreman_maintain/utils/system_helpers.rb
343
- - lib/foreman_maintain/version.rb
344
- - lib/foreman_maintain/yaml_storage.rb
339
+ - config/foreman-maintain.completion
340
+ - config/foreman_maintain.yml.example
341
+ - config/foreman_maintain.yml.packaging
342
+ - config/hammer.yml.example
343
+ - config/passenger-recycler.yaml
344
+ - LICENSE
345
+ - README.md
345
346
  homepage: https://github.com/theforeman/foreman_maintain
346
347
  licenses:
347
348
  - GPL-3.0
@@ -362,7 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
362
363
  version: '0'
363
364
  requirements: []
364
365
  rubyforge_project:
365
- rubygems_version: 2.6.13
366
+ rubygems_version: 2.0.14.1
366
367
  signing_key:
367
368
  specification_version: 4
368
369
  summary: Foreman maintenance tool belt
@@ -1,23 +0,0 @@
1
- class Checks::HammerPing < ForemanMaintain::Check
2
- include ForemanMaintain::Concerns::Hammer
3
- metadata do
4
- label :hammer_ping
5
- for_feature :hammer
6
- description 'Check whether all services are running using hammer ping'
7
- tags :default
8
- after :services_up
9
-
10
- confine do
11
- feature(:katello)
12
- end
13
- end
14
-
15
- def run
16
- result = feature(:hammer).hammer_ping_cmd
17
- restart_procedure = Procedures::Service::Restart.new(:only => result[:data],
18
- :wait_for_hammer_ping => true)
19
- assert(result[:success],
20
- result[:message],
21
- :next_steps => restart_procedure)
22
- end
23
- end