Code Monkey home page Code Monkey logo

community-templates's Introduction

This Repository is archived and templates are migrated to the relevant repositories. For more information Click Here.

Community Templates

A place for us to collaborate around templates & snippets for various OSes.

Repo metadata

So that the templates can eventually be updated automatically in Foreman, we are adding metadata to the top of every template. This metadata can be read by a plugin (such as foreman_templates) to determine information abut the template. The metadata is read until the first non-comment line, and contains, the template name, template kind, and any appropriate OS associations. For example:

#kind: user_data
#name: My Userdata
#oses:
# - CentOS 7
# - Debian
# - Ubuntu

Because all the data is contained in the metadata, filenames are arbitrary, however, for consistency we ask that they be grouped appropriately, and end in .erb.

Have a look around the repo for examples.

Testing

There is a test suite available in this repo that tries to render templates using dummy values passing the output to ksvalidator tool which can be found in Fedora and Red Hat repositories as part of pykickstart package and in Ubuntu repositories as part of python-pykickstart package.

You will need ksvalidator from Fedora 20 or later to execute tests. Pykickstart can be installed from git easily too. Use '-l' option to get list of supported versions:

$ ksvalidator -l

To start unit tests do something like:

$ ruby -Itest test/kickstart/provision_test.rb

Another set of tests is in Foreman core git repository, it's possible to run useful render test from the core git repo against this directory:

foreman$ bundle exec rake templates:render DIRECTORY=/path/to/community-templates/provisioning_templates/

It will render selected templates and output can be easily compared via git diff.

Contributing

Please fork and send a pull request. Thanks!

Notes for various templates

CoreOS

The templates use some Host Parameters to contol the flow of the template. These are:

  • install-disk: What device to install to (default: /dev/sda | /dev/vda)
  • ssh_authorized_keys: add public SSH keys which will be authorized for the core user. You can specify multiple SSH keys seperated with a "," (default: empty)
  • etcd_discovery_url: provision a discovery token for etcd to allow a simple cluster deployment. You can get a new discovery token at https://discovery.etcd.io/new. This parameter is used in the coreos_cloudconfig snippet. (default: empty)
  • expose_docker_socket: if you want to have an exposed Docker TCP socket set this to "true"
  • enable_etcd: if you don't require the etcd (and fleet) service, set this to "false" (default: true)
  • reboot-strategy: set the reboot-strategy for CoreOS, for more information have a look at the official documentation

If you don't add any SSH keys you can login with the core user using the root password.

More Information are available on the CoreOS site

Kickstart

Kickstart Files

There is one kickstart and accompanying PXE config, which works for:

Fedora 16 Fedora 17 Fedora 18 Fedora 19 Fedora 20 RHEL, CentOS 5.9 RHEL, CentOS 6.3

Poap

Cisco NX-OS PowerOn Auto Provisioning (POAP) support

More information is available here: http://projects.theforeman.org/issues/10526

Preseed

Tested on:

  • Ubuntu 10.04 (lucid)
  • Ubuntu 12.04 (precise)
  • Ubuntu 13.04 (raring)
  • Ubuntu 14.04 (trusty)
  • Debian 6.0 (Squeeze)
  • Debian 7 (Wheezy)
  • Debian 8 (Jessie)

Host Parameters

