Last modified: 2014-09-30 00:06:37 UTC
Created attachment 13151 [details] Failing roles.pp I'm not sure if this is my problem or something that needs some tweaking in the way that packages are handled in roles. I'm working on adding the PdfHandler extension to the existing multimedia role. PdfHandler depends on packages [ 'ghostscript', 'imagemagick', 'xpdf-utils' ]. When declared as such in the manifest I get the following error when I try to apply: $ vagrant provision [default] Running provisioner: puppet... Running Puppet with site.pp... Duplicate definition: Package[imagemagick] is already defined in file /tmp/vagrant-puppet/manifests/roles.pp at line 383; cannot redefine at /tmp/vagrant-puppet/manifests/roles.pp:236 on node mediawiki-vagrant.dev line 383 in this case is my new declaration of the package dependencies: package { [ 'ghostscript', 'imagemagick', 'xpdf-utils' ]: } line 236 is inside role::uploadwizard: package { 'imagemagick': } I'm not sure what the right way to resolve this is. For now I'm commenting out the imagemagick package define in my new code, but I think this only works for me because I'm also enabling the uploadwizard role.
Handling for now by consolidating package definitions in role::multimedia. I tried to make them virtual (by appending "@" before "package"), but that seemed to still have the same problem. I may not have been doing it right.
https://forge.puppetlabs.com/puppetlabs/stdlib ensure_packages Takes a list of packages and only installs them if they don't already exist. Type: statement <-- this might help, it ensures a package is installed but shouldn't fail if it already exists. If we decide that using stdlib is a good thing that is, but afaik it's already installed and puppetlabs recommends it too.
After much debate on IRC, it seems that Ori is leaning towards the ensure_packages hack^H^H^H^Hfix for this issue as the "standard" way to treat packages in vagrant-puppet.
[mass-moving from Tools>MediaWiki-Vagrant to separate product. See bug 54041. Filter bugmail on this comment.]
We've packages.pp now.
This appears to be happening again after the redefinition of the require_package function in https://gerrit.wikimedia.org/r/#/c/158912/.
$ vagrant provision ==> default: Running provisioner: lsb_check... ==> default: Running provisioner: puppet... ==> default: Running Puppet with site.pp... ==> default: Error: Duplicate declaration: Package[imagemagick] is already declared; cannot redeclare at /tmp/vagrant-puppet-5/modules-0/role/manifests/pdfhandler.pp:12 on node mediawiki-vagrant.dev ==> default: Error: Duplicate declaration: Package[imagemagick] is already declared; cannot redeclare at /tmp/vagrant-puppet-5/modules-0/role/manifests/pdfhandler.pp:12 on node mediawiki-vagrant.dev The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong. $ vagrant --version Vagrant 1.6.5 VirtualBox 4.3.16
Change 163777 had a related patch set uploaded by BryanDavis: Revert "Make require_package() variadic; stop creating stub classes" https://gerrit.wikimedia.org/r/163777
Change 163777 merged by jenkins-bot: Revert "Make require_package() variadic; stop creating stub classes" https://gerrit.wikimedia.org/r/163777