foreman_maintain 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/definitions/checks/yum_exclude.rb +21 -0
- data/definitions/features/foreman_database.rb +6 -0
- data/definitions/features/package_manager.rb +1 -1
- data/definitions/procedures/foreman/apipie_cache.rb +12 -0
- data/definitions/procedures/foreman_docker/remove_foreman_docker.rb +18 -0
- data/definitions/scenarios/upgrade_to_satellite_6_6.rb +2 -0
- data/lib/foreman_maintain/concerns/system_helpers.rb +2 -0
- data/lib/foreman_maintain/package_manager/base.rb +5 -0
- data/lib/foreman_maintain/package_manager/yum.rb +4 -0
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82c1f6b6412effc3fdbc0c76d5940141c6bcedbe8a24f2201297c586464ee26b
|
4
|
+
data.tar.gz: 88e0dc3579e6a1dee0e371f13aa594e76bcfc871f1914430888b86db21e86b37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9ea4129e24dd5864586da1e5dcec6354a60090e03e95ff9a9f73a98b10a6ba7c60285f50a97ca2b7ee8faaac322a02c8c2064db635b3dc464c9cd4e7e5d1e2c
|
7
|
+
data.tar.gz: 67945a1cf054e940949777713d97cd82902516a6fd898a8ae50e4f931589642f2498c2c42da2b2e4f6be60fbfc0613f6b34176d19aa945b7ba4af253e6f10aaf
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Foreman Maintenance [![Build Status](https://travis-ci.org/theforeman/foreman_maintain.svg?branch=master)](https://travis-ci.org/theforeman/foreman_maintain) <a href="https://codeclimate.com/github/theforeman/foreman_maintain"><img src="https://codeclimate.com/github/theforeman/foreman_maintain/badges/gpa.svg" /></a>
|
2
2
|
|
3
|
-
`foreman_maintain` aims to provide various features that helps
|
3
|
+
`foreman_maintain` aims to provide various features that helps keep the
|
4
4
|
Foreman/Satellite up and running. It supports multiple versions and subparts
|
5
5
|
of the Foreman infrastructure, including server or smart proxy and is smart
|
6
6
|
enough to provide the right tools for the specific version.
|
@@ -425,7 +425,7 @@ may have changed which has impact on foreman-maintain CLI options and subcommand
|
|
425
425
|
|
426
426
|
#### Available value types
|
427
427
|
|
428
|
-
Completion of values is dependent on CLI option and
|
428
|
+
Completion of values is dependent on CLI option and parameter settings, e.g.:
|
429
429
|
|
430
430
|
```ruby
|
431
431
|
parameter 'BACKUP_DIR', 'Path to backup dir', :completion => { :type => :directory }
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Checks::YumExclude < ForemanMaintain::Check
|
2
|
+
metadata do
|
3
|
+
label :check_yum_exclude_list
|
4
|
+
description 'Check if yum exclude list is configured'
|
5
|
+
tags :pre_upgrade
|
6
|
+
end
|
7
|
+
|
8
|
+
EXCLUDE_SET_RE = /^exclude\s*=\s*\S+.*$/
|
9
|
+
|
10
|
+
def run
|
11
|
+
grep_result = grep_yum_exclude
|
12
|
+
assert(!grep_result.match(EXCLUDE_SET_RE),
|
13
|
+
'The /etc/yum.conf has exclude list configured as below,'\
|
14
|
+
"\n #{grep_result}"\
|
15
|
+
"\nUnset this as it can cause yum update or upgrade failures !")
|
16
|
+
end
|
17
|
+
|
18
|
+
def grep_yum_exclude
|
19
|
+
execute_with_status('grep -w exclude /etc/yum.conf')[1]
|
20
|
+
end
|
21
|
+
end
|
@@ -15,6 +15,12 @@ class Features::ForemanDatabase < ForemanMaintain::Feature
|
|
15
15
|
@configuration || load_configuration
|
16
16
|
end
|
17
17
|
|
18
|
+
def config_files
|
19
|
+
[
|
20
|
+
'/var/lib/pgsql/data/postgresql.conf'
|
21
|
+
]
|
22
|
+
end
|
23
|
+
|
18
24
|
def services
|
19
25
|
[
|
20
26
|
system_service('postgresql', 10, :component => 'foreman',
|
@@ -8,7 +8,7 @@ class Features::PackageManager < ForemanMaintain::Feature
|
|
8
8
|
:installed?, :find_installed_package, :install, :update,
|
9
9
|
:version_locking_enabled?, :configure_version_locking,
|
10
10
|
:foreman_related_packages, :version_locking_packages,
|
11
|
-
:versions_locked?, :clean_cache
|
11
|
+
:versions_locked?, :clean_cache, :remove
|
12
12
|
|
13
13
|
def self.type
|
14
14
|
@type ||= %w[dnf yum apt].find { |manager| command_present?(manager) }
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Procedures::ForemanDocker
|
2
|
+
class RemoveForemanDocker < ForemanMaintain::Procedure
|
3
|
+
metadata do
|
4
|
+
advanced_run false
|
5
|
+
description 'Drop foreman_docker plugin'
|
6
|
+
end
|
7
|
+
|
8
|
+
def docker_package
|
9
|
+
'tfm-rubygem-foreman_docker'
|
10
|
+
end
|
11
|
+
|
12
|
+
def run
|
13
|
+
return unless execute?("rpm -q #{docker_package}")
|
14
|
+
execute!('foreman-rake foreman_docker:cleanup')
|
15
|
+
packages_action(:remove, [docker_package], :assumeyes => true)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -58,6 +58,8 @@ module Scenarios::Satellite_6_6
|
|
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
|
@@ -112,6 +112,8 @@ module ForemanMaintain
|
|
112
112
|
feature(:package_manager).install(packages, :assumeyes => options[:assumeyes])
|
113
113
|
when :update
|
114
114
|
feature(:package_manager).update(packages, :assumeyes => options[:assumeyes])
|
115
|
+
when :remove
|
116
|
+
feature(:package_manager).remove(packages, :assumeyes => options[:assumeyes])
|
115
117
|
else
|
116
118
|
raise ArgumentError, "Unexpected action #{action} expected #{expected_actions.inspect}"
|
117
119
|
end
|
@@ -36,6 +36,11 @@ module ForemanMaintain::PackageManager
|
|
36
36
|
raise NotImplementedError
|
37
37
|
end
|
38
38
|
|
39
|
+
# remove package
|
40
|
+
def remove(packages, assumeyes: false)
|
41
|
+
raise NotImplementedError
|
42
|
+
end
|
43
|
+
|
39
44
|
# update package
|
40
45
|
def update(packages = [], assumeyes: false)
|
41
46
|
raise NotImplementedError
|
@@ -90,6 +90,10 @@ module ForemanMaintain::PackageManager
|
|
90
90
|
yum_action('install', packages, :assumeyes => assumeyes)
|
91
91
|
end
|
92
92
|
|
93
|
+
def remove(packages, assumeyes: false)
|
94
|
+
yum_action('remove', packages, :assumeyes => assumeyes)
|
95
|
+
end
|
96
|
+
|
93
97
|
def update(packages = [], assumeyes: false)
|
94
98
|
yum_action('update', packages, :assumeyes => assumeyes)
|
95
99
|
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
|
+
version: 0.4.3
|
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-
|
11
|
+
date: 2019-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- definitions/checks/services_up.rb
|
153
153
|
- definitions/checks/system_registration.rb
|
154
154
|
- definitions/checks/version_locking_enabled.rb
|
155
|
+
- definitions/checks/yum_exclude.rb
|
155
156
|
- definitions/features/candlepin.rb
|
156
157
|
- definitions/features/candlepin_database.rb
|
157
158
|
- definitions/features/cron.rb
|
@@ -204,7 +205,9 @@ files:
|
|
204
205
|
- definitions/procedures/candlepin/delete_orphaned_records_from_env_content.rb
|
205
206
|
- definitions/procedures/crond/start.rb
|
206
207
|
- definitions/procedures/crond/stop.rb
|
208
|
+
- definitions/procedures/foreman/apipie_cache.rb
|
207
209
|
- definitions/procedures/foreman/fix_corrupted_roles.rb
|
210
|
+
- definitions/procedures/foreman_docker/remove_foreman_docker.rb
|
208
211
|
- definitions/procedures/foreman_openscap/invalid_report_associations.rb
|
209
212
|
- definitions/procedures/foreman_tasks/delete.rb
|
210
213
|
- definitions/procedures/foreman_tasks/fetch_tasks_status.rb
|