Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Commit

Permalink
Fixes #29141 - CloudInit is compatible w/ Kickstart def user data
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren committed Feb 24, 2020
1 parent 03281e9 commit 2bff0b7
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions provisioning_templates/cloud_init/cloud_init_default.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,49 @@ This template accepts the following parameters:
- enable-puppetlabs-puppet6-repo: boolean (default=false)
-%>
<%
rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
pm_set = @host.puppetmaster.empty? ? false : true
proxy_uri = host_param('http-proxy') ? "http://#{host_param('http-proxy')}:#{host_param('http-proxy-port')}" : nil
puppet_enabled = pm_set || host_param_true?('force-puppet')
chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
-%>

#cloud-config
hostname: <%= @host.name %>
fqdn: <%= @host %>
manage_etc_hosts: true
users: {}
runcmd:
- |
<%= indent(2) { snippet 'fix_hosts' } -%>
- |
<% if proxy_uri -%>
echo 'proxy = <%= proxy_uri %>' >> /etc/yum.conf
<% end -%>
- |
echo "updating system time"
yum -y install ntpdate
/usr/sbin/ntpdate -sub <%= host_param('ntp-server') || '0.fedora.pool.ntp.org' %>
/usr/sbin/hwclock --systohc
- |
<% if rhel_compatible && !host_param_false?('enable-epel') -%>
<%= indent(2) { snippet 'epel' } -%>
<% end -%>
- |
<%= indent(2) { snippet 'redhat_register' } -%>
- |
<% if host_enc['parameters']['realm'] && @host.realm && (@host.realm.realm_type == 'FreeIPA' || @host.realm.realm_type == 'Red Hat Identity Management') -%>
<%= indent(2) { snippet 'freeipa_register' } %>
<% end -%>
- |
<%= indent(2) { snippet 'remote_execution_ssh_keys' } %>
- |
<%= indent(2) { snippet 'blacklist_kernel_modules' } %>
- |
<% if chef_enabled %>
<%= indent(2) { snippet 'chef_client' } %>
<% end -%>
- |
<%=
if puppet_enabled && (host_param_true?('enable-puppetlabs-repo') ||
host_param_true?('enable-puppetlabs-puppet6-repo') ||
Expand Down

0 comments on commit 2bff0b7

Please sign in to comment.