The templates use some Host Parameters to control the flow of the template. These are:

  • install-disk: What device to install to (default: the first disk returned with list-devices disk)
  • partitioning-method: regular (default for Preseed default), lvm (default for Preseed default lvm) or crypto
  • partitioning-recipe: atomic (default for Preseed default), home, or multi (default for Preseed default lvm)
  • partitioning-disk-label: If present labels the disk as specified. (Default: automatic/not set. Can be msdos or gpt)
  • partitioning-expert-recipe: Entire recipe (default: empty, i.e partitioning-recipe)
  • partitioning-vg-name: LVM volume group name (default: vg01 for Preseed default lvm)
  • partitioning-filesystem: One of ext4, ext4, btrfs, ... (default: empty, the default is used)
  • partitioning-crypto-erase: Secure erase partition when using crypto method. true or false (default: false)
  • partitioning-crypto-password: Password for luks crypto method. Recommend changing this post install! (default: temporarypassword)
  • partitioning-crypto-password-weak: Allow weak passwords when using crypto. (default: false)
  • partitioning-allow-noswap: Allow partitioning without swap. (default: false)
  • enable-puppet-puppet5: Assume Puppet 5 AIO packages instead of system packages
  • enable-puppet-puppet6: Assume Puppet 6 AIO packages instead of system packages
  • enable-puppetlabs-repo: Add the Puppet Labs repo during install (default: false)
  • enable-puppetlabs-puppet5-repo: Add the Puppet Labs Puppet 5 repo during install (default: false)
  • enable-puppetlabs-puppet6-repo: Add the Puppet Labs Puppet 6 repo during install (default: false)
  • enable-saltstack-repo: Add the SaltStack APT repo to the APT sources during install (default: false)
  • salt_master: SaltStack Master (default: empty)
  • salt_grains: Salt client specific information, like facter (default: empty)
  • preseed-update-policy: Preseed policy for applying updates to running systems. Can be none, unattended-upgrades, or landscape. (default: unattended-upgrades)
  • preseed-live-installer: Informs the installer that the installation source is from an iso. Can be true or false. (defaults: notset/false)
  • preseed-kernel-image: Specify the kernel-image to install. Ex: linux-image-generic-lts-xenial or linux-image-4.4.0-34-generic. (default: empty)
  • preseed-post-install-upgrade: Upgrade Debian post installation. Can be none, safe-upgrade, or full-upgrade. (default: none)

Detailed description is available at https://www.debian.org/releases/stable/amd64/apbs04.html.en

ZTP

Junos Zero-Touch-Provisioning support

More information is available here: http://projects.theforeman.org/issues/3906

License

Copyrights are retained by their owners

This entire repository is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Exceptions

The following file(s) are not licensed under the GPLv3+ as described above and instead contain copyright and license information in their headers:

  • ztp/provision.erb: BSD 2-clause licensed

community-templates's People

Contributors

adamruzicka avatar alexjfisher avatar ares avatar derektamsen avatar dgoetz avatar dlobatog avatar dmitri-d avatar domcleal avatar edestecd avatar ekohl avatar fraenki avatar gregsutcliffe avatar hboetes avatar imphil avatar jovandeginste avatar lzap avatar m-bucher avatar mattiasgiese-b1 avatar mburns72h avatar mmoll avatar ofedoren avatar parthaa avatar sathieu avatar sbernhard avatar sergelogvinov avatar stbenjam avatar sthirugn avatar timogoebel avatar wnkz avatar xprazak2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

community-templates's Issues

Add support for non-free and contrib repositories to Debian

The preseed configuration for Debian has the ability to configure the 'contrib' and 'non-free' components with the following keys:

# You can choose to install non-free and contrib software.
#d-i apt-setup/non-free boolean true
#d-i apt-setup/contrib boolean true

https://www.debian.org/releases/stretch/amd64/apbs04.html.en

It would be useful to be able to control these during a deployment with Foreman, using the community preseed template.

Thanks.

Support DHCP (v4) during installation, static (v6 only) after installation

We manage machines via IPv6 only; however not everything supports this, so we start the installation via DHCP IPv4, then configure the network interfaces and after the reboot only use IPv6 for the management interface. Schematically:

  • pxe over eth0: v4, dhcp
  • anaconda+kickstart (still eth0): v4 (dhcp address)
  • kickstart configures network interfaces, including eth0
    • eth0 will have a (static) v6 address, no v4 address
  • after reboot, no v4 address left for eth0 (other interfaces probably still have a v4 address)

I found no way to model the subnet for eth0. Any tips?

Empty space in 'userdata' scripts breaks cloud-init

If there is an empty space at the top of any user-data script, cloud-init gets mad and quits. It is looking for the #! as the very first line. This code adds an empty line:

<%#
kind: user_data
name: Preseed default user data
oses:

  • Debian 6.0
  • Debian 7.
  • Debian 8.
  • Ubuntu 12.04
  • Ubuntu 14.04
    %>

Installing servers with bonding enabled DURING installation does not work

We started testing with booting servers with bonding straight after PXE. This has an annoying side effect: the two slave devices have the same mac address :-)

The current way that Foreman gets a device's OS-determined name (here) does not work then:

ip -o link | awk '/#{@interface.inheriting_mac}/ {print $2;}' | sed s/:$//

We switched to the following line instead, which seems to work in all our cases (including non-bond servers):

grep -l #{@interface.inheriting_mac} /sys/class/net/*/{bonding_slave/perm_hwaddr,address} \
    | awk -F '/' '// {print $5}' | head -1

In short: we prioritize bonding slaves (like eth0) over other devices (like bond0).

