--
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/4e0cd8c4-577f-42a6-a664-e6f4015fca5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
include role::fips_tool
...
class { profile::software::apache: php_version => '7.3', default_redirect_to => 'http://my.host.name', maindir => '/srv/labor/', keep_log_days => 30, }
class { profile::software::wordpress: php_version => '7.3', }...
class profile::software::apache ( String $php_version = '7.0', String $default_redirect_to = 'https://my.host.name', String $maindir = '/srv/www/', Integer $keep_log_days = 30,) {
...
ensure_packages([ "php$php_version-xml", "php$php_version-zip", "php$php_version-curl", "php$php_version-mbstring", "libapache2-mod-php$php_version",
], { require => [Class['apt::update'], Apt::Source['sury_php'], ] } )
...}
class profile::software::wordpress ( String $php_version = '7.0',){ require profile::software::mysql require profile::software::apache
...
ensure_packages([ 'php7.1-mysql', 'php7.1-common', "libapache2-mod-php$php_version", "php$php_version-gd", "php$php_version-mysql", ], { require => [Class['apt::update'], Apt::Source['sury_php']], notify => Class['apache::service'] })
...
}
sudo puppet apply /etc/puppetlabs/code/environments/dev/manifests/
Notice: Scope(Class[Profile::Software::Tool_packages]): VirtualBoxWarning: You cannot collect exported resources without storeconfigs being set; the export is ignored (file: /etc/puppetlabs/code/environments/dev/modules-external/ssh/manifests/hostkeys.pp, line: 39, column: 7)Warning: You cannot collect exported resources without storeconfigs being set; the export is ignored (file: /etc/puppetlabs/code/environments/dev/modules-external/ssh/manifests/hostkeys.pp, line: 32, column: 7)Warning: You cannot collect exported resources without storeconfigs being set; the export is ignored (file: /etc/puppetlabs/code/environments/dev/modules-external/ssh/manifests/hostkeys.pp, line: 32, column: 7)Warning: You cannot collect exported resources without storeconfigs being set; the export is ignored (file: /etc/puppetlabs/code/environments/dev/modules-external/ssh/manifests/hostkeys.pp, line: 32, column: 7)Warning: You cannot collect exported resources without storeconfigs being set; the collection will be ignored (file: /etc/puppetlabs/code/environments/dev/modules-external/ssh/manifests/knownhosts.pp, line: 9, column: 7)Notice: Scope(Class[Profile::Software::Certbot]): setting Let's encrypt staging environment!!!Warning: Scope(Class[Apache::Mod::Status]): Class apache::mod::status: Using AllowWarning: Scope(Class[Apache::Mod::Status]): is deprecated in Apache 2.4Notice: Scope(Class[Java_ng]): Selected repository: ppa:oracle, selected version: 8Notice: Compiled catalog for stretch.localdomain in environment dev in 5.74 secondsNotice: Applied catalog in 3.20 seconds
puppet apply /etc/puppetlabs/code/environments/production/manifests/
Warning: You cannot collect exported resources without storeconfigs being set; the export is ignored (file: /etc/puppetlabs/code/environments/production/modules-external/ssh/manifests/hostkeys.pp, line: 39, column: 7)Warning: You cannot collect exported resources without storeconfigs being set; the export is ignored (file: /etc/puppetlabs/code/environments/production/modules-external/ssh/manifests/hostkeys.pp, line: 32, column: 7)Warning: You cannot collect exported resources without storeconfigs being set; the export is ignored (file: /etc/puppetlabs/code/environments/production/modules-external/ssh/manifests/hostkeys.pp, line: 32, column: 7)Warning: You cannot collect exported resources without storeconfigs being set; the export is ignored (file: /etc/puppetlabs/code/environments/production/modules-external/ssh/manifests/hostkeys.pp, line: 32, column: 7)Warning: You cannot collect exported resources without storeconfigs being set; the collection will be ignored (file: /etc/puppetlabs/code/environments/production/modules-external/ssh/manifests/knownhosts.pp, line: 9, column: 7)Error: Evaluation Error: Error while evaluating a Function Call, Duplicate declaration: Package[libapache2-mod-php7.3] is already declared at (file: /etc/puppetlabs/code/environments/production/modules/profile/manifests/software/apache.pp, line: 78); cannot redeclare (file: /etc/puppetlabs/code/environments/production/modules/profile/manifests/software/wordpress.pp, line: 24) (file: /etc/puppetlabs/code/environments/production/modules/profile/manifests/software/wordpress.pp, line: 24, column: 3) on node my.host.name
As long as I'm standing on this soapbox, though, I'd like to remark that ensure_packages() is a jerry-rig, not an actual solution to any Puppet problem. It and its brethren, ensure_package(), ensure_resources(), and ensure_resource() should be avoided.
If the resource already exists, but does not match the specified parameters, this function attempts to recreate the resource, leading to a duplicate resource definition error.
--
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/b67eecc5-1145-4eff-8d6b-fbf8808236e3%40googlegroups.com.
Nevertheless the question remains why the code is working in my dev environment. Both environments are the same as much as you can get.