theforeman / community-templates Goto Github PK
View Code? Open in Web Editor NEWA place to share templates for various OSes for Foreman's provisioning
License: GNU General Public License v3.0
A place to share templates for various OSes for Foreman's provisioning
License: GNU General Public License v3.0
since the merge of #212
debconf-set-selections
showing Cannot find a question for console-keymaps-at/keymap
error when running preseed/provision.erb
against newer os. The console-keymaps-at/keymap
was removed from wheezy and newer per https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681801.
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 ?
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...
I am doing some work on windows specific user data templates for EC2 and VSphere.
Are we open to having these in this repo?
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.
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:
https://github.com/theforeman/community-templates/blob/develop/kickstart/README.md could do with an update to explain what the various kickstart files are for. It's not been updated in several years.
For instance, I think the main difference between provision.erb
and provision_rhel.erb
is that the latter includes the redhat_register
snippet. Some clarification in the README would help template users as well as anyone wishing to submit improvements.
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 -%>
even though the rendered template shows a static network configuration, /etc/network/interface is configured as dhcp after reboot.
It seems that something goes wrong in the finish template or so. I actually doubt something it wrong but Ubuntu 17.04 fails on "Unable to locate package puppet"
Anyone an idea ? Apt-get update is runned.
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'
?
This is needed so we could reuse the template in theforeman/foreman_discovery#265
PR will follow shortly
Debian based oses have an option to immediately install security updates post preseed installation. It would be great to specify this as a host param.
https://help.ubuntu.com/lts/installation-guide/amd64/apbs04.html#preseed-pkgsel
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.
selinux
is the name of a core fact. We don't want to be overriding it when foreman acts as an ENC.
http://projects.theforeman.org/issues/15500
Since theforeman/safemode#23, the default kickstart template doesn't resolve.
The error is
Safemode doesn't allow to access 'block_pass' on &:present?
Looks like this line needs updating. There may be other templates that also need fixing.
The iPXE static script in #44 when running on Ubuntu 12.04 raises an interactive prompt.
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:
eth0
: v4, dhcpeth0
): v4 (dhcp address)eth0
eth0
will have a (static) v6 address, no v4 addresseth0
(other interfaces probably still have a v4 address)I found no way to model the subnet for eth0
. Any tips?
Hi guys,
Should the _networking_setup.erb files not use the systemd link way ?
Please comment on this.
Thanks,
Matt
The alterator provision template should use the root password hash provided in Foreman and not have "123" hardcoded as a root password, if possible.
But it can be worked around by including the file in in PXEGrub2 global default template.
Does #393 look OK to you?
I'm not sure how to create filter for Debian based proxy only.
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']
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
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
The default cloud init template does not do the following that all the other templates seem to do:
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.
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.
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.
It appears that the preseed/provision.erb
template has a typo.
d-i passwd passwd/make-user boolean false
fails validation checks and should be set as d-i passwd/make-user boolean false
.
The syntax is also reflected in both the Debian and Ubuntu example preseed files:
For RHEL 6, looking for dynamic partitioning template code that:
Once Foreman 1.5 is out and users had time to upgrade, we can make use of these two new functions that has been added in theforeman/foreman#1178 (Foreman 1.4 release).
Templates will be cleaner a bit and will allow users to "redefine" snippets with their own separate templates.
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!
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.
Steps to replicate:
In my case
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
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.
Lots of templates configure the Puppet agent and set it to start at boot. This should be refactored into a snippet.
as topic says with fedora 18 it does not install facter and net-tools , easy fix but easilly caught in this template.
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?
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:
Hosts > Provisioning templates
and associate them (minimum 3, e.g. the "default", "default finish" and "default PXELinux") with the newly created OSHosts > 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 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?)
I am using user-data templates on ec2 and @host.otp is not populated.
In the first case the value is simply blank, but when I get the user-data using curl the otp is there. This is on foreman 1. 7
My workaround: http://pastie.org/10063791
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?
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:
When tokens are enabled, appending ?static=yes to the URL needs to be changed to & as it's appending a parameter.
We should apply this fix to all files:
https://github.com/theforeman/community-templates/pull/44/files#diff-d8f84c1aef76700b3e72dee8e2a80641R16
Currently, the preseed templates do not have travis tests. I see that this was mentioned in a couple tickets a few years ago
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 ?
A networking setup snippet is required for preseed OSes that can configure interfaces either inside the main preseed configuration, or be called from a finish script.
Here's the kickstart version for reference: https://github.com/theforeman/community-templates/blob/master/snippets/kickstart_networking_setup.erb
Alternatively, we could combine them into something more cross-platform such as netcf (http://projects.theforeman.org/issues/7460).
cloud-config is now deprecated, Ignition is the official configuration tool.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.