Stand-alone test apply command:
1. Options,
Debug displays debugging information,
Verbose more information,
NOOP Simulation Execution
[Root@lvs-master manifests]# puppet apply--verbose--noop test.pp
notice:compiled Catalog for Lvs-master.lvs-master in environment production in 0.12 seconds
info:applying configuration version ' 1495770577 '
notice:/stage[main]/main/file[/tmp/12567.txt]/ensure:current_value Absent, should be present (NoOp)
Notice: Class[main]: Would has triggered ' refresh ' from 1 events
Notice:stage[main]: Would has triggered ' refresh ' from 1 E Vents
notice:finished Catalog run in 0.03 seconds
From the return information of the test execution, we can see that when we execute the puppet apply command, the first step is to compile the corresponding TEST.PP list into catalog,
As I have said before, the list cannot be run directly, and it needs to be compiled into catalog, which validates our theory.
The green font in the test information is the version number of the app configuration, and we don't care about it.
2. This time we do not add the –noop option when executing the puppet command, that is, the test execution is not performed, but the actual execution
[Root@lvs-master manifests]# puppet apply--verbose test.pp
notice:compiled Catalog for Lvs-master.lvs-master In environment production in 0.08 seconds
info:applying configuration version ' 1495773784 '
Notice:/stage[main] /main/file[/tmp/12567.txt]/ensure:created
notice:finished Catalog run in 0.03 seconds
[root@lvs-master manifests]# cat/tmp/12567.txt
Aaaaababbau
As you can see, Puppet has correctly created a file named 12567.txt, as configured in the TEST.PP list.
Reference Links:
http://www.zsythink.net/archives/331