simp-beaker-helpers 1.20.0 → 1.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3223751413072f7e62097c273b72fa130bcc083701b418c5927bd97897a9f9c5
4
- data.tar.gz: 89c0620294618b21000ff2b79504df5bbe27f199b0bd4eb17ed69ce987d12899
3
+ metadata.gz: 7fc677903ad549041397ba842f11a2861c5e99b0b6c9717e0ac48e61485b6a7a
4
+ data.tar.gz: 824a685974d1bb8df8ba9335d1176c4ea281d77f79d7ecc76c3fd68b88a82a79
5
5
  SHA512:
6
- metadata.gz: 9179b27932ec80ecfddb09eb4ea2ba778c99513e31d341d7a85606f63ed85e152af7686b90f5e0a46ee11c50dd5aafe300f148069d6d4a87515fdb7e034fa8ed
7
- data.tar.gz: a05d10fdcdc609bcc9e2886b19f856304b8b2386d0377ad0680c0d712a1d6fdad2619908267fc196f55dfaa5339452abc1638d428431d4ce4171689b017519d3
6
+ metadata.gz: 31f997ddbe976bdfbc8fd904a7f8db3a972c6cfb47b62db12483fef311d1eb550caa2fd643e6abaf6dadd92063c288edb9217b472564b3c74af170f828449680
7
+ data.tar.gz: 7e3a00581115a489502e13f542246aed81be117d104df938b4097e086300649a732c9d6e9094a3e6696cf35b24a30b63a10df9db71158d298a88919530a9bc8d
@@ -1,3 +1,9 @@
1
+ ### 1.20.1 / 2021-01-08
2
+ * Fixed:
3
+ * Ensure that yum calls commands appropriately depending on whether or not
4
+ packages are already installed.
5
+ * Also change all HostKeyAlgorithms settings for SSH connections
6
+
1
7
  ### 1.20.0 / 2021-01-05
2
8
  * Added:
3
9
  * A `enable_epel_on` function that follows the instructions on the EPEL
@@ -331,7 +331,7 @@ module Simp::BeakerHelpers
331
331
 
332
332
  # Since we may be doing this prior to having a box flip into FIPS mode, we
333
333
  # need to find and modify *all* of the affected policies
334
- on( sut, %{sed --follow-symlinks -i 's/PubkeyAcceptedKeyTypes\\(.\\)/PubkeyAcceptedKeyTypes\\1#{key_types.join(',')},/' $( grep -L ssh-rsa $( find /etc/crypto-policies /usr/share/crypto-policies -type f -a \\( -name '*.txt' -o -name '*.config' \\) -exec grep -l PubkeyAcceptedKeyTypes {} \\; ) ) })
334
+ on( sut, %{sed --follow-symlinks -i 's/\\(HostKeyAlgorithms\\|PubkeyAcceptedKeyTypes\\)\\(.\\)/\\1\\2#{key_types.join(',')},/g' $( grep -L ssh-rsa $( find /etc/crypto-policies /usr/share/crypto-policies -type f -a \\( -name '*.txt' -o -name '*.config' \\) -exec grep -l PubkeyAcceptedKeyTypes {} \\; ) ) })
335
335
  end
336
336
  end
337
337
 
@@ -497,9 +497,13 @@ module Simp::BeakerHelpers
497
497
 
498
498
  # This is based on the official EPEL docs https://fedoraproject.org/wiki/EPEL
499
499
  if ['RedHat', 'CentOS'].include?(os_info['name'])
500
+ # EL7 returns 1 if install is called and there is nothing to do
501
+ yum_operation = 'install'
502
+ yum_operation = 'update' if sut.check_for_package('epel-release')
503
+
500
504
  on(
501
505
  sut,
502
- %{yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-#{os_maj_rel}.noarch.rpm},
506
+ %{yum #{yum_operation} -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-#{os_maj_rel}.noarch.rpm},
503
507
  :max_retries => 3,
504
508
  :retry_interval => 10
505
509
  )
@@ -1295,23 +1299,27 @@ done
1295
1299
  def install_simp_repos(sut, disable = [])
1296
1300
  # NOTE: Do *NOT* use puppet in this method since it may not be available yet
1297
1301
 
1298
- if on(sut, 'rpm -q yum-utils', :accept_all_exit_codes => true).exit_code != 0
1299
- on(
1300
- sut,
1301
- 'yum -y install yum-utils',
1302
- :max_retries => 3,
1303
- :retry_interval => 10
1304
- )
1305
- end
1306
-
1307
- if on(sut, 'rpm -q simp-release-community', :accept_all_exit_codes => true).exit_code != 0
1308
- on(
1309
- sut,
1310
- 'yum -y install "https://download.simp-project.com/simp-release-community.rpm"',
1311
- :max_retries => 3,
1312
- :retry_interval => 10
1313
- )
1314
- end
1302
+ # EL7 returns 1 if install is called and there is nothing to do
1303
+ yum_operation = 'install'
1304
+ yum_operation = 'update' if sut.check_for_package('yum-utils')
1305
+
1306
+ on(
1307
+ sut,
1308
+ "yum -y #{yum_operation} yum-utils",
1309
+ :max_retries => 3,
1310
+ :retry_interval => 10
1311
+ )
1312
+
1313
+ # EL7 returns 1 if install is called and there is nothing to do
1314
+ yum_operation = 'install'
1315
+ yum_operation = 'update' if sut.check_for_package('simp-release-community')
1316
+
1317
+ on(
1318
+ sut,
1319
+ %{yum -y #{yum_operation} "https://download.simp-project.com/simp-release-community.rpm"},
1320
+ :max_retries => 3,
1321
+ :retry_interval => 10
1322
+ )
1315
1323
 
1316
1324
  to_disable = disable.dup
1317
1325
 
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.20.0'
4
+ VERSION = '1.20.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-08 00:00:00.000000000 Z
12
+ date: 2021-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker