Issue #2384 has been updated by Dominic Cleal.

Dominic Cleal wrote:
> I recently filed #14822 with a fix that disables negative caching of 
> features, so we pick up on when features are installed during a run.  I think 
> it's a duplicate of this issue.  If so, pull request 833 has the fix.

I've tested the original example and see now this is slightly different: I 
fixed Puppet.features to prevent caching, but this is different to a provider's 
features.  This means that #14822 is probably a pre-requisite to fix this as 
libshadow is checked via Puppet.features, but it didn't solve the re-evaluation 
of the provider features.

It looks like an equivalent of "confine :feature" is needed for provider 
features?


----------------------------------------
Bug #2384: Provider features are validated at instantiation rather than run time
https://projects.puppetlabs.com/issues/2384#change-66547

Author: Oliver Hookins
Status: Accepted
Priority: High
Assignee: eric sorenson
Category: RAL
Target version: 2.7.x
Affected Puppet version: 0.24.8
Keywords: usability
Branch: 


I'm attempting to do the following:
1. Install ruby-shadow
2. Create a user account (with a password)

Unfortunately puppet tends to screw up the order. Here's the test manifest:
<pre>
package { ruby-shadow: ensure => installed; }
user { testdude:
        ensure => present,
        gid => users,
        password => '$1$loo03Rez$MfxLF/9uMeaeOPCtceYGc0',
        require => Package[ruby-shadow],
        comment => "test account";
}
</pre>

Puppet checks for the account's presence before anything, and complains about 
ruby-shadow not being there. IMHO it shouldn't even care about checking 
anything to do with the account, since I have specified a prerequisite. Anyway, 
it installs ruby-shadow, then creates the account *without a password* despite 
ruby-shadow now being on the system. It takes a second run of puppet to set the 
password, which is really not ideal.

Here's the output with debugging and verbose:
<pre>
[root@test ~]# puppet -d -v test.pp 
debug: Puppet::Type::Package::ProviderRpm: Executing '/bin/rpm --version'
debug: Puppet::Type::Package::ProviderUrpmi: Executing '/bin/rpm -ql rpm'
debug: Puppet::Type::Package::ProviderAptrpm: Executing '/bin/rpm -ql rpm'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm --version'
debug: Failed to load library 'shadow' for feature 'libshadow'
debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude does not 
exist
debug: Puppet::Type::Package::ProviderPkgdmg: file /Library/Receipts does not 
exist
debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_delete does 
not exist
debug: Puppet::Type::Package::ProviderSun: file /usr/sbin/pkgrm does not exist
debug: Puppet::Type::Package::ProviderEasy_install: file easy_install does not 
exist
debug: Puppet::Type::Package::ProviderAppdmg: file /Library/Receipts does not 
exist
debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does not 
exist
debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_delete does not exist
debug: Puppet::Type::Package::ProviderPorts: file /usr/local/sbin/pkg_deinstall 
does not exist
debug: Puppet::Type::Package::ProviderGem: file gem does not exist
debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not exist
debug: Puppet::Type::Package::ProviderDarwinport: file /opt/local/bin/port does 
not exist
debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not exist
debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist
debug: Puppet::Type::Package::ProviderApple: file /Library/Receipts does not 
exist
debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not exist
debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox does 
not exist
debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not exist
debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does not 
exist
debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist
debug: Puppet::Type::User::ProviderPw: file pw does not exist
debug: Puppet::Type::User::ProviderLdap: true value when expecting false
debug: Puppet::Type::User::ProviderNetinfo: file nireport does not exist
debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does 
not exist
info: /User[testdude]: Provider useradd does not support features 
manages_passwords; not managing attribute password
debug: Creating default schedules
debug: Prefetching yum resources for package
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm --version'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -qa 
--nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} 
%{RELEASE} %{ARCH}
''
debug: /User[testdude]/require: requires Package[ruby-shadow]
debug: Failed to load library 'ldap' for feature 'ldap'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q ruby-shadow 
--nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} 
%{RELEASE} %{ARCH}
'
debug: //Package[ruby-shadow]: Changing ensure
debug: //Package[ruby-shadow]: 1 change(s)
debug: Package[ruby-shadow](provider=yum): Ensuring => present
debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d 0 -e 0 -y 
install ruby-shadow'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q ruby-shadow 
--nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} 
%{RELEASE} %{ARCH}
'
notice: //Package[ruby-shadow]/ensure: created
debug: /User[testdude]: Changing ensure
debug: /User[testdude]: 1 change(s)
debug: User[testdude](provider=useradd): Executing '/usr/sbin/useradd -c test 
account -g users -M testdude'
notice: /User[testdude]/ensure: created
debug: Finishing transaction 23951941785180 with 2 changes
</pre>



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to