Sha256: 7a9f98f36c4263a945a199e51c396721ff54e877513eafa5d48837ebce4765c0

Contents?: true

Size: 1.97 KB

Versions: 2

Compression:

Stored size: 1.97 KB

Contents

#cloud-config

timezone: <%= @options['timezone'] %>

hostname: <%= @options['hostname'] %>
fqdn: <%= @options['hostname'] %>
manage_etc_hosts: true

package_upgrade: true
package_reboot_if_required: true

<% if  @options['block_devices'] %>
disk_setup:
<% @options['block_devices'].each do |device, opts| %>
  /dev/<%= device %>:
    table_type: gpt
    layout: true
    overwrite: true
<% end %>

fs_setup:
<% @options['block_devices'].each do |device, opts| %>
- label: None
  filesystem: <%= opts['filesystem'] %>
  device: /dev/<%= device %>1
  partition: auto
<% end %>

mounts:
<% @options['block_devices'].each do |device, opts| %>
- [ /dev/<%= device %>1, <%= opts['mountpoint'] %>, <%= opts['filesystem'] %>, 'defaults,noatime', '0', '2' ]
<% end %>
<% end %>

write_files:
<% if @options['puppet_install']['csr_attributes'] %>
- content: |
    ---
    custom_attributes:
      1.2.840.113549.1.9.7: <%= @options['puppet_install']['csr_attributes'] %>
  path: /etc/puppetlabs/puppet/csr_attributes.yaml
  permissions: 0600
<% end %>
<% @options['facts'].each do |fact, value| %>
- content: |
    ---
    <%= fact %>: <%= value %>
  path: /opt/puppetlabs/facter/facts.d/<%= fact %>.yaml
  permissions: '0644'
<% end %>

<% if @options['puppet_install'] %>
runcmd:
<% if @options['puppet_install']['package_manager'] == 'apt-get' %>
- wget https://apt.puppetlabs.com/<%= @options['puppet_install']['repo_package'] %>
- dpkg -i /<%= @options['puppet_install']['repo_package'] %>
- apt-get update
- apt-get -y install puppet-agent
<% elsif @options['puppet_install']['package_manager'] == 'yum' %>
- rpm -ivh https://yum.puppetlabs.com/<%= @options['puppet_install']['repo_package'] %>
- yum -y install puppet-agent
<% end %>
- /opt/puppetlabs/bin/puppet agent -t --waitforcert 5  --server <%= @options['puppet_install']['server'] %> <% if @options['puppet_install']['environment'] %> --environment <%= @options['puppet_install']['environment'] %><% end %>
- /opt/puppetlabs/bin/puppet agent -t
<% else %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
awstool-0.2.3 userdata/default.erb
awstool-0.2.2 userdata/default.erb