Creating Windows MSI for puppet agent

79 views
Skip to first unread message

Puppeteer

unread,
Jun 4, 2015, 8:07:58 AM6/4/15
to puppet...@googlegroups.com
Hi,

I want to create a custom MSI for the puppet agent. Can someone guide me on this.
I tried using puppetlabs/puppet_for_the_win but was not successful.

I used the command:
rake windows:build AGENT_VERSION_STRING=1.0.0 CONFIG=foss-4.1-x86.yaml

I get the following error:

curl -O http://builds.puppetlabs.lan/facter/9586d5cd1ee6c18e88506a8f4a8b12f2ee51
d154/artifacts/windows//facter-2.4.3-1074-g9586d5c-x86.zip

curl: (6) Couldn't resolve host 'builds.puppetlabs.lan'
rake aborted!
Command failed with status (6): [curl -O http://builds.puppetlabs.lan/facte...]

Tasks: TOP => windows:msi => windows:wixobj => windows:wxs => windows:stage => w
indows:checkout => windows:clone
(See full trace by running task with --trace)

Thanks.

Melissa Stone

unread,
Jun 4, 2015, 12:34:22 PM6/4/15
to puppet...@googlegroups.com
On Thu, Jun 4, 2015 at 1:05 AM, Puppeteer <kdeep...@gmail.com> wrote:
Hi,

I want to create a custom MSI for the puppet agent. Can someone guide me on this.
I tried using puppetlabs/puppet_for_the_win but was not successful.

Hey!

Unfortunately, we have yet to streamline this process for external use. You can still roll your own native facter build though. You'll want to use the script at https://github.com/puppetlabs/facter/blob/master/contrib/facter.ps1. You need to run the script on probably a windows 2012 box (64 bit), and I would strongly suggest reviewing the script to ensure that we don't do anything that's going to mess you up. It's meant to be run on a disposable box.

After that builds, we collect all the built bits and library dependencies into the zip archive that the automation in puppet_for_the_win looks for. We don't have that automation in a public space, but here's a summary of what goes into that archive. This assumes you're building 64 bit, so if you're building for a 32 bit machine, you'll have to modify it.

# Move all necessary dll's into facter bindir
"cp /cygdrive/c/tools/mingw64/bin/libgcc_s_seh-1.dll /cygdrive/c/tools/mingw64/bin/libstdc++-6.dll /cygdrive/c/tools/mingw64/bin/libwinpthread-1.dll /home/Administrator/facter/release/bin/"

# Format everything to prepare to archive it
"mkdir -p /home/Administrator/archive/lib ; cp -r /home/Administrator/facter/release/bin /home/Administrator/facter/lib/inc /home/Administrator/archive/ ; cp /home/Administrator/facter/release/lib/facter.rb /home/Administrator/archive/lib/"

# Zip up the built archives
"7za.exe a -r -tzip facter.zip 'C:\\cygwin64\\home\\Administrator\\archive\\*'\"

Once you have that archive, you can modify the config file you're using to point to where that archive can be found. That *should* let the automation in puppet_for_the_win work.

Let me know how that goes!
 

I used the command:
rake windows:build AGENT_VERSION_STRING=1.0.0 CONFIG=foss-4.1-x86.yaml

I get the following error:

curl -O http://builds.puppetlabs.lan/facter/9586d5cd1ee6c18e88506a8f4a8b12f2ee51
d154/artifacts/windows//facter-2.4.3-1074-g9586d5c-x86.zip

curl: (6) Couldn't resolve host 'builds.puppetlabs.lan'
rake aborted!
Command failed with status (6): [curl -O http://builds.puppetlabs.lan/facte...]

Tasks: TOP => windows:msi => windows:wixobj => windows:wxs => windows:stage => w
indows:checkout => windows:clone
(See full trace by running task with --trace)

Thanks.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d759891a-e50b-4553-a36f-3416f39a88c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Melissa Stone
Release Engineer, Puppet Labs
--------------------------------------------------

PuppetConf 2015 is coming to Portland, Oregon! Join us October 5-9.
Register now to take advantage of the Early Adopter discount save $349!

Puppeteer

unread,
Jun 8, 2015, 3:00:31 AM6/8/15
to puppet...@googlegroups.com
Hi Melissa,

Thanks for you response. That is something that I will look into (pretty new to all these things).

I got the puppet_for_the_win working by modifying foss-stable.yaml by including the following lines from foss-4.0-x86.yaml:
  mcollective:
    :ref: 2.8.1
    :repo: git://github.com/puppetlabs/marionette-collective.git

After including the above lines I was able to build the MSI and install it. However the Puppet service does not start. I have attached the message I get on starting the service. I did not find any logs in the "c:\ProgramData\puppet" folder or in the event viewer. Any idea why the service is not starting?

Regards,
Deepak.
PuppetSrvcError.PNG

Rob Reynolds

unread,
Jun 8, 2015, 3:24:10 PM6/8/15
to puppet...@googlegroups.com
On Mon, Jun 8, 2015 at 2:00 AM, Puppeteer <kdeep...@gmail.com> wrote:
Hi Melissa,

Thanks for you response. That is something that I will look into (pretty new to all these things).

I got the puppet_for_the_win working by modifying foss-stable.yaml by including the following lines from foss-4.0-x86.yaml:
  mcollective:
    :ref: 2.8.1
    :repo: git://github.com/puppetlabs/marionette-collective.git

After including the above lines I was able to build the MSI and install it. However the Puppet service does not start. I have attached the message I get on starting the service. I did not find any logs in the "c:\ProgramData\puppet" folder or in the event viewer. Any idea why the service is not starting?

From the image, I would suggest attempting to run puppet by hand and see what you get. It's likely something is missing that Puppet expects to be there for the service.

You can also look in the Application Event Log to see what Puppet may have failed with.
 

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



--
Rob Reynolds
Developer, Puppet Labs

Puppeteer

unread,
Jun 9, 2015, 2:15:26 AM6/9/15
to puppet...@googlegroups.com
Hi Rob,

The application event log does not have any information with respect to Puppet. There is no log named Puppet. Also when I run the agent from the command I get the following message:
"cannot load such file -- facter".
 I have attached the screenshot.

Regards,
Deepak.
Capture.PNG

Rob Reynolds

unread,
Jun 10, 2015, 11:22:31 AM6/10/15
to puppet...@googlegroups.com
On Tue, Jun 9, 2015 at 1:15 AM, Puppeteer <kdeep...@gmail.com> wrote:
Hi Rob,

The application event log does not have any information with respect to Puppet. There is no log named Puppet.

I was specifically talking about Application event log and source being Puppet.
Inline image 1



 
Also when I run the agent from the command I get the following message:
"cannot load such file -- facter".

This actually tells me exactly what is wrong, that facter section in the YAML is only going to get you the source of Facter and you need to compile it, because you still need Facter to run Puppet. You should follow the instructions that Melissa gave you to move things along. Alternatively if you look at some of the older yamls, you may be able to determine how to use the older ruby facter instead. For instance, take a look at https://github.com/puppetlabs/puppet_for_the_win/blob/master/foss-3.7-x64.yaml
 

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages