Created
April 18, 2014 20:57
-
-
Save LeoAdamek/11064075 to your computer and use it in GitHub Desktop.
Foreman Provisioning Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [main] | |
| vardir = /var/lib/puppet | |
| logdir = /var/log/puppet | |
| rundir = /var/run/puppet | |
| ssldir = \$vardir/ssl | |
| [agent] | |
| pluginsync = true | |
| report = true | |
| ignoreschedules = true | |
| daemon = true | |
| runinterval = 900 | |
| certname = <%= @host.certname %> | |
| environment = <%= @host.environment %> | |
| server = <%= @host.puppetmaster %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Set Hostname | |
| <% if @host.capabilities.include?(:image) -%> | |
| echo '<%= @host %>' > /etc/hostname | |
| hostname <%= @host %> | |
| cat > /etc/hosts << EOF | |
| <%= snippets 'etc-hosts' %> | |
| EOF | |
| <% end -%> | |
| <% if @host.params['ssh_debug_key'] -%> | |
| echo "Setting up SSH" | |
| echo <%= @host.params['ssh_debug_key'] %> > /root/.ssh/authorized_keys | |
| <% end -%> | |
| # Install puppet | |
| echo "Installing Puppet" | |
| wget https://apt.puppetlabs.com/puppetlabs-release-wheezy.deb -O /tmp/puppetlabs.deb | |
| dpkg -iy /tmp/puppetlabs.deb | |
| apt-get update | |
| apt-get -y install puppet | |
| # Start puppeting | |
| <% if @host.info['classes'].include?('puppet::server') -%> | |
| <%= snippets 'master_bootstrap' %> | |
| <% else -%> | |
| cat > /etc/puppet/puppet.conf << EOF | |
| <%= snippets 'puppet.conf' %> | |
| EOF | |
| echo "Running Puppet Agent" | |
| puppet agent | |
| <% end -%> | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment