running puppet apply during kickstart preseed in ubuntu

79 views
Skip to first unread message

Free4All User

unread,
Jun 12, 2017, 8:55:45 AM6/12/17
to Puppet Users
Hello,

I have a very annoying problem.

I have created an automated ubuntu installation (preseed method) incl. kickstart config.
After the basic installation is done, i would like to apply a small file
puppet apply install.pp

I tried this in the post section, but it did not help.

Any sugestion how i can get this solved?

We are not planning to get a puppet master in use - it should be used only one time for this to make sure
that all packages that we need will be installed through this way.

I know it would be easier to just add all packages in the
%post section but our company is looking for this solution.

Thanks in advance!

Kr


Peter Faller

unread,
Jun 12, 2017, 9:41:17 AM6/12/17
to Puppet Users
A few questions ... :
- does your kickstart successfully install the Puppet agent package?
- are you running 'puppet apply' with the correct $PATH (or with a full path to the puppet executable)?
- what errors are reported by your %post script?

On Monday, 12 June 2017 14:55:45 UTC+2, Free4All User wrote:
...

Free4All User

unread,
Jun 12, 2017, 10:23:38 AM6/12/17
to Puppet Users
Hello Peter,

Puppet is getting installed in the
%post section of the ks.cfg file
the whole procedure is running til the end - but after i login into ubuntu, nothing of the packages from the install.pp file is on the system.
what would be the $PATH (target system?) to enter this and if so where int he ks.cfg file?

here is a view on how that ks.cfg looks at the end:

%post
#!/bin/bash
apt-get install -y git openssh-server minicom
apt-get install -y puppet
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
sudo puppet-agent --enable
sudo puppet-agent apply /cdrom/puppet/install.pp
%end

Peter Faller

unread,
Jun 13, 2017, 3:26:39 AM6/13/17
to Puppet Users


Even if the puppet-agent package is installed, the location of the puppet  executable won't be in the PATH environment variable. What you probably need is to change it to e.g.:

/opt/puppetlabs/bin/puppet apply /cdrom/puppet/install.pp

Free4All User

unread,
Jun 13, 2017, 3:32:55 AM6/13/17
to puppet...@googlegroups.com
and this will work during kickstart?

--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/RaeSvEWCD7A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/11cde4d9-9fd1-41d1-bca9-08c4b60b3524%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Free4All User

unread,
Jun 13, 2017, 5:09:51 AM6/13/17
to puppet...@googlegroups.com
I have modified and also checked via which puppet
where actually puppet is installed
/usr/bin/puppet apply /cdrom/puppet/install.pp

it still does not work. Also as it is during the installation procedure can the mount point of the automated formated drive
but not sure how i could sort this out during the procedure.

Peter Faller

unread,
Jun 13, 2017, 9:05:06 AM6/13/17
to Puppet Users
I've only used kickstart for RedHat and CentOS; but I believe it is almost the same for Ubuntu. What I would suggest is that you catch the output of the %post script like this:

%post --log=/root/ks-post.log
...
%end

... and then include lots of 'echo' commands to debug.

By the time %post runs, your installation target should be mounted as '/'; so /usr/bin/puppet should exist. Might be wortwhile adding some 'ls' commands in your %post script to verify.

On Tuesday, 13 June 2017 11:09:51 UTC+2, Free4All User wrote:
I have modified and also checked via which puppet...

Free4All User

unread,
Jun 13, 2017, 9:35:49 AM6/13/17
to puppet...@googlegroups.com
Hello Peter,

in the end i found the right path on the volume out during troubleshooting the kickstart by adding before the puppet part get executed (puppet apply...) a sleep 100
and went trough this via ALT+F2 and ALT+F4 (to view what happens in the backround)
I sorted out that the mount point in ubuntu during kicktstart for the volume is
/target

and after all i sorted out and now this is working this way

/usr/bin/puppet apply /media/cdrom/puppet/install.pp

Thanks for your hint at the far beginning but in the end that brought me onward in rethinking the way how to do it.

Small things can me sometimes very complicated ....

Kr





--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/RaeSvEWCD7A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users+unsubscribe@googlegroups.com.
screenshot.jpg
Reply all
Reply to author
Forward
0 new messages