Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't define any php packages outside of this module without causing conflict #581

Open
rjhenry opened this issue May 29, 2020 · 0 comments · May be fixed by #582
Open

Can't define any php packages outside of this module without causing conflict #581

rjhenry opened this issue May 29, 2020 · 0 comments · May be fixed by #582

Comments

@rjhenry
Copy link

rjhenry commented May 29, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: v4.8.2 client, 6.14 server
  • Ruby: 2.3.2
  • Distribution: Debian Stretch
  • Module version: 7.1.0

How to reproduce (e.g Puppet code you use)

When a php7.0-cli package is defined elsewhere, a duplicate definition is created. In our case, we have php7.0-cli and some others installed by ensure_packages() from stdlib, and used for some ordering, like so:

$packages = flatten([
    $pkg_step1,
    $pkg_step2,
])
ensure_packages($packages)
# Make sure the cgi package is installed before php so that the latter
# doesn't pull in libapache2-mod-php.
    Package[$pkg_step1] -> Package[$pkg_step2]

What are you seeing

Duplicate resource definition

What behaviour did you expect instead

Packages to be installed with ensure_packages() to avoid conflicts where defined elsewhere.

Output log

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Package[php7.0-cli] is already declared at (file: /etc/puppetlabs/code/environments/<redacted>/modules/<redacted path to own class>/php.pp, line: 73); cannot redeclare (file: /etc/puppetlabs/code/environments/<redacted>/modules_dist/php/manifests/packages.pp, line: 30) (file: /etc/puppetlabs/code/environments/<redacted>/modules_dist/php/manifests/packages.pp, line: 30, column: 5) on node <redacted>
Warning: Not using cache on failed catalog

Any additional information you'd like to impart

Should be an easy enough fix, so I'll get a PR in shortly.

rjhenry pushed a commit to rjhenry/puppet-php that referenced this issue May 29, 2020
See voxpupuli#581

In short, replaces all explicit definitions of a Puppet Package resource
with an instance of puppetlabs-stdlib's ensure_packages.
@rjhenry rjhenry linked a pull request May 29, 2020 that will close this issue
rjhenry pushed a commit to rjhenry/puppet-php that referenced this issue Jun 9, 2020
See voxpupuli#581

In short, replaces all explicit definitions of a Puppet Package resource
with an instance of puppetlabs-stdlib's ensure_packages.
rjhenry pushed a commit to rjhenry/puppet-php that referenced this issue Jun 9, 2020
See voxpupuli#581

In short, replaces all explicit definitions of a Puppet Package resource
with an instance of puppetlabs-stdlib's ensure_packages.
rjhenry pushed a commit to rjhenry/puppet-php that referenced this issue Jun 9, 2020
See voxpupuli#581

In short, replaces all explicit definitions of a Puppet Package resource
with an instance of puppetlabs-stdlib's ensure_packages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant