cem_acpt 0.9.0 → 0.9.2

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: dcea95d44401d3a90c8724ac2dbb85753eda2f38564ce84192f5580e1d528eaf
4
- data.tar.gz: 6b2b8f267e951c578b35d49a11180bc8640da1695352097dd6652fc3e401aea9
3
+ metadata.gz: 95508415e2d43c47c4bbd08963e688133e693c395ed646c8d9d6e62f3cab04af
4
+ data.tar.gz: 9b4618f3f1a544e35f00b88ff28efd755637db91d7e042c1e526e5720e6ecec2
5
5
  SHA512:
6
- metadata.gz: cbe2360892776beb52c7d83bda5813283fc8b26c43148a45a60c5d8be03d45104976d4a91e48dc4a0207092b65712fd87224df40844cc4000628869fd24f5824
7
- data.tar.gz: a6cfb5bc229561cdd0905d15c969de745bd14e5a767a60099543ca579b72659f6abc09cfa4182a44634552e23ace099c38095cc9bdfd06d471a436adebbd76a3
6
+ metadata.gz: 9ea28e2bb50d55cc24b96235360498cd0b76104bf48586bb9432e2d3b4e614b5d5e7a516b5587a77ff514629db897cc988e4cf4a084eb56d314b54a24d954661
7
+ data.tar.gz: e95003005da232f68c058ca492e30bf4eb5f4539772494e6e733da2ecad26e740b1d560bc46ef3dc3916ffbd9449a2b0e02636d5d9554613ee7cee6c317820e7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cem_acpt (0.9.0)
4
+ cem_acpt (0.9.2)
5
5
  async-http (>= 0.60, < 0.70)
6
6
  bcrypt_pbkdf (>= 1.0, < 2.0)
7
7
  deep_merge (>= 1.2, < 2.0)
@@ -74,6 +74,48 @@ module CemAcpt
74
74
  alias to_a provision_commands
75
75
  end
76
76
 
77
+ class DebianFamily
78
+ def initialize(config, image_name, base_image, os_major_version, puppet_version)
79
+ @config = config
80
+ @image_name = image_name
81
+ @base_image = base_image
82
+ @os_major_version = os_major_version
83
+ @puppet_version = puppet_version
84
+ end
85
+
86
+ def default_provision_commands
87
+ [install_curl_command, enable_puppet_repository_command, upgrade_packages_command, install_puppet_agent_command]
88
+ end
89
+
90
+ def provision_commands
91
+ commands_from_config = @config.get("images.#{@image_name}.provision_commands") || []
92
+ (default_provision_commands + commands_from_config).compact
93
+ end
94
+ alias to_a provision_commands
95
+
96
+ private
97
+
98
+ def upgrade_packages_command
99
+ 'sudo apt-get update && sudo apt-get upgrade -y'
100
+ end
101
+
102
+ def puppet_platform_repository_url
103
+ "https://apt.puppet.com/puppet#{@puppet_version}-release-focal.deb"
104
+ end
105
+
106
+ def enable_puppet_repository_command
107
+ "wget #{puppet_platform_repository_url} && sudo dpkg -i puppet#{@puppet_version}-release-focal.deb"
108
+ end
109
+
110
+ def install_puppet_agent_command
111
+ 'sudo apt-get install -y puppet-agent'
112
+ end
113
+
114
+ # The latest Google-provided Ubuntu images do not have curl installed by default
115
+ def install_curl_command
116
+ 'sudo apt-get install -y curl'
117
+ end
118
+ end
77
119
  class << self
78
120
  # Map of OS to class that holds the provision commands for that OS
79
121
  OS_CLASS_MAP = {
@@ -82,6 +124,7 @@ module CemAcpt
82
124
  'alma' => 'EnterpriseLinuxFamily',
83
125
  'oel' => 'EnterpriseLinuxFamily',
84
126
  'rocky' => 'EnterpriseLinuxFamily',
127
+ 'ubuntu' => 'DebianFamily',
85
128
  'windows' => 'WindowsFamily',
86
129
  }.freeze
87
130
 
@@ -7,11 +7,11 @@ module CemAcpt
7
7
  # Class provides methods for gathering provision data for Linux nodes
8
8
  class Linux < OsData
9
9
  def self.valid_names
10
- %w[centos rhel oel alma rocky]
10
+ %w[centos rhel oel alma rocky ubuntu]
11
11
  end
12
12
 
13
13
  def self.valid_versions
14
- %w[7 8 9]
14
+ %w[7 8 9 2004]
15
15
  end
16
16
 
17
17
  def systemd_files
@@ -197,7 +197,7 @@ module CemAcpt
197
197
  @bolt_test_runner.setup!
198
198
  return unless @bolt_test_runner.tests.to_a.empty?
199
199
 
200
- if !only_actions.empty? && only_actions.include?('bolt')
200
+ if !CemAcpt::Actions.config.only.empty? && CemAcpt::Actions.config.only.include?('bolt')
201
201
  raise 'No Bolt tests to run and only bolt action was specified'
202
202
  end
203
203
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CemAcpt
4
- VERSION = '0.9.0'
4
+ VERSION = '0.9.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cem_acpt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - puppetlabs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-12 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http