puppet agent upgrade on windows

151 views
Skip to first unread message

Jason Chinsen

unread,
Dec 3, 2014, 3:43:36 PM12/3/14
to puppet...@googlegroups.com
Hello There,

We started our puppet adventures at 3.2.x with both windows and linux boxes. Since then we have upgraded our Master to 3.3.2 and are looking to upgrade to 3.7. The linux agent upgrades are very simple, but I am running into issues with the windows agent upgrades :/ We have an Artifcatory based Nuget repo and all of the pipping is working. It looks like chocolatey is running an upgrade and it is not working. (it could very well be my nuget code :) as I am not a windows guy)


This is the output of the puppet run:
Debug: Executing 'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd update pe-agent -source nuget-repo';

Notice: /Stage[main]/Puppet_enterprise_agent_upgrade/Package[pe-agent]/ensure: created

Debug: /Stage[main]/Puppet_enterprise_agent_upgrade/Package[pe-agent]: The container Class[Puppet_enterprise_agent_upgrade] will propagate my refresh event


And this is the output of the chocolatey run manually:

C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd update pe-agent -source nuget-repo

Nothing to update.


When I run an install vs upgrade it works as planned, with one lingering affect, where puppet tries to change 3.3.2 to latest all the time (this I can likely fix in the puppet manifest with a version number vs latest)
Debug: Executing 'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd upd
ate pe-agent  -source nuget-repo'
Notice: /Stage[main]/Puppet_enterprise_agent_upgrade/Package[pe-agent]/ensure: e
nsure changed '3.3.2' to 'latest'
Debug: /Package[pe-agent]: The container Class[Puppet_enterprise_agent_upgrade]
will propagate my refresh event


Any help would be great
Thanks,
Jason.

Rob Reynolds

unread,
Dec 5, 2014, 6:04:05 PM12/5/14
to puppet...@googlegroups.com
On Wed, Dec 3, 2014 at 9:43 AM, Jason Chinsen <onz...@gmail.com> wrote:
Hello There,

We started our puppet adventures at 3.2.x with both windows and linux boxes. Since then we have upgraded our Master to 3.3.2 and are looking to upgrade to 3.7. The linux agent upgrades are very simple, but I am running into issues with the windows agent upgrades :/ We have an Artifcatory based Nuget repo and all of the pipping is working. It looks like chocolatey is running an upgrade and it is not working. (it could very well be my nuget code :) as I am not a windows guy)

Trying to upgrade Puppet with Puppet on Windows is harder because Windows locks files that are in use instead of letting you replace them in place. 

There is a module from OpenTable (puppetversion[1]) that may need some work to support the upgrade of PE agents as well, but it does a good job of upgrading out of band.

 


This is the output of the puppet run:
Debug: Executing 'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd update pe-agent -source nuget-repo';

Notice: /Stage[main]/Puppet_enterprise_agent_upgrade/Package[pe-agent]/ensure: created

Debug: /Stage[main]/Puppet_enterprise_agent_upgrade/Package[pe-agent]: The container Class[Puppet_enterprise_agent_upgrade] will propagate my refresh event


And this is the output of the chocolatey run manually:

C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd update pe-agent -source nuget-repo

Nothing to update.



Use -force. It may think things are good to go as it didn't detect errors.
 
When I run an install vs upgrade it works as planned, with one lingering affect, where puppet tries to change 3.3.2 to latest all the time (this I can likely fix in the puppet manifest with a version number vs latest)
Debug: Executing 'C:\ProgramData\chocolatey\chocolateyInstall\chocolatey.cmd upd
ate pe-agent  -source nuget-repo'
Notice: /Stage[main]/Puppet_enterprise_agent_upgrade/Package[pe-agent]/ensure: e
nsure changed '3.3.2' to 'latest'
Debug: /Package[pe-agent]: The container Class[Puppet_enterprise_agent_upgrade]
will propagate my refresh event



This could be an issue with the provider itself. Would you follow up with a note on puppet-chocolatey[2]?


 
Any help would be great
Thanks,
Jason.

--
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/8be76ca0-4b98-494d-834a-2c910be423bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Rob Reynolds
Developer, Puppet Labs

Join us at PuppetConf 2015, October 5-9 in Portland, OR - http://2015.puppetconf.com/
Register early to save 40%!

Jason Chinsen

unread,
Dec 8, 2014, 2:27:26 PM12/8/14
to puppet...@googlegroups.com
Hello Rob

Thanks for the response. I will take a look at OpenTable's module for sure. I will also add -force on to my install line

For the third part, we ran into another issue, and I am not sure if this is spelled out any where but we pass in the version 3.3.2 vs latest and most of our servers didn't have .net 4.0 and above and we were getting errors on these servers along the lines of "chocolatey cannot parse the parameters with out .net 4.0 or higher"

