-
-
Save timogoebel/959deecff4f8ca8bcdd5fc9f95cbc8e3 to your computer and use it in GitHub Desktop.
#cloud-config | |
hostname: <%= @host.name %> | |
fqdn: <%= @host %> | |
manage_etc_hosts: true | |
users: {} | |
runcmd: | |
- | | |
<%= indent(2) { snippet('puppet_setup customized', :variables => { :full_puppet_run => true }) } %> | |
phone_home: | |
url: <%= foreman_url('built') %> | |
post: [] | |
tries: 10 |
# This is the default puppet_setup snippet | |
# the only line that needs to be changed is | |
# the actual call to puppet. | |
# The parameter "--tags no_such_tag" must not be passed | |
# as you want puppet to do a full puppet run. | |
# This can be done via a parameter "full_puppet_run" | |
# as you can see in the example below. | |
<%= bin_path %>/puppet agent --config <%= etc_path %>/puppet.conf --onetime <%= @host.param_true?('run-puppet-in-installer') || @full_puppet_run ? '' : '--tags no_such_tag' %> <%= @host.puppetmaster.blank? ? '' : "--server #{@host.puppetmaster}" %> --no-daemonize |
# Template for VMWare customization via open-vm-tools | |
identity: | |
LinuxPrep: | |
domain: <%= @host.domain %> | |
hostName: <%= @host.shortname %> | |
hwClockUTC: true | |
timeZone: <%= @host.params['time-zone'] || 'UTC' %> | |
globalIPSettings: | |
dnsSuffixList: [<%= @host.domain %>] | |
<%- @host.interfaces.each do |interface| -%> | |
<%- next unless interface.subnet -%> | |
dnsServerList: [<%= interface.subnet.dns_primary %>, <%= interface.subnet.dns_secondary %>] | |
<%- end -%> | |
nicSettingMap: | |
<%- @host.interfaces.each do |interface| -%> | |
<%- next unless interface.subnet -%> | |
- adapter: | |
dnsDomain: <%= interface.domain %> | |
dnsServerList: [<%= interface.subnet.dns_primary %>, <%= interface.subnet.dns_secondary %>] | |
gateway: [<%= interface.subnet.gateway %>] | |
ip: <%= interface.ip %> | |
subnetMask: <%= interface.subnet.mask %> | |
<%- end -%> |
These templates should be part of Foreman core starting with Foreman 1.23. These features have been incubated in a plugin. The plugin README describes the necessary steps to set this up. Note, that you don't need to have the plugin installed in Foreman 1.23 and newer.
Hi timogoebel !
thks for your reply, i use foreman 1.24.2, and i try to use cloud-init client with centos8 template, i have configured : 1 userdata template for the networks config and 1 cloud-init template for custom scripts post-install, and when my new vm boot, network config is ko, no ip configured, and if i use only userdata template its works ! any ideas ?
How do the rendered templates look like? As a side note: For support, it‘s best to use community.theforeman.org. Do you mind posting your question there? Feel free to ping me, i‘ll answer there.
Hi !
How use these templates for me too userdata template works :) but how to use other 2 ?
thks