Project

General

Profile

« Previous | Next » 

Revision 7b966530

Added by Dominic Cleal about 8 years ago

templates - sync from community-templates

View differences:

app/views/unattended/kickstart/userdata.erb
kind: user_data
name: Kickstart default user data
oses:
- CentOS 4
- CentOS 5
- CentOS 6
- CentOS 7
- Fedora 16
- Fedora 17
- Fedora 18
- Fedora 19
- Fedora 20
- CentOS
- Fedora
-%>
#!/bin/bash
<%# Cloud instances frequently have incorrect hosts data %>
<%= snippet 'fix_hosts' %>
<%
# safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.param_true?('force-puppet')
salt_enabled = @host.params['salt_master'] ? true : false
chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
%>
<% if puppet_enabled %>
yum install -y puppet
cat > /etc/puppet/puppet.conf << EOF
<%= snippet 'puppet.conf' %>
EOF
#!/bin/bash
# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
<%# Cloud instances frequently have incorrect hosts data %>
<%= snippet 'fix_hosts' %>
/usr/bin/puppet agent --config /etc/puppet/puppet.conf --onetime --tags no_such_tag <%= @host.puppetmaster.blank? ? '' : "--server #{@host.puppetmaster}" %> --no-daemonize
<%= snippet('remote_execution_ssh_keys') %>
<% if chef_enabled %>
<%= snippet 'chef_client' %>
<% end -%>
<% if puppet_enabled %>
<%= snippet 'puppet_setup' %>
<% end -%>
<% if salt_enabled %>
<%= snippet 'saltstack_setup' %>
<% end -%>
# UserData still needs wget to mark as finished
/usr/bin/wget --quiet --output-document=/dev/null --no-check-certificate <%= foreman_url('built') %>

Also available in: Unified diff