same error today. yesterday everything was fine and working. i could deploy
an image for the first time with userdata plugin. today
*Unable to save *
- Render user data template for alton-tibbals.1000.local task failed with
the following error: ERF22-1307 [Foreman::Renderer::SyntaxError]: Syntax
error occurred while parsing the template Unnamed, make sure you have all
ERB tags properly closed and the Ruby syntax is valid. The Ruby error:
(string):86 :: parse error on value "<" (tLT)
nothing has changed in the code...
and here are the scripts: not that it matters what in them because i could
write something something in it and it would throw that error again.
since i dont want to go back on my backups and redo everything .. a
solution would be prefered as you can understand.
--------------------
<%#
kind: user_data
name: 1_user
oses:
- CentOS 6
- CentOS 7
- Fedora 19
- Fedora 20
- Fedora 21
- Fedora 22
- Fedora 23
-%>
#cloud-config
hostname: <%= @host.shortname %>
fqdn: <%= @host %>
manage_etc_hosts: true
groups:
- admin
users:
- default
- name: admin
primary-group: admin
groups: users
shell: /bin/bash
sudo: ['ALL=(ALL) ALL']
lock-passwd: false
passwd: <%= @host.root_pass %>
identity:
LinuxPrep:
domain: <%= @host.domain %>
hostName: <%= @host.shortname%>
hwClockUTC: true
timeZone: <%= @host.params['time-zone'] || 'UTC' %>
globalIPSettings:
dnsSuffixList: [<%= @host.domain %>]
<% interface = @host.interfaces.first %>
nicSettingMap:
- adapter:
dnsDomain: <%= interface.domain %>
dnsServerList: [<%= interface.subnet.dns_primary %>, <%=
interface.subnet.dns_secondary %>]
gateway: [<%= interface.subnet.gateway %>]
ip: <%= interface.ip %>
subnetMask: <%= interface.subnet.mask %>
write_files:
- path: /tmp/foreman-userdata.sh
permissions: '0755'
content: |
#!/bin/bash
yum -t -y -e 0 update
<%= indent(7) { snippet('1_subscription_manager_registration') } %>
<%= indent(7) { snippet('1_puppet_setup') } %>
runcmd:
- [ cloud-init-per, once, foreman-userdata, /tmp/foreman-userdata.sh ]
phone_home:
url: <%= foreman_url('built') %>
post: []
tries: 10
-------------------------------------
/usr/bin/yum -t -y -e 0 install subscription-manager
/usr/bin/rpm -ivh <%= subscription_manager_configuration_url(@host) %>
/usr/bin/echo "Registering the System"
/usr/sbin/subscription-manager register --org="<%=
@host.rhsm_organization_label %>" --name="<%= @host.name %>"
--activationkey="<%= @host.params['kt_activation_keys'] %>"
/usr/bin/yum -t -y -e 0 install katello-agent
/usr/sbin/chkconfig goferd on
-------------------------------------
<%#
kind: snippet
name: 1_puppet_setup
description: this snippet will configure the Puppet agent
%>
<%
os_family = @host.operatingsystem.family
os_major = @host.operatingsystem.major.to_i
os_name = @host.operatingsystem.name
linux_package = 'puppet-agent'
etc_path = '/etc/puppetlabs/puppet'
bin_path = '/opt/puppetlabs/puppet/bin'
%>
/usr/bin/yum -t -y install <%= linux_package %>
cat > <%= etc_path %>/puppet.conf << EOF
<%= snippet 'puppet.conf' %>
EOF
puppet_unit=puppet
/usr/bin/systemctl enable ${puppet_unit}
/sbin/chkconfig --level 345 puppet on
<%= bin_path %>/puppet resource service puppet enable=true
<%= bin_path %>/puppet resource service puppet ensure=running
----------------------------
<%#
kind: snippet
name: 1_puppet.conf
%>
<%
os_family = @host.operatingsystem.family
os_name = @host.operatingsystem.name
var_dir = '/opt/puppetlabs/puppet/cache'
log_dir = '/var/log/puppetlabs/puppet'
run_dir = '/var/run/puppetlabs'
ssl_dir = '/etc/puppetlabs/puppet/ssl'
%>
[main]
<%- unless @host.params['dns_alt_names'].to_s.empty? -%>
dns_alt_names = <%= @host.params['dns_alt_names'] %>
<%- end -%>
vardir = <%= var_dir %>
logdir = <%= log_dir %>
rundir = <%= run_dir %>
ssldir = <%= ssl_dir %>
[agent]
pluginsync = true
report = true
ignoreschedules = true
ca_server = <%= @host.puppet_ca_server %>
certname = <%= @host.certname %>
environment = <%= @host.environment %>
server = <%= @host.puppetmaster %>
--
You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.