Debug mode – catalog

Sometimes, Puppet throws an error that isn't immediately obvious. In the next example, I'm attempting to install apache httpd, but I have misspelled the name of the package. If you haven't spent a lot of time working on a system that uses Yum, the error Nothing to do isn't exactly a very clear error:

[root@pe-puppet-master manifests]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for pe-puppet-master
Info: Applying configuration version '1535778801'
Notice: Applying the Linux Baseline!
Notice: /Stage[main]/Profile::Baseline::Linux/Notify[baseline]/message: defined 'message' as 'Applying the Linux Baseline!'
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install http' returned 1: Error: Nothing to do
Error: /Stage[main]/Profile::Baseline/Package[http]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install http' returned 1: Error: Nothing to do
https://yum.puppet.com/puppet5/puppet5-release-el-7.noarch.rpm' returned 1: Error: Nothing to do
Info: Stage[main]: Unscheduling all events on Stage[main]

I may want to inspect exactly what Puppet is trying to get my system to do. I can use the --debug flag on the agent to inspect all of the actions that Puppet is taking underneath the system. I can see that Puppet uses rpm -q to check whether the package is already installed on the system. When it's not found, it executes a specific Yum command: run Yum without an error log (-e 0) or debugging (-d 0), and assume yes (-y) to install http. Finally, because this resource has failed, any resources requiring it will fail to install:

Debug: Executing: '/usr/bin/rpm -q http --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
''
Debug: Executing: '/usr/bin/rpm -q http --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} ' --whatprovides'
Debug: Package[http](provider=yum): Ensuring => present
Debug: Executing: '/usr/bin/yum -d 0 -e 0 -y install http'
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install http' returned 1: Error: Nothing to do
Error: /Stage[main]/Profile::Baseline/Package[http]/ensure: change from'purged' to 'present' failed: Execution of '/usr/bin/yum -d 0 -e 0 -y

 install http' returned 1: Error: Nothing to do
Debug: Class[Profile::Baseline]: Resource is being skipped, unscheduling all events
The error Nothing to do wasn't actually solved. A quick search of your favorite forums will indicate some likely culprits, and in this case, http isn't a package in Yum. httpd , which is the Apache web server, is what I was looking to install.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.151.154