sparkle-pack-cfn-init-chef 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8a10def0785fe544661318b7bc34624072ae1572
4
+ data.tar.gz: 9557131f5253390ae5cc5fc1f88cca7d9c203dd0
5
+ SHA512:
6
+ metadata.gz: 701d9b7f2f8f07a765d82bae03e4be4acee581b43f964900038e63836c2cd5c2e58f1f8daee31d33940976644666ad4aa055aaf047a2042f107bb711bdaeeecf
7
+ data.tar.gz: 224a5a12f41cd8a459a1d757ebb0a7d62cb47d7aeb3a285002945438b741e33d4e5e7109463bd4d155d7621786b62d392a08b73a980b0639f4b6b5e9c2a70b52
@@ -0,0 +1 @@
1
+ SparkleFormation::SparklePack.register!
@@ -0,0 +1,78 @@
1
+ SfnRegistry.register(:chef_client) do |_name, _config={}|
2
+
3
+ chef_bucket = _config.fetch(:chef_bucket)
4
+
5
+ metadata('AWS::CloudFormation::Authentication') do
6
+ chef_s3_auth do
7
+ set!('roleName'._no_hump, _config.fetch(:auth_role))
8
+ set!('buckets'._no_hump, [ chef_bucket ])
9
+ set!('type'._no_hump, 'S3')
10
+ end
11
+ end
12
+
13
+ metadata('AWS::CloudFormation::Init') do
14
+ _camel_keys_set(:auto_disable)
15
+ configSets do |sets|
16
+ sets.default += ['chef_client']
17
+ end
18
+ chef_client do
19
+ files('/etc/chef/validation.pem') do
20
+ source join!(
21
+ 'https://', chef_bucket, '.s3.amazonaws.com/', 'validation.pem'
22
+ )
23
+ mode '000400'
24
+ owner 'root'
25
+ group 'root'
26
+ authentication 'ChefS3Auth'
27
+ end
28
+ if _config[:data_bag_secret]
29
+ files('/etc/chef/encrypted_data_bag_secret') do
30
+ source join!(
31
+ 'https://', chef_bucket, '.s3.amazonaws.com/', 'encrypted_data_bag_secret'
32
+ )
33
+ mode '000400'
34
+ owner 'root'
35
+ group 'root'
36
+ authentication 'ChefS3Auth'
37
+ end
38
+ end
39
+ files('/etc/chef/client.rb') do
40
+ content join!(
41
+ "chef_server_url '#{_config.fetch(:chef_server)}'\n",
42
+ "environment '#{_config.fetch(:chef_environment, '_default')}'\n",
43
+ "log_location '/var/log/chef/client.log'\n",
44
+ "validation_client_name '#{_config.fetch(:validation_client)}'\n"
45
+ )
46
+ mode '000400'
47
+ owner 'root'
48
+ group 'root'
49
+ end
50
+ files('/etc/chef/first_run.json') do
51
+ content do
52
+ run_list _config.fetch(:run_list)
53
+ _config.fetch(:attributes, {}).merge(
54
+ :stack => {
55
+ :name => stack_name!,
56
+ :id => stack_id!,
57
+ :region => region!
58
+ }
59
+ )
60
+ end
61
+ end
62
+ commands('00_install_chef') do
63
+ command 'curl -L https://omnitruck.chef.io/install.sh | sudo bash'
64
+ end
65
+ commands('01_log_dir') do
66
+ command 'mkdir /var/log/chef'
67
+ test 'test ! -e /var/log/chef'
68
+ end
69
+ commands('02_chef_first_run') do
70
+ command 'chef-client -j /etc/chef/first_run.json'
71
+ end
72
+ commands('03_remove_validation_pem') do
73
+ command 'rm /etc/chef/validation.pem'
74
+ test 'test -e /etc/chef/client.pem'
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,12 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'sparkle-pack-cfn-init-chef'
3
+ s.version = '0.0.2'
4
+ s.licenses = ['MIT']
5
+ s.summary = 'CFN Init Chef SparklePack'
6
+ s.description = 'SparklePack to provide cfn-init config set to bootstrap an instance using Chef'
7
+ s.authors = ['Michael F. Weinberg']
8
+ s.email = 'michael@luckymike.com'
9
+ s.homepage = 'https://github.com/reverseskate'
10
+ s.files = Dir[ 'lib/sparkleformation/registry/*' ] + %w(sparkle-pack-cfn-init-chef.gemspec lib/sparkle-pack-cfn-init-chef.rb)
11
+ s.add_runtime_dependency 'sparkle_formation'
12
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sparkle-pack-cfn-init-chef
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Michael F. Weinberg
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sparkle_formation
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: SparklePack to provide cfn-init config set to bootstrap an instance using
28
+ Chef
29
+ email: michael@luckymike.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - lib/sparkle-pack-cfn-init-chef.rb
35
+ - lib/sparkleformation/registry/chef_client.rb
36
+ - sparkle-pack-cfn-init-chef.gemspec
37
+ homepage: https://github.com/reverseskate
38
+ licenses:
39
+ - MIT
40
+ metadata: {}
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubyforge_project:
57
+ rubygems_version: 2.5.1
58
+ signing_key:
59
+ specification_version: 4
60
+ summary: CFN Init Chef SparklePack
61
+ test_files: []