cem_acpt 0.9.0 → 0.9.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: dcea95d44401d3a90c8724ac2dbb85753eda2f38564ce84192f5580e1d528eaf
4
- data.tar.gz: 6b2b8f267e951c578b35d49a11180bc8640da1695352097dd6652fc3e401aea9
3
+ metadata.gz: 3f23a68eeaf8f9808ef643676c3dd16fff63d85abc3ab76eb4c56c256d57becd
4
+ data.tar.gz: f3ab49fb629f2ad92ce8c2a0f5ee70eca7112e9741c249b7c00f965782d52188
5
5
  SHA512:
6
- metadata.gz: cbe2360892776beb52c7d83bda5813283fc8b26c43148a45a60c5d8be03d45104976d4a91e48dc4a0207092b65712fd87224df40844cc4000628869fd24f5824
7
- data.tar.gz: a6cfb5bc229561cdd0905d15c969de745bd14e5a767a60099543ca579b72659f6abc09cfa4182a44634552e23ace099c38095cc9bdfd06d471a436adebbd76a3
6
+ metadata.gz: 3abf23773f33488b95ec4c5eeffa94118dcb5e84baebcd05a0c9a290cb67812860e1eb151c5dc159f3037d07844109b69b53ef1a20313146ef2a5f4ed4105cf8
7
+ data.tar.gz: b39069af4bc18eb05472c80497344f1a1e568bbf3b1160d4cf276c5f767ef9a23ecc75edabc11b3e6632daccaf9e4a2d18fd31d82c753c4baf6be6c2df0de77d
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.1)
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
@@ -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.1'
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.1
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-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http