Anyone care to weigh in on this?

Preseed policy is hard coded to unattended-upgrades

The provision.erb preseed script is currently hard coded to automatically install security updates on a running ubuntu or debian system. This should be changed to a variable to allow overriding the default with foreman global parameters.

Use new macros in templates

PR containing new macros was merged into core. We should use new macros:

host_enc instead of @host.info
host_param_true? instead of @host.param_true?
host_param_false? instead of @host.param_false?
host_param('param_name') instead of @host.params['param_name']

Installation of puppet-agent fails

Hello,

since a few days, when I provision a new VM (in this case Ubuntu 16.04.1 LTS) it fails during the "Select and install software" step with the error

WARNING: The following packages cannot be authenticated!
puppet-agent

puppet_auth_issue

Error while define PXE default

Hi All

I tried to build my own template for the CentOS 6 / 7 with my customization.

I found error while I build the host.

Templates

Failure parsing Kickstart-CTF default: undefined local variable or method `proxy_string' for #Host::Managed:0x0000000988aff0.

My Template.

<%#
kind: provision
name: Kickstart-CTF default
oses:
- CentOS 6
- CentOS 7
%>
<%#
This template accepts the following parameters:
- lang: string (default="en_US.UTF-8")
- keyboard: string (default="us")
- time-zone: string (default="UTC")
- http-proxy: string (default="")
- http-proxy-port: string (default="")
- force-puppet: boolean (default=false)
- enable-puppetlabs-repo: boolean (default=false)
- salt_master: string (default=undef)
- ntp-server: string (default="ntp1.sjc.collab.net")
%>
install
<%= @mediapath %><%= proxy_string %>
lang <%= @host.params['lang'] || 'en_US.UTF-8' %>
selinux --permissive
keyboard <%= @host.params['keyboard'] || 'us' %>
skipx

<% subnet = @host.subnet -%>
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
<% dhcp = subnet.dhcp_boot_mode? && !@static -%>
<% else -%>
<% dhcp = !@static -%>
<% end -%>

network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select(&:present?).join(',')}" %> --device=<%= @host.mac -%> --hostname <%= @host %>
rootpw --iscrypted <%= root_pass %>
firewall --disabled
authconfig --useshadow --passalgo=sha256 --kickstart
timezone --utc <%= @host.params['time-zone'] || 'UTC' %>

<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>

text
reboot

%packages
yum
dhclient
ntp
wget
@Core
@system-admin-tools
acl
at
attr
audit
authconfig
bb_client
bc
bind-libs
bind-utils
blktrace
bzip2
cnops-janitor
collabnet_monitor
compat-libstdc++-296
compat-libstdc++-33
cronie
crontabs
crypto-utils
cvs
dos2unix
dropwatch
dstat
dtach
elinks
emacs-nox
expect
file
fipscheck
gdb
git
gnutls-utils
hardlink
hp-health
hp-scripting-tools
hp-snmp-agents
hpacucli
hponcfg
httpd-tools
iotop
iproute
iptraf
iputils
jwhois
kernel
ksh
lftp
libxml2
libxslt
lm_sensors
logrotate
lslk
lsof
lsscsi
ltrace
m2crypto
mailcap
make
man
man-pages
man-pages-overrides
mcelog
mcollective
mcollective-common
mgetty
microcode_ctl
mlocate
nc
net-snmp
net-snmp-utils
nfs-utils
nmap
nss-tools
ntp
numactl
openssh
openssh-clients
openssh-server
openssl
openssl098e
patch
patchutils
pax
pciutils
perf
perl
pinfo
powertop
psacct
psmisc
puppet
rng-tools
rsync
rsyslog
ruby
ruby-irb
screen
sendmail
setools-console
strace
sudo
symlinks
sysfsutils
sysstat
tcl
tcp_wrappers
tcpdump
telnet
time
traceroute
tree
tuned
tuned-utils
units
unix2dos
unzip
vim-enhanced
wget
which
words
x86info
xinetd
yum
yum-plugin-changelog
yum-plugin-downloadonly
yum-plugin-tmprepo
yum-plugin-verify
yum-plugin-versionlock
yum-utils
zip
zsh

<%= section_end -%>

<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
<%= section_end -%>
<% end -%>

%post --nochroot
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....

/usr/bin/chvt 3
(
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
<%= section_end -%>

%post
logger "Starting anaconda <%= @host %> postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on....
/usr/bin/chvt 3
(
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
<%= snippet 'kickstart_networking_setup' %>
<% end -%>

#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] || 'ntp1.sjc.collab.net' %>
/usr/sbin/hwclock --systohc

# update all the base packages from the updates repository
#yum -t -y -e 0 update

# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on

sync

# Inform the build system that we are done.
echo "Informing Foreman that we are built"
wget -q -O /dev/null --no-check-certificate <%= kicker.sjc.collab.net %>
) 2>&1 | tee /root/install.post.log
exit 0
#<%= section_end -%>

Specify preseed live-installer squashfs path if using iso repos

When installing Ubuntu 14.04+ from an iso copied to an http mirror the installer will fail while attempting to locate the live-installer. This appears to be a bug in the installation media where the path to the installer is set to a path that does not exist when netbooted. This can be addressed by specifying d-i live-installer/net-image string http://<%= @preseed_server %><%= @preseed_path %>/install/filesystem.squashfs in the preseed config.

See:

UserData default is lacking in features

The default cloud init template does not do the following that all the other templates seem to do:

  • Install an automation tool (puppet/chef/salt)
  • Patch the system (yum or apt)
  • reboot

In addition, it creates an admin account with a password, which is against standard best practices in cloud providers.
Read the section under passwd: http://cloudinit.readthedocs.io/en/latest/topics/examples.html#including-users-and-groups
Remember user data can be seen by anyone, for example EC2 stores this with the instance for later editing/reference.

Is this intentional?
Would you take a PR that attempts to solve all of these?
I have been working up a template in our environment that seems to work on CentOS/Fedora/Debain/Ubuntu.

Unable to login in Ubuntu 16.04 after provisioning

After provisioning a bare-metal server on my network with the default preseed template, I am unable to connect through SSH.
I try to connect to root@my_ip and after writing my password, I get a Permission denied, please try again.

So I tried to edit the template to put an unsecure (but clear) username:password couple (like "root:toor"), but even there, same error.
I'm pretty sure I miss something but, I'm not a sysadmin :) there is my generated template:

# Locale
d-i debian-installer/locale string en_US
# country and keyboard settings are automatic. Keep them ...
# ... for wheezy and newer:
d-i keyboard-configuration/xkb-keymap seen true

# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string server-b.curty.lan
d-i netcfg/get_domain string curty.lan
d-i netcfg/wireless_wep string

d-i hw-detect/load_firmware boolean true

# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string archive.ubuntu.com:80
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
d-i mirror/codename string xenial
d-i mirror/suite string xenial
d-i mirror/udeb/suite string xenial

# Time settings
d-i clock-setup/utc boolean true
d-i time/zone string UTC

# NTP
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string 0.debian.pool.ntp.org

# Set alignment for automatic partitioning
# Choices: cylinder, minimal, optimal
#d-i partman/alignment select cylinder



# Use the first detected hard disk as default installation disk
d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"

### Partitioning
# The presently available methods are: "regular", "lvm" and "crypto"
d-i partman-auto/method string lvm

# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true

# For LVM partitioning, you can select how much of the volume group to use
# for logical volumes.
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string vg00

# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:   separate /home partition
# - multi:  separate /home, /var, and /tmp partitions (/usr was removed in jessie)
d-i partman-auto/choose_recipe select multi

# If you just want to change the default filesystem to something
# else, you can do that without providing a full recipe.

# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

# Root account
# Skip creation of a root account (normal user account will be able to use sudo).
#user-setup-udeb passwd/root-login boolean true
d-i passwd/root-login boolean true
# Alternatively, to skip creation of a normal user account.
#user-setup-udeb passwd/make-user boolean false
d-i passwd/make-user boolean false

# Root password in clear text
d-i passwd/root-password password toor
d-i passwd/root-password-again password toor
#d-i passwd/root-password-crypted password $6$3chKRL4+$Lc9qj/mgyoUDczVopuSsf3WX0JyzzC65AQzEhBITK[...]

# User account
d-i passwd/user-fullname string Ubuntu User
d-i passwd/username string ubuntu
d-i passwd/user-password-crypted password $6$3chKRL4+$Lc9qj/mgyoUDczVopuSsf3WX0JyzzC65AQzEhBITK[...]
d-i passwd/user-uid string 1010
d-i user-setup/allow-password-weak boolean true

# enable shadow passwords
d-i passwd/shadow boolean true

# Install minimal task set (see tasksel --task-packages minimal)
#tasksel tasksel/first multiselect minimal, ssh-server, openssh-server
tasksel tasksel/first multiselect ubuntu-server, openssh-server

# Install some base packages
d-i pkgsel/include string  lsb-release
d-i pkgsel/update-policy select unattended-upgrades
d-i pkgsel/upgrade select none

popularity-contest popularity-contest/participate boolean false

# Boot loader settings
#grub-pc grub-pc/hidden_timeout boolean false
#grub-pc grub-pc/timeout string 10
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev string default
d-i finish-install/reboot_in_progress note

d-i preseed/late_command string wget -Y off http://10.0.155.12/unattended/finish -O /target/tmp/finish.sh && in-target chmod +x /tmp/finish.sh && in-target /tmp/finish.sh

Thanks for your help.

Add epel url for rhel 7

Currently the epel snippet does not add epel for rhel 7.

The repository structure changed for version 7:
http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm

Note the /e/ in the url.

How should we properly add the epel url for rhel 7? Overwrite epel_url when '7'?

dynamic partitioning template

For RHEL 6, looking for dynamic partitioning template code that:

  • looks for a 40G and uses that disk to make a 500MB slice for /boot and makes the remainder a PV belonging to rootvg
  • looks for all 50G disks and makes them all PVs belonging to datavg

enable-puppetlabs-pc1-repo not honored on CentOS 7.3 install

When I set enable-puppetlabs-pc1-repo: 'true' (which is no boolean but works on Fedora installs) to a CentOS 7.3 install the repo is not added and there is still the Puppet 3.6.x version on CentOS 7.3

Is this a bug or what do I do wrong ?

Puppet service not started on Ubuntu

When provisioning an Ubuntu box (e.g. 17.04 Zesty) then the puppet service is not being started (enabled). This may be due to some code in provisioning_templates/snippet/puppet_setup.erb, which probably unsuccessfully tries to make this work for Ubuntu.

Specifically, facter never yields a value for neither os_name nor os_major, which are used in the if that tries to work around Puppet issues PA-136 and PUP-5577 (as quoted in the comment). Not sure if this observation points into the right direction.

On a fresh Ubuntu Zesty node the output of facter only contains two properties starting withos:

$ facter | grep ^os
os => {"name"=>"Ubuntu", "family"=>"Debian", "release"=>{"major"=>"17.04", "full"=>"17.04"}, "lsb"=>{"distcodename"=>"zesty", "distid"=>"Ubuntu", "distdescription"=>"Ubuntu 17.04", "distrelease"=>"17.04", "majdistrelease"=>"17.04"}}
osfamily => Debian

(Note: The node under test was rebooted twice after provisioning; once after the OS installation, as foreseen, and the second time after manually running service puppet start and a subsequent installation of software by the Puppet agent.)

Software being used/installed on a fresh node is:

$ puppet --version
4.8.2
$ facter --version
2.4.6

Is this problem already known?

Kickstart Finish Template "Puppet" Config Ignored?

Hello,

I have a Foreman/Puppet Server that works fine, I can provision and push changes but for some reason with the newly provisioned VMs for CentOS 7 the whole puppet configuration is skipped?

This template: community-templates/kickstart/finish.erb

According to this template it should be configuring Puppet but I haven't been able to get it to work. When I click on "preview" within Foreman/Templates it only shows this code:

# eno16777984 interface
real=`ip -o link | grep 00:50:56:8d:2a:42 | awk '{print $2;}' | sed s/:$//`

