awstool 0.1.1 → 0.1.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 +4 -4
- data/lib/awstool/instance.rb +2 -1
- data/lib/awstool/version.rb +1 -1
- data/userdata/default.erb +13 -13
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dbdda7c021771785cd49640a028eec8b8551666d
|
|
4
|
+
data.tar.gz: 862bbb43473f722000217f63258d5413c7f73979
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c86056fbedcc08aab885db7fb81f3b364b1790f357e8311c5ddf2d9003e05d28bdbc73b4e7f90bdc4f7b05aae062a48c731362f780f2f6917f5abded03837559
|
|
7
|
+
data.tar.gz: 89925c7f1dbdea042e38c932e69923bc3970a2e11eaba7e0a13aff54ba45701e9a5cc545140f4f0f349362d6a7ed9a3d155e8b47792a6762687b2ca5cd19585e
|
data/lib/awstool/instance.rb
CHANGED
|
@@ -19,6 +19,7 @@ class Awstool::Instance
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def launch
|
|
22
|
+
b = binding
|
|
22
23
|
@instance = @compute.servers.create(
|
|
23
24
|
image_id: @options['image-id'],
|
|
24
25
|
flavor_id: @options['instance-type'],
|
|
@@ -26,7 +27,7 @@ class Awstool::Instance
|
|
|
26
27
|
subnet_id: @options['subnet-ids'][@options['subnet-id-index']],
|
|
27
28
|
key_name: @options['key-name'],
|
|
28
29
|
tags: @options['tags'],
|
|
29
|
-
user_data: ERB.new(File.read(@options['userdata'])).result,
|
|
30
|
+
user_data: ERB.new(File.read(@options['userdata'])).result(b),
|
|
30
31
|
block_device_mapping: [
|
|
31
32
|
{
|
|
32
33
|
'DeviceName' => '/dev/sda1',
|
data/lib/awstool/version.rb
CHANGED
data/userdata/default.erb
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#cloud-config
|
|
2
2
|
|
|
3
3
|
bootcmd:
|
|
4
|
-
- echo <%= options['hostname'] %> > /etc/hostname
|
|
4
|
+
- echo <%= @options['hostname'] %> > /etc/hostname
|
|
5
5
|
- hostname -F /etc/hostname
|
|
6
6
|
|
|
7
|
-
hostname: <%= options['hostname'] %>
|
|
8
|
-
fqdn: <%= options['hostname'] %>
|
|
7
|
+
hostname: <%= @options['hostname'] %>
|
|
8
|
+
fqdn: <%= @options['hostname'] %>
|
|
9
9
|
manage_etc_hosts: true
|
|
10
10
|
|
|
11
11
|
package_upgrade: true
|
|
12
12
|
package_reboot_if_required: true
|
|
13
13
|
|
|
14
14
|
write_files:
|
|
15
|
-
<% if options['puppet_install']['csr_attributes'] %>
|
|
15
|
+
<% if @options['puppet_install']['csr_attributes'] %>
|
|
16
16
|
- content: |
|
|
17
17
|
---
|
|
18
18
|
custom_attributes:
|
|
19
|
-
1.2.840.113549.1.9.7: <%= options['puppet_install']['csr_attributes'] %>
|
|
19
|
+
1.2.840.113549.1.9.7: <%= @options['puppet_install']['csr_attributes'] %>
|
|
20
20
|
path: /etc/puppetlabs/puppet/csr_attributes.yaml
|
|
21
21
|
permissions: 0600
|
|
22
22
|
<% end %>
|
|
23
|
-
<% options['facts'].each do |fact, value| %>
|
|
23
|
+
<% @options['facts'].each do |fact, value| %>
|
|
24
24
|
- content: |
|
|
25
25
|
---
|
|
26
26
|
<%= fact %>: <%= value %>
|
|
@@ -28,18 +28,18 @@ write_files:
|
|
|
28
28
|
permissions: '0644'
|
|
29
29
|
<% end %>
|
|
30
30
|
|
|
31
|
-
<% if options['puppet_install'] %>
|
|
31
|
+
<% if @options['puppet_install'] %>
|
|
32
32
|
runcmd:
|
|
33
|
-
<% if options['puppet_install']['package_manager'] == 'apt-get' %>
|
|
34
|
-
- wget https://apt.puppetlabs.com/<%= options['puppet_install']['repo_package'] %>
|
|
35
|
-
- dpkg -i /<%= options['puppet_install']['repo_package'] %>
|
|
33
|
+
<% if @options['puppet_install']['package_manager'] == 'apt-get' %>
|
|
34
|
+
- wget https://apt.puppetlabs.com/<%= @options['puppet_install']['repo_package'] %>
|
|
35
|
+
- dpkg -i /<%= @options['puppet_install']['repo_package'] %>
|
|
36
36
|
- apt-get update
|
|
37
37
|
- apt-get -y install puppet-agent
|
|
38
|
-
<% elsif options['puppet_install']['package_manager'] == 'yum' %>
|
|
39
|
-
- rpm -ivh https://yum.puppetlabs.com/<%= options['puppet_install']['repo_package'] %>
|
|
38
|
+
<% elsif @options['puppet_install']['package_manager'] == 'yum' %>
|
|
39
|
+
- rpm -ivh https://yum.puppetlabs.com/<%= @options['puppet_install']['repo_package'] %>
|
|
40
40
|
- yum -y install puppet-agent
|
|
41
41
|
<% end %>
|
|
42
|
-
- /opt/puppetlabs/bin/puppet agent -t --waitforcert 5 --server <%= options['puppet_install']['server'] %> <% if options['puppet_install']['environment'] %> --environment <%= options['puppet_install']['environment'] %><% end %>
|
|
42
|
+
- /opt/puppetlabs/bin/puppet agent -t --waitforcert 5 --server <%= @options['puppet_install']['server'] %> <% if @options['puppet_install']['environment'] %> --environment <%= @options['puppet_install']['environment'] %><% end %>
|
|
43
43
|
- /opt/puppetlabs/bin/puppet agent -t
|
|
44
44
|
<% else %>
|
|
45
45
|
<% end %>
|