sparkle-pack-shell-helpers 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 289a035d321b4d64b0e7485afec3b1d85305fe1d
4
- data.tar.gz: bc1c6c4ac3560cc05979e69eea0f9d4977609483
3
+ metadata.gz: 6c4249c32e2cd5247aa61c7a92e14f88f232c99a
4
+ data.tar.gz: 77a6f9c837aff0555f29daec121a70f241976d4a
5
5
  SHA512:
6
- metadata.gz: b6b31b2eaf624233d36e35d3327223b3185f8eb8755d8eff5e884fb863f887cfa90d0b9b7643dba60e4a3641906d16cfa3adc14ad959d835041037a61f1ea42c
7
- data.tar.gz: 750d84c2b8e801f8cb6e09820cebb940978592f2e785f2d02799945a4236a42d0b7dcb6e48466abb620ea8d8d36dcdf6d7370e59fa49cddcafb9546d52c5d3c4
6
+ metadata.gz: 653055a7a541b46e4ff47ae939569a4509aa2299860126a22c0040b666dbaaced9ef5f1086014ccf75d1ce785ac51fbc1b61bdeed78a47499062c38a86005537
7
+ data.tar.gz: eae242efd3e8d9a09a1a49e7c9156128af61a0a8e23fc6360fae45ecb7767a14606ef602e003f35c52078f6ea23573ab0349dc4135e5c5fde1be270912ebf2d9
@@ -1,6 +1,6 @@
1
1
  SfnRegistry.register(:shell_helper) do |args|
2
- case args[:part]
3
- when :shebang
2
+ case args[:part].to_s
3
+ when 'shebang'
4
4
  "#!/bin/sh -ex\n\n"
5
5
 
6
6
  ## Put the following at the top of your userdata after shebang
@@ -9,8 +9,7 @@ SfnRegistry.register(:shell_helper) do |args|
9
9
  # 'CFN_REGION="', region!, "\"\n",
10
10
  #
11
11
  # Make sure you have cfn-init installed
12
-
13
- when :cfn_init
12
+ when 'cfn_init'
14
13
  <<-EOF
15
14
  /opt/aws/bin/cfn-init --verbose \\
16
15
  --stack "${CFN_STACK}" \\
@@ -18,6 +17,6 @@ SfnRegistry.register(:shell_helper) do |args|
18
17
  --region "${CFN_REGION}"\n
19
18
  EOF
20
19
  else
21
- raise!("Unknown part #{args[:part].inspect} passed to registry userdata")
20
+ raise!("Unknown part #{args[:part].inspect} passed to registry shell_helper")
22
21
  end
23
22
  end
@@ -0,0 +1,45 @@
1
+ SfnRegistry.register(:shell_install) do |args|
2
+ if args[:os].nil?
3
+ raise!(":os parameter is required for registry \"shell_install\"")
4
+ end
5
+
6
+ if args[:source].nil?
7
+ raise!("Param :source is required for registry \"shell_install\".")
8
+ end
9
+
10
+ case args[:part].to_s
11
+ when 'cfn_init'
12
+ case args[:os].to_s
13
+ when 'redhat', 'centos'
14
+ <<-EOF
15
+ yum install -y epel-release
16
+ yum install -y #{args[:source]}
17
+
18
+ # Now fix the cfn-hup script and copy to init.d location as AWS does not do it for you
19
+ cp -f "$(rpm -ql aws-cfn-bootstrap | grep init/redhat/cfn-hup)" /etc/init.d/ ||:
20
+ chmod 0755 /etc/init.d/cfn-hup
21
+ chkconfig --add cfn-hup\n
22
+ EOF
23
+ else
24
+ raise!("Unknown os #{args[:os].inspect} passed to registry shell_helper")
25
+ end
26
+
27
+ when 'codedeploy'
28
+ if args[:ruby].nil?
29
+ raise!("Param :ruby is required for part :codedeploy of registry \"shell_install\".")
30
+ end
31
+ case args[:os].to_s
32
+ when 'redhat', 'centos'
33
+ <<-EOF
34
+ # AWS CodeDeploy requires Ruby 2.0+ available as /usr/bin/ruby2.0
35
+ ln -s #{args[:ruby]} /usr/bin/ruby2.0 ||:
36
+
37
+ yum install -y #{args[:source]}\n
38
+ EOF
39
+ else
40
+ raise!("Unknown os #{args[:os].inspect} passed to registry shell_helper")
41
+ end
42
+ else
43
+ raise!("Unknown part #{args[:part].inspect} passed to registry \"shell_install\"")
44
+ end
45
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'sparkle-pack-shell-helpers'
3
- s.version = '0.1.0'
3
+ s.version = '0.2.0'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = 'SparklePack with various shell helpers to be used in UserData'
6
6
  s.description = 'Shell helpers to be used in UserData templates for easier generation of shell scripts'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparkle-pack-shell-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timur Batyrshin
@@ -18,6 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/sparkleformation/registry/shell_helper.rb
21
+ - lib/sparkleformation/registry/shell_install.rb
21
22
  - lib/sparkleformation/registry/shell_var.rb
22
23
  - sparkle-pack-shell-helpers.gemspec
23
24
  - lib/sparkle-pack-shell-helpers.rb