# ifcfg files are ignored by NM if their name contains colons so we convert colons to underscore
sanitized_real=$real

cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO="dhcp"
DEVICE="$real"
HWADDR="00:50:56:8d:2a:42"
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
EOF



service network restart






su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm'


#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub 0.fedora.pool.ntp.org
/usr/sbin/hwclock --systohc


# update all the base packages from the updates repository
yum -t -y -e 0 update


exit 0

So my question is, where is the Puppet configuration? Why does it skip it? This is for a CentOS 7 VM and the templates are part of the Operating Sytem's templates. Any idea?

Thanks a lot

Autoyast Template behind Proxy

Running template (provisioning template for SLES/Suse: e.g. provisioning_templates/provision/autoyast_sles_default.erb) without direct route to internet wont work.

I usually configure the base installation media using a local file server, but when it is about puppet installation e.g. the following part from template :
<add-on> <add_on_products config:type="list"> <% if puppet_enabled -%> <% if host_param_true?('enable-puppetlabs-pc1-repo') -%> <listentry> <media_url><![CDATA[http://yum.puppetlabs.com/sles/<%= os_major %>/PC1/<%= @host.architecture %>/]]></media_url> <name>puppet</name> ...
I would like to use the remote repository. I havent managed to access it, even when setting up a proxy
using xml <proxy>...</proxy>.

Is there a recommended way to run the provisioning template behind a proxy ?

Make the Template as my ks.cfg Why so complicated.

Hi All,

The defining the kickstart template is too complicated like programmatic way.

Compare to Normal Kickstart defining ks.cfg more easy than foreman.

There should be a options to upload the ks.cfg which should either convertible into template or else kc.cfg should work.

Add ZONE to a subnet

With firewalld, interfaces can be added to zones (eg. public, mgmt, private, docker, ...).

I assign zones to subnets (public vs private), and add ZONE=$the_zone to the network device configuration file (eg. /etc/sysconfig/network-scripts/ifcfg-eth0)

This means I don't need to tell firewalld separately about the mapping of interfaces to zones, it is automatically added by ifup.

The question is: should this ZONE parameter be a "native" field in the subnet editor, or should it be added as a custom parameter (in the "Parameters" tab)?

The second means no code changes at all; the first means we can use this in the installation templates...

There was an error rendering the Community Kickstart default PXELinux template: undefined local variable or method `template_name' for #

There was an error rendering the Community Kickstart default PXELinux template: undefined local variable or method `template_name' for #

There was an error during rendering, return to the Code tab to edit the template.

production.log

2016-09-30 10:08:38 [app] [I] Started POST "/templates/provisioning_templates/116-Community%20Kickstart%20default%20PXELinux/preview" for 172.31.100.214 at 2016-09-30 10:08:38 -0500
2016-09-30 10:08:39 [app] [I] Processing by ProvisioningTemplatesController#preview as */*
2016-09-30 10:08:39 [app] [I]   Parameters: {"template"=>"<%#\nkind: PXELinux\nname: Kickstart default PXELinux\noses:\n- CentOS\n- Fedora\n- RedHat\n-%>\n# This file was deployed via '<%= template_name %>' template\n\nTIMEOUT <%= @host.params['loader_timeout'] || 10 %>\nDEFAULT <%= template_name %>\n\nLABEL <%= template_name %>\n  KERNEL <%= @kernel %>\n  <% if @host.operatingsystem.name.match(/.*atomic.*/i) -%>\n  APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> repo=<%= @host.operatingsystem.medium_uri(@host) %> ks.device=bootif network ks.sendmac <%= pxe_kernel_options %>\n  <% elsif @host.operatingsystem.name == 'Fedora' and @host.operatingsystem.major.to_i > 16 -%>\n  APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> ks.device=bootif network ks.sendmac <%= pxe_kernel_options %>\n  <% elsif @host.operatingsystem.name != 'Fedora' and @host.operatingsystem.major.to_i >= 7 -%>\n  APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> network ks.sendmac <%= pxe_kernel_options %>\n  <% else -%>\n  APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> ksdevice=bootif network kssendmac <%= pxe_kernel_options %>\n  <% end -%>\n  IPAPPEND 2\n", "preview_host_id"=>"1997", "id"=>"116-Community Kickstart default PXELinux"}
2016-09-30 10:08:39 [app] [D] Setting current user thread-local variable to jsparrow
2016-09-30 10:08:39 [app] [W] Error rendering the Community Kickstart default PXELinux template
 | NameError: undefined local variable or method `template_name' for #<ProvisioningTemplatesController:0x007f7b6956e7d0>
 | (erb):2:in `render_safe'
 | /opt/rh/rh-ruby22/root/usr/share/ruby/erb.rb:863:in `eval'
 | /opt/rh/rh-ruby22/root/usr/share/ruby/erb.rb:863:in `result'
 | /usr/share/foreman/lib/foreman/renderer.rb:19:in `render_safe'
 | /usr/share/foreman/lib/foreman/renderer.rb:103:in `unattended_render'
 | /usr/share/foreman/app/controllers/templates_controller.rb:103:in `safe_render'
 | /usr/share/foreman/app/controllers/templates_controller.rb:95:in `preview'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/abstract_controller/base.rb:189:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/rendering.rb:10:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:299:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:299:in `block (2 levels) in halting'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rails-observers-0.1.2/lib/rails/observers/action_controller/caching/sweeping.rb:73:in `around'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:447:in `public_send'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:447:in `block in make_lambda'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:298:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:298:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:299:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:299:in `block (2 levels) in halting'
 | /usr/share/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:424:in `block in make_lambda'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:298:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:298:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:299:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:299:in `block (2 levels) in halting'
 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:424:in `block in make_lambda'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:298:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:298:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:229:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:299:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:299:in `block (2 levels) in halting'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rails-observers-0.1.2/lib/rails/observers/action_controller/caching/sweeping.rb:73:in `around'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:447:in `public_send'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:447:in `block in make_lambda'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:298:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:298:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `run_callbacks'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/abstract_controller/callbacks.rb:19:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/rescue.rb:29:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/notifications.rb:159:in `block in instrument'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/notifications.rb:159:in `instrument'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/abstract_controller/base.rb:136:in `process'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionview-4.1.5/lib/action_view/rendering.rb:30:in `process'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal.rb:196:in `dispatch'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal.rb:232:in `block in action'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:82:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:82:in `dispatch'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:50:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:71:in `block in call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:59:in `each'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/journey/router.rb:59:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/routing/route_set.rb:678:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.6/lib/apipie/static_dispatcher.rb:65:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.6/lib/apipie/extractor/recorder.rb:132:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/static.rb:64:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/static.rb:64:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/static.rb:64:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/static.rb:64:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/static.rb:64:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.6/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
 | /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/flash.rb:254:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/cookies.rb:560:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/query_cache.rb:36:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:82:in `run_callbacks'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/railties-4.1.5/lib/rails/rack/logger.rb:38:in `call_app'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/railties-4.1.5/lib/rails/rack/logger.rb:22:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/request_id.rb:21:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_dispatch/middleware/static.rb:64:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/railties-4.1.5/lib/rails/engine.rb:514:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/railties-4.1.5/lib/rails/application.rb:144:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/railties-4.1.5/lib/rails/railtie.rb:194:in `public_send'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/railties-4.1.5/lib/rails/railtie.rb:194:in `method_missing'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
 | /usr/lib/ruby/gems/1.8/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
 | /usr/lib/ruby/gems/1.8/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:160:in `accept_and_process_next_request'
 | /usr/lib/ruby/gems/1.8/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
 | /usr/lib/ruby/gems/1.8/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
 | /usr/lib/ruby/gems/1.8/gems/passenger-5.0.28/src/ruby_supportlib/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
2016-09-30 10:08:39 [app] [I]   Rendered text template (0.0ms)
2016-09-30 10:08:39 [app] [I] Completed 500 Internal Server Error in 36ms (Views: 0.5ms | ActiveRecord: 2.1ms)

template:

<%#
kind: PXELinux
name: Kickstart default PXELinux
oses:
- CentOS
- Fedora
- RedHat
-%>
# This file was deployed via '<%= template_name %>' template

TIMEOUT <%= @host.params['loader_timeout'] || 10 %>
DEFAULT <%= template_name %>

LABEL <%= template_name %>
  KERNEL <%= @kernel %>
  <% if @host.operatingsystem.name.match(/.*atomic.*/i) -%>
  APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> repo=<%= @host.operatingsystem.medium_uri(@host) %> ks.device=bootif network ks.sendmac <%= pxe_kernel_options %>
  <% elsif @host.operatingsystem.name == 'Fedora' and @host.operatingsystem.major.to_i > 16 -%>
  APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> ks.device=bootif network ks.sendmac <%= pxe_kernel_options %>
  <% elsif @host.operatingsystem.name != 'Fedora' and @host.operatingsystem.major.to_i >= 7 -%>
  APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> network ks.sendmac <%= pxe_kernel_options %>
  <% else -%>
  APPEND initrd=<%= @initrd %> ks=<%= foreman_url('provision') %> ksdevice=bootif network kssendmac <%= pxe_kernel_options %>
  <% end -%>
  IPAPPEND 2

Community template for OpenSuSE Leap 42 AutoYast?

Has anyone tried OpenSuSE Leap 42 with our existing AutoYast templates? Does it work ok? If not, what are some of the gotchas? I plan on making an initial deployment this week and hope to get a heads up on any issues I may run into. Thanks!

network config in CoreOS cloudconfig snippet is too generic

Unit:

- name: down-interfaces.service
            command: start
            content: |
              [Service]
              Type=oneshot
              ExecStart=/usr/bin/bash -c 'for i in $(/usr/bin/ls /sys/class/net/); do [ $i == "lo" ] || (/usr/bin/ip link set $i down; /usr/bin/ip addr flush dev $i); done'
          - name: systemd-networkd.service
command: restart

(used to reset interfaces when static IP is used) is too generic, only 'lo' is excluded and it sets down/flushes also Docker interfaces (docker0, vethXXX., ...).

Another 'logic' is needed. I used a 'positive logic' and reset only ens* interfaces, but this is valid only for VMware VMs.

additional interfaces are absent in rendered template while using preseed_networking_setup

Steps to replicate:
In my case

  1. Created a VM with two network interfaces.
  2. used fdi version 3.0 to discover the VM booted via PXE
  3. initiated "Provision" of the new host
  4. in interface section the 2 interfaces are displayed
  5. both the interface were edited to relevant value.
  6. provisioning form was submitted.

the YAML in the host screen reads below and there is no reference to the additional interface.


---
classes: {}
parameters:
  puppetmaster: foremanserver.XXXXXXXXXXXXX.com
  domainname: ''
  hostgroup: Provision from foremanserver.XXXXXXXXX.com
  root_pw: "$5$z5OS7cOG$SOXTFKS42JDGVTMb11SxBcHMm0G9lRHNiZLWOBmowR."
  puppet_ca: foremanserver.XXXXXXXXXXX.com
  foreman_env: production
  owner_name: Admin User
  owner_email: [email protected]
  foreman_subnets:
  - network: 172.16.0.0
    mask: 255.255.0.0
    name: adminpxe
    vlanid: ''
    gateway: 172.16.10.1
    dns_primary: 172.16.10.2
    dns_secondary: ''
    from: 172.16.10.20
    to: 172.16.10.250
    boot_mode: DHCP
    ipam: DHCP
  foreman_interfaces:
  - mac: 52:54:00:f1:8a:5b
    ip: 172.16.10.128
    type: Interface
    name: mac525400f18a5b.XXXXXXXXXX.com
    attrs:
      network: 172.16.0.0
      netmask: 255.255.0.0
      mtu: '1500'
    virtual: false
    link: true
    identifier: eth0
    managed: true
    primary: true
    provision: true
    subnet:
      network: 172.16.0.0
      mask: 255.255.0.0
      name: adminpxe
      vlanid: ''
      gateway: 172.16.10.1
      dns_primary: 172.16.10.2
      dns_secondary: ''
      from: 172.16.10.20
      to: 172.16.10.250
      boot_mode: DHCP
      ipam: DHCP
  - mac: 52:54:00:43:8d:72
    ip: 
    type: Interface
    name: ''
    attrs:
      mtu: '1500'
    virtual: false
    link: true
    identifier: eth1
    managed: false
    primary: false
    provision: false
    subnet:
      network: 172.16.0.0
      mask: 255.255.0.0
      name: adminpxe
      vlanid: ''
      gateway: 172.16.10.1
      dns_primary: 172.16.10.2
      dns_secondary: ''
      from: 172.16.10.20
      to: 172.16.10.250
      boot_mode: DHCP
      ipam: DHCP
  http-proxy: foremanserver.XXXXXXXXXXX.com
  http-proxy-port: '3128'
environment: production

Add templates for all OSes, maybe?

The Foreman is nice, but setting up machines for the first time is a bit of a hack in the user interface.

The "Create Operating System" dialog in Hosts > Operating systems can't be filled in in a single pass. You have to:

  1. first create a OS (fill in first 3 tabs), and save it
  2. then go to the Hosts > Provisioning templates and associate them (minimum 3, e.g. the "default", "default finish" and "default PXELinux") with the newly created OS
  3. then go back to your OS in Hosts > Operating systems , and fill in tab 4 (the templates) -- which feels dumb in our case since there is only a single choice for each combo box, by the way
  4. then go to Hosts > Architectures, and add the OS to your target architectures.

The situation would be a lot better if there were "Operating systems" already set up in the Hosts menu. The typical values for all supported OSes would do it. You could then adapt or delete them at your liking.

Is there a reason why this has not been done up to the present?

(Is this something that has to happen in another project or repository, not this one?)

kickstart_default.erb => needs local mirror updates

This file needs updates so we can simply use the mediapath without the --url url= part for our local repo's.

In this case it also needs updates for Fedora Server as redhat-lsb-core is not in there and we need a fix for group ignore when you add a local updates repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.