Issue #4260 has been updated by Jos Boumans.

Nigel Kersten wrote:
> Is this just because the commands aren't fully qualified in the provider?
> 
> [...]
> 
> So if you don't have a PATH, which you may not for your automated runs, it 
> can't find the binaries?
> 
> A quick test would be to edit the a2mod.rb provider file and fully qualify 
> the paths to see if that fixes it.

Definitely worth a try, but it doesn't seem to fix it. I've just updated the 
a2mod.rb provider and fired up a new VM to test it:

### syslog:
Aug 27 23:49:25 ip-10-212-127-48 puppetd[3530]: (//apache/A2mod[headers]) 
Failed to retrieve current state of resource: No ability to determine if a2mod 
exists
Aug 27 23:49:25 ip-10-212-127-48 puppetd[3530]: 
(/File[/etc/apache2/sites-enabled/000-default]/ensure) removed
Aug 27 23:49:28 ip-10-212-127-48 puppetd[3530]: 
(//s_logger/Package[cronolog]/ensure) ensure changed 'purged' to 'present'
Aug 27 23:49:28 ip-10-212-127-48 puppetd[3530]: 
(//s_logger/File[/mnt/var]/ensure) created
Aug 27 23:49:28 ip-10-212-127-48 puppetd[3530]: 
(//s_logger/File[/mnt/var/log]/ensure) created
Aug 27 23:49:28 ip-10-212-127-48 puppetd[3530]: 
(//s_logger/File[/mnt/var/log/apache2]/ensure) created
Aug 27 23:49:29 ip-10-212-127-48 puppetd[3530]: 
(//sshd::setup/Service[ssh]/enable) enable changed 'false' to 'true'
Aug 27 23:49:29 ip-10-212-127-48 puppetd[3530]: (//s_logger/A2mod[usertrack]) 
Failed to retrieve current state of resource: No ability to determine if a2mod 
exists

### and as you can see, fully qualified paths made it onto the client:
r...@ip-10-212-127-48:/var/lib/puppet# grep a2 
lib/puppet/provider/a2mod/a2mod.rb
Puppet::Type.type(:a2mod).provide(:a2mod) do
    commands :encmd => "/usr/sbin/a2enmod"
    #commands :encmd => "a2enmod"
    #commands :discmd => "a2dismod"
    commands :discmd => "/usr/sbin/a2dismod"

Since i have the fresh image running, any other diagnostics I could provide?

----------------------------------------
Bug #4260: A2mod can not be depended on in automated runs
http://projects.puppetlabs.com/issues/4260

Author: Jos Boumans
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected version: 0.25.4
Keywords: 
Branch: 


Hi,

I've run into an interesting issue (partly known): when using the 
puppetlabs-apache module, and depending on an a2mod resource, the client does 
not know how to make sure that a2mod resource is enabled, and therefor does not 
start the apache service.

This is known for the first run, where the definitions of a2mod have not yet 
been transfered. However, this persists for every *automated* run against. But 
when logging in to the client and manually running: 
<pre>
puppetd --verbose --test
</pre>
the a2mod resource is enabled, the dependency declared is resolved, and the 
apache service started.

This is on Ubuntu 10.04 LTS, with the Puppet 0.25.4 as shipped with that 
release, running in Amazon EC2

Logs of the puppetmaster (masterhttp & syslog), syslog for the client and a 
manual run on the client are all attached.

Here are the highlights:

<pre>
### client syslog, automated runs:
Jul 16 21:07:20 some-ec2-host puppetd[3394]: (//s_logger/A2mod[usertrack]) 
Failed to retrieve current state of resource: No ability to determine if a2mod 
exists
Jul 16 21:07:20 some-ec2-host puppetd[3394]: (//apache/A2mod[headers]) Failed 
to retrieve current state of resource: No ability to determine if a2mod exists
Jul 16 21:07:21 some-ec2-host puppetd[3394]: (//apache/Service[httpd]) 
Dependency a2mod[headers] has 1 failures
Jul 16 21:07:21 some-ec2-host puppetd[3394]: (//apache/Service[httpd]) Skipping 
because of failed dependencies
</pre>

<pre>
### client, manual puppetd run:
debug: //apache/A2mod[headers]: Changing ensure
debug: //apache/A2mod[headers]: 1 change(s)
debug: Puppet::Type::A2mod::ProviderA2mod: Executing '/usr/sbin/a2enmod headers'
notice: //apache/A2mod[headers]/ensure: created
info: //apache/A2mod[headers]: Scheduling refresh of Service[httpd]
debug: //s_logger/A2mod[usertrack]: Changing ensure
debug: //s_logger/A2mod[usertrack]: 1 change(s)
debug: Puppet::Type::A2mod::ProviderA2mod: Executing '/usr/sbin/a2enmod 
usertrack'
notice: //s_logger/A2mod[usertrack]/ensure: created
notice: //apache/Service[httpd]: Triggering 'refresh' from 1 dependencies
debug: Service[httpd](provider=debian): Executing '/etc/init.d/apache2 stop'
debug: Service[httpd](provider=debian): Executing '/etc/init.d/apache2 start'
</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