Hi, I am trying run a package once and when it completes I want my manifest to create a touch file and from that file being placed there it will not run again. I have this so far, but have been running into syntax problems/invalid parameters. #Package to install package { ''Bindscript20100601.dmg'': provider => pkgdmg, ensure => installed, source => ''temp/location/rightnow/Bindscript20100601.dmg'', notify => [Exec[''blahblah'']], onlyif => "test -e /var/db/.bindscript", } exec {''blahblah'': command =>''touch /var/db/.bindscript'', path =>[''/usr/bin''] } If you need more information please ask. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Tue, 12 Jul 2011 13:19:34 -0700, vella1tj wrote:> > Hi, I am trying run a package once and when it completes I want my > manifest to create a touch file and from that file being placed there > it will not run again. I have this so far, but have been running into > syntax problems/invalid parameters. > > > #Package to install > package { ''Bindscript20100601.dmg'': > provider => pkgdmg, > ensure => installed, > source => ''temp/location/rightnow/Bindscript20100601.dmg'', > notify => [Exec[''blahblah'']], > onlyif => "test -e /var/db/.bindscript", > } > exec {''blahblah'': > command =>''touch /var/db/.bindscript'', > path =>[''/usr/bin''] > } > > If you need more information please ask. >Couple of things. onlyif is only valid on exec resources. This shouldn''t actually be necessary. The pkgdmg provider should keep track of which things it''s installed, so it won''t keep trying to install the .dmg on every run. Is the following resource definition not working for you? package { ''Bindscript20100601.dmg'': provider => pkgdmg, ensure => installed, source => ''temp/location/rightnow/Bindscript20100601.dmg'', } -- Jacob Helwig ,---- | Join us for PuppetConf, September 22nd and 23rd in Portland, OR | http://bit.ly/puppetconfsig `----
package { ''Bindscript20100601.dmg'': provider => pkgdmg, ensure => installed, source => ''temp/location/rightnow/Bindscript20100601.dmg'', } Seems to work fine I return this once it runs "notice: //Package[Bindscript20100601.pkg.dmg]/ensure: created" So it will only run once on the machine? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/QTeXJzyTz8YJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Tue, Jul 12, 2011 at 1:37 PM, Jacob Helwig <jacob@puppetlabs.com> wrote:> > This shouldn''t actually be necessary. The pkgdmg provider should keep > track of which things it''s installed, so it won''t keep trying to install > the .dmg on every run. > >and for further detail, due to OS X not having a real package management system, the way Puppet works out if a package was installed is by dropping a .puppet_pkgdmg_.... file in /var/db -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Tue, 12 Jul 2011 13:43:45 -0700, vella1tj wrote:> > package { ''Bindscript20100601.dmg'': > provider => pkgdmg, > ensure => installed, > source => ''temp/location/rightnow/Bindscript20100601.dmg'', > } > > Seems to work fine I return this once it runs "notice: > //Package[Bindscript20100601.pkg.dmg]/ensure: created" > > So it will only run once on the machine? >Correct. As long as the file that Nigel pointed out remains there, it won''t try to install the .dmg again. -- Jacob Helwig ,---- | Join us for PuppetConf, September 22nd and 23rd in Portland, OR | http://bit.ly/puppetconfsig `----
After I ran that manifest, with this only #Package to install package { ''Bindscript20100601.dmg'': provider => pkgdmg, ensure => installed, source => ''/etc/puppet/bindscript/files/ Bindscript20100601.dmg'', I am now receiving these errors and on the second error, Bindscript.dmg disappears as if it''s deleting itself. I''ve created the dmg in disk utility in Mac osx. On Jul 12, 4:19 pm, vella1tj <vella...@gmail.com> wrote:> Hi, I am trying run a package once and when it completes I want my > manifest to create a touch file and from that file being placed there > it will not run again. I have this so far, but have been running into > syntax problems/invalid parameters. > > #Package to install > package { ''Bindscript20100601.dmg'': > provider => pkgdmg, > ensure => installed, > source => ''temp/location/rightnow/Bindscript20100601.dmg'', > notify => [Exec[''blahblah'']], > onlyif => "test -e /var/db/.bindscript",} > > exec {''blahblah'': > command =>''touch /var/db/.bindscript'', > path =>[''/usr/bin''] > > } > > If you need more information please ask.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
the errors are: err: //Package[Bindscript20100601.dmg]/ensure: change from absent to present failed: Execution of ''/usr/bin/hdiutil mount -plist -nobrowse - readonly -noidme -mountrandom /tmp /Users/vella1tj/Desktop/ Bindscript2010601.dmg'' returned 1: hdiutil: mount failed - Resource temporarily unavailable notice: //Exec[blahblah]: Dependency package[Bindscript20100601.dmg] has 1 failures warning: //Exec[blahblah]: Skipping because of failed dependencies On Jul 15, 10:23 am, vella1tj <vella...@gmail.com> wrote:> After I ran that manifest, with this only > > #Package to install > package { ''Bindscript20100601.dmg'': > provider => pkgdmg, > ensure => installed, > source => ''/etc/puppet/bindscript/files/ > Bindscript20100601.dmg'', > > I am now receiving these errors and on the second error, > Bindscript.dmg disappears as if it''s deleting itself. I''ve created the > dmg in disk utility in Mac osx. > > On Jul 12, 4:19 pm, vella1tj <vella...@gmail.com> wrote: > > > > > > > > > Hi, I am trying run a package once and when it completes I want my > > manifest to create a touch file and from that file being placed there > > it will not run again. I have this so far, but have been running into > > syntax problems/invalid parameters. > > > #Package to install > > package { ''Bindscript20100601.dmg'': > > provider => pkgdmg, > > ensure => installed, > > source => ''temp/location/rightnow/Bindscript20100601.dmg'', > > notify => [Exec[''blahblah'']], > > onlyif => "test -e /var/db/.bindscript",} > > > exec {''blahblah'': > > command =>''touch /var/db/.bindscript'', > > path =>[''/usr/bin''] > > > } > > > If you need more information please ask.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, Jul 15, 2011 at 7:34 AM, vella1tj <vella1tj@gmail.com> wrote:> the errors are: > > err: //Package[Bindscript20100601.dmg]/ensure: change from absent to > present failed: Execution of ''/usr/bin/hdiutil mount -plist -nobrowse - > readonly -noidme -mountrandom /tmp /Users/vella1tj/Desktop/ > Bindscript2010601.dmg'' returned 1: hdiutil: mount failed - Resource > temporarily unavailableCan you download the dmg and mount it using the same command? That looks like either a corrupt dmg or a (possibly temporary) issue with the disk mounting framework to me.> > notice: //Exec[blahblah]: Dependency package[Bindscript20100601.dmg] > has 1 failures > warning: //Exec[blahblah]: Skipping because of failed dependencies > > On Jul 15, 10:23 am, vella1tj <vella...@gmail.com> wrote: >> After I ran that manifest, with this only >> >> #Package to install >> package { ''Bindscript20100601.dmg'': >> provider => pkgdmg, >> ensure => installed, >> source => ''/etc/puppet/bindscript/files/ >> Bindscript20100601.dmg'', >> >> I am now receiving these errors and on the second error, >> Bindscript.dmg disappears as if it''s deleting itself. I''ve created the >> dmg in disk utility in Mac osx. >> >> On Jul 12, 4:19 pm, vella1tj <vella...@gmail.com> wrote: >> >> >> >> >> >> >> >> > Hi, I am trying run a package once and when it completes I want my >> > manifest to create a touch file and from that file being placed there >> > it will not run again. I have this so far, but have been running into >> > syntax problems/invalid parameters. >> >> > #Package to install >> > package { ''Bindscript20100601.dmg'': >> > provider => pkgdmg, >> > ensure => installed, >> > source => ''temp/location/rightnow/Bindscript20100601.dmg'', >> > notify => [Exec[''blahblah'']], >> > onlyif => "test -e /var/db/.bindscript",} >> >> > exec {''blahblah'': >> > command =>''touch /var/db/.bindscript'', >> > path =>[''/usr/bin''] >> >> > } >> >> > If you need more information please ask. > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en. > >-- Nigel Kersten Product Manager, Puppet Labs Join us for PuppetConf <http://www.bit.ly/puppetconfsig> Sept 22/23 Portland, Oregon, USA. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.