diff --git a/examples.markdown b/examples.markdown index d0be7b402..8710e6e38 100644 --- a/examples.markdown +++ b/examples.markdown @@ -142,6 +142,7 @@ Now press "esc" to exit the "Insert" mode, then type ```:w``` to save the file c Exit vi by typing ```:q``` then "Enter." This will return to the prompt. Execute the following command: + ```command /var/cfengine/bin/cf-agent --no-lock --file ./hello_world.cf ``` diff --git a/examples/example-snippets/promise-patterns/example_aborting_execution.markdown b/examples/example-snippets/promise-patterns/example_aborting_execution.markdown index cae5db3af..315f2e2d0 100644 --- a/examples/example-snippets/promise-patterns/example_aborting_execution.markdown +++ b/examples/example-snippets/promise-patterns/example_aborting_execution.markdown @@ -14,6 +14,7 @@ If any of these classes becomes defined, it will cause the current bundle to be [%CFEngine_include_example(abort.cf)%] This is how the policy runs when the userlist is valid: + ```command cf-agent -f unit_abort.cf ``` @@ -22,6 +23,7 @@ R: User name mark is valid at 4 letters R: User name john is valid at 4 letters ``` This is how the policy runs when the userlist contains an invalid entry: + ```command cf-agent -f unit_abort.cf ``` diff --git a/examples/example-snippets/promise-patterns/example_change_detection.markdown b/examples/example-snippets/promise-patterns/example_change_detection.markdown index 90c3ae9d7..65e9e9efb 100644 --- a/examples/example-snippets/promise-patterns/example_change_detection.markdown +++ b/examples/example-snippets/promise-patterns/example_change_detection.markdown @@ -29,6 +29,7 @@ cf-agent -f unit_change_detect.cf 2013-06-06T20:53:26-0700 error: /example/files/'/etc/example': File '/etc/example/example.conf' was not in 'md5' database - new file found ``` + ```command cf-agent -f unit_change_detect.cf -K ``` diff --git a/examples/example-snippets/promise-patterns/example_diskfree.markdown b/examples/example-snippets/promise-patterns/example_diskfree.markdown index 5722b30c9..f4d8f72ec 100644 --- a/examples/example-snippets/promise-patterns/example_diskfree.markdown +++ b/examples/example-snippets/promise-patterns/example_diskfree.markdown @@ -18,6 +18,7 @@ cf-agent -f unit_diskfree.cf ```output R: Freedisk 48694692 ``` + ```command df -k /tmp ``` diff --git a/examples/example-snippets/promise-patterns/example_enable_service.markdown b/examples/example-snippets/promise-patterns/example_enable_service.markdown index a03da13d6..083b92cba 100644 --- a/examples/example-snippets/promise-patterns/example_enable_service.markdown +++ b/examples/example-snippets/promise-patterns/example_enable_service.markdown @@ -75,6 +75,7 @@ service sysstat status; echo $? ```output 3 ``` + ```command service httpd status; echo $? ``` @@ -82,6 +83,7 @@ service httpd status; echo $? httpd (pid 3740) is running... 0 ``` + ```command service cups status; echo $? ``` @@ -89,6 +91,7 @@ service cups status; echo $? cupsd (pid 3762) is running... 0 ``` + ```command service sshd status; echo $? ``` @@ -96,6 +99,7 @@ service sshd status; echo $? openssh-daemon (pid 3794) is running... 0 ``` + ```command service crond status; echo $? ``` @@ -128,6 +132,7 @@ service sysstat status; echo $? ```output 3 ``` + ```command service httpd status; echo $? ``` @@ -135,6 +140,7 @@ service httpd status; echo $? httpd is stopped 3 ``` + ```command service cups status; echo $? ``` @@ -142,6 +148,7 @@ service cups status; echo $? cups is stopped 3 ``` + ```command service sshd status; echo $? ``` @@ -149,6 +156,7 @@ service sshd status; echo $? openssh-daemon (pid 3794) is running... 0 ``` + ```command service crond status; echo $? ``` diff --git a/examples/example-snippets/promise-patterns/example_install_package.markdown b/examples/example-snippets/promise-patterns/example_install_package.markdown index 6e7f7fb17..251e88be7 100644 --- a/examples/example-snippets/promise-patterns/example_install_package.markdown +++ b/examples/example-snippets/promise-patterns/example_install_package.markdown @@ -61,9 +61,11 @@ Removing ntp ... Processing triggers for ureadahead ... Processing triggers for man-db ... ``` + ```command cf-agent -f install_packages.cf # install packages ``` + ```command dpkg -l lynx ntp # show installed packages ``` diff --git a/examples/example-snippets/promise-patterns/example_mount_nfs.markdown b/examples/example-snippets/promise-patterns/example_mount_nfs.markdown index 473463dca..2420fb28d 100644 --- a/examples/example-snippets/promise-patterns/example_mount_nfs.markdown +++ b/examples/example-snippets/promise-patterns/example_mount_nfs.markdown @@ -52,12 +52,14 @@ cf-agent -f example_mount_nfs.cf ```output 2013-06-08T17:48:42-0700 error: Attempting abort because mount went into a retry loop. ``` + ```command grep mnt /etc/fstab ``` ```output fileserver:/home /mnt nfs rw ``` + ```command df |grep mnt ``` diff --git a/examples/example-snippets/promise-patterns/example_process_kill.markdown b/examples/example-snippets/promise-patterns/example_process_kill.markdown index 32a86a704..b1856d794 100644 --- a/examples/example-snippets/promise-patterns/example_process_kill.markdown +++ b/examples/example-snippets/promise-patterns/example_process_kill.markdown @@ -37,6 +37,7 @@ Example run: ```output [1] 5370 ``` + ```command cf-agent -f unit_process_kill.cf ``` @@ -52,6 +53,7 @@ Now let's do it again with inform mode turned on, and CFEngine will show the pro ```output [1] 5377 ``` + ```command cf-agent -f unit_process_kill.cf -IK ``` diff --git a/examples/example-snippets/promise-patterns/example_process_restart.markdown b/examples/example-snippets/promise-patterns/example_process_restart.markdown index 907e14d9a..99ab45ab8 100644 --- a/examples/example-snippets/promise-patterns/example_process_restart.markdown +++ b/examples/example-snippets/promise-patterns/example_process_restart.markdown @@ -67,6 +67,7 @@ And again, in Inform mode: ```command kill 8008 ``` + ```command cf-agent -f unit_process_restart.cf -I ``` diff --git a/examples/tutorials/distribute-files-from-a-central-location.markdown b/examples/tutorials/distribute-files-from-a-central-location.markdown index ef3e82f0c..066458170 100644 --- a/examples/tutorials/distribute-files-from-a-central-location.markdown +++ b/examples/tutorials/distribute-files-from-a-central-location.markdown @@ -23,6 +23,7 @@ git clone url ``` or + ```command git pull origin master ``` @@ -219,16 +220,19 @@ This tracker allows you to see how the policy reacts as it is activated on your ### Deploy changes (Enterprise and Community Users) Always inspect what you expect. `git status` shows the status of your current branch. + ```command git status ``` Inspect the changes contained in each file. + ```command git diff file ``` Once satisfied, add them to Git's commit staging area. + ```command git add file ``` @@ -236,17 +240,20 @@ git add file Iterate over using git **diff**, **add**, and **status** until all of the changes that you expected are listed as **Changes to be committed**. Check the status once more before you commit the changes. + ```command git status ``` Commit the changes to your local repository. + ```command git commit ``` Push the changes to the central repository so they can be pulled down to your policy server for distribution. + ```command git push origin master ``` diff --git a/examples/tutorials/manage-ntp.markdown b/examples/tutorials/manage-ntp.markdown index 93639f5d4..89a21efc7 100644 --- a/examples/tutorials/manage-ntp.markdown +++ b/examples/tutorials/manage-ntp.markdown @@ -490,6 +490,7 @@ cf-agent -KIf update.cf; ```output info: Copied file '/var/cfengine/masterfiles/services/ntp.cf' to '/var/cfengine/inputs/services/ntp.cf.cfnew' (mode '600') ``` + ```command cf-agent -KI ``` @@ -653,6 +654,7 @@ cf-agent -KIf update.cf info: Copied file '/var/cfengine/masterfiles/services/ntp.cf' to '/var/cfengine/inputs/services/ntp.cf.cfnew' (mode '600') info: Copied file '/var/cfengine/masterfiles/def.json' to '/var/cfengine/inputs/def.json.cfnew' (mode '600') ``` + ```command cf-agent -KI ``` @@ -708,6 +710,7 @@ python -m json.tool < def.json } } ``` + ```command cf-agent -KI ``` @@ -720,6 +723,7 @@ R: NTP service restarted after configuration change info: Can not acquire lock for 'ntp' package promise. Skipping promise evaluation info: Can not acquire lock for 'ntp' package promise. Skipping promise evaluation ``` + ```command grep -P "^(driftfile|server)" /etc/ntp.conf ``` diff --git a/examples/tutorials/manage-packages.markdown b/examples/tutorials/manage-packages.markdown index e303e2e96..ce9c09269 100644 --- a/examples/tutorials/manage-packages.markdown +++ b/examples/tutorials/manage-packages.markdown @@ -48,9 +48,11 @@ yum list installed | grep openssl openssl.x86_64 1.0.0-27.el6 @anaconda-CentOS-201303020151.x86_64/6.4 openssl-devel.x86_64 1.0.0-27.el6 @anaconda-CentOS-201303020151.x86_64/6.4 ``` + ```command cf-agent -K ./manage_packages.cf ``` + ```command yum list installed | grep openssl ``` @@ -69,6 +71,7 @@ yum list installed | grep telnet ```output telnet.x86_64 1:0.17-48.el6 @base ``` + ```command which telnet ``` diff --git a/examples/tutorials/writing-and-serving-policy/authoring-policy-tools-and-workflow.markdown b/examples/tutorials/writing-and-serving-policy/authoring-policy-tools-and-workflow.markdown index 7ace536fb..9e23a9278 100644 --- a/examples/tutorials/writing-and-serving-policy/authoring-policy-tools-and-workflow.markdown +++ b/examples/tutorials/writing-and-serving-policy/authoring-policy-tools-and-workflow.markdown @@ -87,15 +87,18 @@ B) Or, change the remote url to `https://GitUserName@password:github.com/GitUser #### Create a Remote in Masterfiles on the Hub to Masterfiles on GitHub #### 1. Change back to the `masterfiles` directory, if not already there: + ```command cd /var/cfengine/masterfiles ``` 2. Create the remote using the following pattern: + ```command git remote add upstream ssh://git@github.com/GitUserName/cfengine-masterfiles.git ``` 3. Verify the remote was registered properly: + ```command git remote -v ``` diff --git a/web-ui/custom-actions-for-alerts.markdown b/web-ui/custom-actions-for-alerts.markdown index 9f43d60bc..e73a8c352 100644 --- a/web-ui/custom-actions-for-alerts.markdown +++ b/web-ui/custom-actions-for-alerts.markdown @@ -93,6 +93,7 @@ Given an alert that triggers on a policy bundle being not kept (failed), the fol Saving this as a file, e.g. 'alert_parameters_test', can be useful while writing and testing your Custom action script. You could then simply test your Custom action script, e.g. 'cfengine_custom_action_ticketing.py', by running + ```command ./cfengine_custom_action_ticketing alert_parameters_test ``` diff --git a/web-ui/enterprise-reporting/reporting-architecture.markdown b/web-ui/enterprise-reporting/reporting-architecture.markdown index ec9a875a5..3d13117ae 100644 --- a/web-ui/enterprise-reporting/reporting-architecture.markdown +++ b/web-ui/enterprise-reporting/reporting-architecture.markdown @@ -19,6 +19,7 @@ each host to download new data. To collect reports from any host manually, run the following: + ```command /var/cfengine/bin/cf-hub -H ```