Thanks again,
Jason.

Dirk Heinrichs

unread,
Dec 8, 2014, 2:32:26 PM12/8/14
to puppet...@googlegroups.com
Am 05.12.2014 um 19:03 schrieb Rob Reynolds:

Trying to upgrade Puppet with Puppet on Windows is harder because Windows locks files that are in use instead of letting you replace them in place. 

That's not true. Upgrading Puppet with Puppet on Windows works just fine. Downgrade is a different story, depending on the versions involved. I've alread done upgrades from 3.2.1 to 3.4.3 and I'm currently in the process of upgrading ~150 Windows agents from 3.4.3 (32bit) to 3.7.3 (64bit) and I don't see any problems related to file locks.

Bye...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Jason Chinsen

unread,
Dec 8, 2014, 2:52:05 PM12/8/14
to puppet...@googlegroups.com, d...@recommind.com
Hey Dirk,

Thanks of the update, this is great news. If you do not mind, please can you share your puppet manifests and chocolatey package?

My puppet manifests for the windows part (this far) is relatively straight forward:

      package{'pe-agent':
        ensure          => hiera('puppet_enterprise_agent_upgrade::pe::agent::version'),
        provider        => 'chocolatey',
        source          => $source,
      }

More over how do you, if you have to, deal with the .net4 issue that I posted?

Thanks,
Jason.

Dirk Heinrichs

unread,
Dec 9, 2014, 6:59:51 AM12/9/14
to puppet...@googlegroups.com
Am 08.12.2014 um 15:52 schrieb Jason Chinsen:

Thanks of the update, this is great news. If you do not mind, please can you share your puppet manifests and chocolatey package?

I don't use chocolatey. I use the .msi from Puppetlabs (this is not PE, btw.). However, I've attached my module. You may need to remove/replace the "puppetstore" parts.


More over how do you, if you have to, deal with the .net4 issue that I posted?

No, I don't have that issue.

HTH...
puppet_agent.tgz

Rob Reynolds

unread,
Dec 15, 2014, 4:19:12 PM12/15/14
to puppet...@googlegroups.com
On Mon, Dec 8, 2014 at 8:32 AM, Dirk Heinrichs <d...@recommind.com> wrote:
Am 05.12.2014 um 19:03 schrieb Rob Reynolds:

Trying to upgrade Puppet with Puppet on Windows is harder because Windows locks files that are in use instead of letting you replace them in place. 

That's not true. Upgrading Puppet with Puppet on Windows works just fine. Downgrade is a different story, depending on the versions involved. I've alread done upgrades from 3.2.1 to 3.4.3 and I'm currently in the process of upgrading ~150 Windows agents from 3.4.3 (32bit) to 3.7.3 (64bit) and I don't see any problems related to file locks.

It is true, but let me explain a little bit so you see what I mean by harder.

The part about Windows locking files that are in use is true, but MSI forces the processes to exit, so the files are no longer locked (but Puppet is no longer running either).  The thing you may not realize here is that Puppet exits abruptly mid-run so that the MSI can take over so you get an incomplete report because Puppet is no longer running once the MSI shuts it down. So if you had anything else you wanted to do, you hope that the MSI upgrade completes successfully (because you don't get the report sent from the upgrade, and you don't get a success). Then you hope the newer Puppet installs fine and then checks back in once it is upgraded. 

So when I say it locks files instead of letting you replace them in place, it's because we have to force Puppet to exit so we can continue the upgrade. On Linux, while everything is in memory, you can completely change out the files on disk. When I say it is harder because of that locking, the longer explanation above is what I am talking about. Some folks would be fine with having Puppet just exit and not submit a report, but I'm not sure if everyone would be fine with that. 

I think we can do better, I don't think having Puppet exit to perform an upgrade is a sufficient answer.
 

Bye...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

--
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.

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

Rob Reynolds

unread,
Dec 15, 2014, 4:21:52 PM12/15/14
to puppet...@googlegroups.com
On Mon, Dec 8, 2014 at 8:27 AM, Jason Chinsen <onz...@gmail.com> wrote:
Hello Rob

Thanks for the response. I will take a look at OpenTable's module for sure. I will also add -force on to my install line

For the third part, we ran into another issue, and I am not sure if this is spelled out any where but we pass in the version 3.3.2 vs latest and most of our servers didn't have .net 4.0 and above and we were getting errors on these servers along the lines of "chocolatey cannot parse the parameters with out .net 4.0 or higher"

To use chocolatey, you should ensure the .NET Framework 4.0+ is installed on those servers. 
 

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

Jason Chinsen

unread,
Dec 16, 2014, 2:58:42 PM12/16/14
to puppet...@googlegroups.com
Thanks Rob!
Reply all
Reply to author
Forward
0 new messages