diff --git a/content/examples/example-snippets/aborting_execution.cf b/content/examples/example-snippets/aborting_execution.cf index c06104845..967e7336a 100644 --- a/content/examples/example-snippets/aborting_execution.cf +++ b/content/examples/example-snippets/aborting_execution.cf @@ -4,13 +4,11 @@ body common control version => "1.2.3"; } -########################################### body agent control { abortbundleclasses => { "invalid.Hr16" }; } -########################################### bundle agent testbundle { vars: @@ -21,7 +19,6 @@ bundle agent testbundle "any" usebundle => subtest("$(userlist)"); } -########################################### bundle agent subtest(user) { classes: diff --git a/content/examples/example-snippets/acl_file_example.cf b/content/examples/example-snippets/acl_file_example.cf index 6d4460931..d55fc91f9 100644 --- a/content/examples/example-snippets/acl_file_example.cf +++ b/content/examples/example-snippets/acl_file_example.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "acls" }; } -######################################### bundle agent acls { files: @@ -12,7 +11,6 @@ bundle agent acls acl => template; } -######################################### body acl template { acl_method => "overwrite"; @@ -23,7 +21,6 @@ body acl template }; } -######################################### body acl win { acl_method => "overwrite"; @@ -32,7 +29,6 @@ body acl win aces => { "user:Administrator:rw", "group:Bad:rwx(Dpo):deny" }; } -######################################### body depth_search include_base { include_basedir => "true"; diff --git a/content/examples/example-snippets/acl_generic_example.cf b/content/examples/example-snippets/acl_generic_example.cf index cf759a7a1..da50e18cb 100644 --- a/content/examples/example-snippets/acl_generic_example.cf +++ b/content/examples/example-snippets/acl_generic_example.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "acls" }; } -######################################### bundle agent acls { files: @@ -12,14 +11,12 @@ bundle agent acls acl => test; } -######################################### body acl test { acl_type => "generic"; aces => { "user:bob:rwx", "group:staff:rx", "all:r" }; } -######################################### body depth_search include_base { include_basedir => "true"; diff --git a/content/examples/example-snippets/acl_secret_example.cf b/content/examples/example-snippets/acl_secret_example.cf index 14955e5a0..da880be78 100644 --- a/content/examples/example-snippets/acl_secret_example.cf +++ b/content/examples/example-snippets/acl_secret_example.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "acls" }; } -######################################### bundle agent acls { files: @@ -14,14 +13,12 @@ bundle agent acls comment => "Secure the secret directory from unauthorized access"; } -######################################### body acl win { acl_method => "overwrite"; aces => { "user:Administrator:rwx" }; } -######################################### body depth_search include_base { include_basedir => "true"; diff --git a/content/examples/example-snippets/active_directory_example.cf b/content/examples/example-snippets/active_directory_example.cf index e3d277624..b54e8acad 100644 --- a/content/examples/example-snippets/active_directory_example.cf +++ b/content/examples/example-snippets/active_directory_example.cf @@ -1,12 +1,9 @@ -######################################################################### # active_directory.cf - Extract Data From Windows Domain Controllers # # NOTE: Since we don't supply any credentials in this policy file, # the Domain Controller must allow anonymous bind. Also, # the user "NT AUTHORITY\ANONYMOUS LOGON" must be granted access # to the resources we want to read. -# -######################################################################### bundle agent active_directory { vars: diff --git a/content/examples/example-snippets/add_lines_to_a_file.cf b/content/examples/example-snippets/add_lines_to_a_file.cf index 7a9c1194a..54224710c 100644 --- a/content/examples/example-snippets/add_lines_to_a_file.cf +++ b/content/examples/example-snippets/add_lines_to_a_file.cf @@ -4,7 +4,6 @@ body common control bundlesequence => { "insert" }; } -####################################################### bundle agent insert { vars: diff --git a/content/examples/example-snippets/add_lines_to_a_file_1.cf b/content/examples/example-snippets/add_lines_to_a_file_1.cf index 2df7b6192..1d4674cc4 100644 --- a/content/examples/example-snippets/add_lines_to_a_file_1.cf +++ b/content/examples/example-snippets/add_lines_to_a_file_1.cf @@ -4,7 +4,6 @@ body common control bundlesequence => { "insert" }; } -####################################################### bundle agent insert { vars: diff --git a/content/examples/example-snippets/add_software_packages_to_the_system.cf b/content/examples/example-snippets/add_software_packages_to_the_system.cf index 98fc30631..9edefa480 100644 --- a/content/examples/example-snippets/add_software_packages_to_the_system.cf +++ b/content/examples/example-snippets/add_software_packages_to_the_system.cf @@ -5,7 +5,6 @@ body common control bundlesequence => { "packages" }; } -############################################# bundle agent packages { vars: diff --git a/content/examples/example-snippets/all_hosts_the_same.cf b/content/examples/example-snippets/all_hosts_the_same.cf index b30b1ede3..f834c5b79 100644 --- a/content/examples/example-snippets/all_hosts_the_same.cf +++ b/content/examples/example-snippets/all_hosts_the_same.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "central" }; } -############################################ bundle agent central { vars: @@ -27,9 +26,7 @@ bundle agent central # Add more promises below ... } -######################################################### # Server config -######################################################### body server control { allowconnects => { "127.0.0.1", "::1", "10.20.30.0/24" }; @@ -38,7 +35,6 @@ body server control # allowusers } -######################################################### bundle server my_access_rules() { access: diff --git a/content/examples/example-snippets/application_baseline.cf b/content/examples/example-snippets/application_baseline.cf index 50d20b30d..a8c9f7fa4 100644 --- a/content/examples/example-snippets/application_baseline.cf +++ b/content/examples/example-snippets/application_baseline.cf @@ -1,13 +1,9 @@ -######################################################################### -# # app_baseline.cf - Verify Existence of Applications # # NOTE: Sometimes applications are not correctly installed even # though the native package manager reports them to be. # CFEngine can check for application-specific configuration # and act upon or report any anomalies. -# -######################################################################### bundle agent app_baseline { methods: diff --git a/content/examples/example-snippets/back_references_in_filenames.cf b/content/examples/example-snippets/back_references_in_filenames.cf index 3f3fe74e2..46d5d0cfd 100644 --- a/content/examples/example-snippets/back_references_in_filenames.cf +++ b/content/examples/example-snippets/back_references_in_filenames.cf @@ -1,15 +1,10 @@ -###################################################################### -# # File editing - back reference -# -###################################################################### body common control { version => "1.2.3"; bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -23,7 +18,6 @@ bundle agent testbundle # edit_line => myedit("second $(match.1)"); } -######################################################## bundle edit_line myedit(parameter) { vars: diff --git a/content/examples/example-snippets/change_detection.cf b/content/examples/example-snippets/change_detection.cf index bb9918aa6..31dc31e4e 100644 --- a/content/examples/example-snippets/change_detection.cf +++ b/content/examples/example-snippets/change_detection.cf @@ -4,7 +4,6 @@ body common control inputs => { "cfengine_stdlib.cf" }; } -######################################################## bundle agent testbundle { files: diff --git a/content/examples/example-snippets/change_directory_for_command.cf b/content/examples/example-snippets/change_directory_for_command.cf index d50b9430a..31de93f7a 100644 --- a/content/examples/example-snippets/change_directory_for_command.cf +++ b/content/examples/example-snippets/change_directory_for_command.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "example" }; } -########################################################### body contain cd(dir) { chdir => "${dir}"; diff --git a/content/examples/example-snippets/check_filesystem_space.cf b/content/examples/example-snippets/check_filesystem_space.cf index cb36f6437..7054f6d1f 100644 --- a/content/examples/example-snippets/check_filesystem_space.cf +++ b/content/examples/example-snippets/check_filesystem_space.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "example" }; } -########################################################### bundle agent example { vars: diff --git a/content/examples/example-snippets/class_match_example.cf b/content/examples/example-snippets/class_match_example.cf index dc47a5cc3..ba1b88f65 100644 --- a/content/examples/example-snippets/class_match_example.cf +++ b/content/examples/example-snippets/class_match_example.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "example" }; } -########################################################### bundle agent example { classes: diff --git a/content/examples/example-snippets/client-server_example.cf b/content/examples/example-snippets/client-server_example.cf index d5c84bd69..071dbcd6e 100644 --- a/content/examples/example-snippets/client-server_example.cf +++ b/content/examples/example-snippets/client-server_example.cf @@ -1,16 +1,11 @@ -######################################################## -# # Simple test copy from server connection to cfServer # -######################################################## -# # run this as follows: # # cf-serverd -f runtest_1.cf [-v] # cf-agent -f runtest_2.cf # # Notice that the same file configures all parts of cfengine -######################################################## body common control { bundlesequence => { "testbundle" }; @@ -18,7 +13,6 @@ body common control #fips_mode => "true"; } -######################################################## bundle agent testbundle { files: @@ -41,19 +35,16 @@ bundle agent testbundle "Files were copied.."; } -######################################################### body perms system { mode => "0644"; } -######################################################### body depth_search recurse(d) { depth => "$(d)"; } -######################################################### body copy_from mycopy(from, server) { source => "$(from)"; @@ -69,16 +60,13 @@ body copy_from mycopy(from, server) trustkey => "true"; } -######################################################### body classes satisfied(x) { promise_repaired => { "$(x)" }; persist_time => "0"; } -######################################################### # Server config -######################################################### body server control { allowconnects => { "127.0.0.1", "::1" }; @@ -87,7 +75,6 @@ body server control # allowusers } -######################################################### bundle server my_access_rules() { access: diff --git a/content/examples/example-snippets/commenting_lines_in_a_file.cf b/content/examples/example-snippets/commenting_lines_in_a_file.cf index a8b9e9a31..18e3e38fe 100644 --- a/content/examples/example-snippets/commenting_lines_in_a_file.cf +++ b/content/examples/example-snippets/commenting_lines_in_a_file.cf @@ -1,13 +1,9 @@ -###################################################################### -# # File editing # # Normal ordering: # - delete # - replace | column_edit # - insert -# -###################################################################### body common control { version => "1.2.3"; @@ -15,7 +11,6 @@ body common control bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -24,7 +19,6 @@ bundle agent testbundle edit_line => myedit("second"); } -######################################################## bundle edit_line myedit(parameter) { vars: @@ -37,9 +31,7 @@ bundle edit_line myedit(parameter) select_region => MySection("New section"); } -######################################## # Bodies -######################################## body replace_with C_comment { # backreference 0: @@ -48,25 +40,19 @@ body replace_with C_comment occurrences => "all"; } -######################################################## body select_region MySection(x) { select_start => "\[$(x)\]"; select_end => "\[.*\]"; } -###################################################################### -# # Comment lines -# -###################################################################### body common control { version => "1.2.3"; bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -75,7 +61,6 @@ bundle agent testbundle edit_line => comment_lines_matching; } -######################################################## bundle edit_line comment_lines_matching { vars: @@ -85,20 +70,14 @@ bundle edit_line comment_lines_matching "^($(regexes))$" replace_with => comment("# "); } -######################################## # Bodies -######################################## body replace_with comment(c) { replace_value => "$(c) $(match.1)"; occurrences => "all"; } -###################################################################### -# # Uncomment lines -# -###################################################################### body common control { version => "1.2.3"; @@ -110,7 +89,6 @@ body common control # two # mark one #mark two -######################################################## bundle agent testbundle { files: @@ -119,14 +97,12 @@ bundle agent testbundle edit_line => uncomment_lines_matching("\s*mark.*", "#"); } -######################################################## bundle edit_line uncomment_lines_matching(regex, comment) { replace_patterns: "#($(regex))$" replace_with => uncomment; } -######################################################## body replace_with uncomment { replace_value => "$(match.1)"; diff --git a/content/examples/example-snippets/copy_and_flatten_directory.cf b/content/examples/example-snippets/copy_and_flatten_directory.cf index 9593f160f..13f5a303a 100644 --- a/content/examples/example-snippets/copy_and_flatten_directory.cf +++ b/content/examples/example-snippets/copy_and_flatten_directory.cf @@ -1,23 +1,17 @@ -######################################################## -# # Simple test copy from server connection to cfServer # -######################################################## -# # run this as follows: # # cf-serverd -f runtest_1.cf [-d2] # cf-agent -f runtest_2.cf # # Notice that the same file configures all parts of cfengine -######################################################## body common control { bundlesequence => { "testbundle" }; version => "1.2.3"; } -######################################################## bundle agent testbundle { files: @@ -40,19 +34,16 @@ bundle agent testbundle "Files were copied.."; } -######################################################### body perms system { mode => "0644"; } -######################################################### body depth_search recurse(d) { depth => "$(d)"; } -######################################################### body copy_from mycopy(from, server) { source => "$(from)"; @@ -68,16 +59,13 @@ body copy_from mycopy(from, server) collapse_destination_dir => "true"; } -######################################################### body classes satisfied(x) { promise_repaired => { "$(x)" }; persist_time => "0"; } -######################################################### # Server config -######################################################### body server control { allowconnects => { "127.0.0.1", "::1" }; @@ -85,7 +73,6 @@ body server control trustkeysfrom => { "127.0.0.1", "::1" }; } -######################################################### bundle server my_access_rules() { access: diff --git a/content/examples/example-snippets/create_files_and_directories.cf b/content/examples/example-snippets/create_files_and_directories.cf index 11996e376..7f85c0e68 100644 --- a/content/examples/example-snippets/create_files_and_directories.cf +++ b/content/examples/example-snippets/create_files_and_directories.cf @@ -1,14 +1,9 @@ -######################################################## -# # Simple test create files -# -######################################################## body common control { bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -21,10 +16,7 @@ bundle agent testbundle create => "true"; } -######################################################### body perms system { mode => "0640"; } - -######################################################### diff --git a/content/examples/example-snippets/custom_editing_1.cf b/content/examples/example-snippets/custom_editing_1.cf index 6cdbb6fbb..8a4977e8a 100644 --- a/content/examples/example-snippets/custom_editing_1.cf +++ b/content/examples/example-snippets/custom_editing_1.cf @@ -1,14 +1,9 @@ -####################################################### -# # Edit variable = value in a text file -# -####################################################### body common control { bundlesequence => { "testsetvar" }; } -####################################################### bundle agent testsetvar { vars: diff --git a/content/examples/example-snippets/database_creation.cf b/content/examples/example-snippets/database_creation.cf index 58b58d4c1..f3dadfd5f 100644 --- a/content/examples/example-snippets/database_creation.cf +++ b/content/examples/example-snippets/database_creation.cf @@ -36,7 +36,6 @@ bundle agent databases database_server => myserver; } -################################################ body database_server myserver { none:: diff --git a/content/examples/example-snippets/deleting_lines_exception.cf b/content/examples/example-snippets/deleting_lines_exception.cf index 4744612e3..490d2f6f0 100644 --- a/content/examples/example-snippets/deleting_lines_exception.cf +++ b/content/examples/example-snippets/deleting_lines_exception.cf @@ -1,9 +1,5 @@ -######################################################## -# # Simple test editfile # -######################################################## -# # This assumes a file format like: # # [section 1] @@ -18,7 +14,6 @@ body common control bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -27,7 +22,6 @@ bundle agent testbundle edit_line => mark_n_root; } -######################################################## bundle edit_line mark_n_root { delete_lines: diff --git a/content/examples/example-snippets/deleting_lines_from_a_file.cf b/content/examples/example-snippets/deleting_lines_from_a_file.cf index b4efa1734..3747ebf4f 100644 --- a/content/examples/example-snippets/deleting_lines_from_a_file.cf +++ b/content/examples/example-snippets/deleting_lines_from_a_file.cf @@ -13,9 +13,7 @@ bundle agent test edit_defaults => def; } -####################################################### # For the library -####################################################### bundle edit_line resolver { vars: @@ -29,7 +27,6 @@ bundle edit_line resolver "$(search)" location => end; } -####################################################### body edit_defaults def { empty_file_before_editing => "false"; @@ -37,14 +34,12 @@ body edit_defaults def max_file_size => "100000"; } -######################################################## body location start { # If not line to match, applies to whole text body before_after => "before"; } -######################################################## body location end { # If not line to match, applies to whole text body diff --git a/content/examples/example-snippets/distribute_root_passwords.cf b/content/examples/example-snippets/distribute_root_passwords.cf index 1ef1149bd..302f6bb12 100644 --- a/content/examples/example-snippets/distribute_root_passwords.cf +++ b/content/examples/example-snippets/distribute_root_passwords.cf @@ -1,8 +1,4 @@ -###################################################################### -# # Root password distribution -# -###################################################################### body common control { version => "1.2.3"; @@ -10,14 +6,12 @@ body common control bundlesequence => { "set_root_password" }; } -######################################################## bundle common g { vars: "secret_keys_dir" string => "/tmp"; } -######################################################## bundle agent set_root_password { vars: @@ -36,7 +30,6 @@ bundle agent set_root_password "/tmp/shadow" edit_line => set_root_password; } -######################################################## bundle edit_line set_root_password { vars: @@ -51,7 +44,6 @@ bundle edit_line set_root_password "root:.*" edit_field => col(":", "2", "$(rpw[root][1])", "set"); } -######################################################## bundle server passwords { vars: diff --git a/content/examples/example-snippets/distribute_ssh_keys.cf b/content/examples/example-snippets/distribute_ssh_keys.cf index 156ec976a..41c464d3e 100644 --- a/content/examples/example-snippets/distribute_ssh_keys.cf +++ b/content/examples/example-snippets/distribute_ssh_keys.cf @@ -8,8 +8,6 @@ # methods: # # "any" usebundle => allow_ssh_login_from_authorized_keys(@(users),"sourcehost"); -# -######################################################################## bundle agent allow_ssh_rootlogin_from_authorized_keys(user, sourcehost) { vars: @@ -33,7 +31,6 @@ bundle agent allow_ssh_rootlogin_from_authorized_keys(user, sourcehost) action => if_elapsed("60"); } -######################################################################## bundle agent allow_ssh_login_from_authorized_keys(user, sourcehost) { vars: @@ -57,7 +54,6 @@ bundle agent allow_ssh_login_from_authorized_keys(user, sourcehost) action => if_elapsed("60"); } -######################################################################## bundle edit_line insert_file_if_no_line_matching(user, file) { classes: diff --git a/content/examples/example-snippets/editing_files.cf b/content/examples/example-snippets/editing_files.cf index e64b2b08b..1c1a2d8e8 100644 --- a/content/examples/example-snippets/editing_files.cf +++ b/content/examples/example-snippets/editing_files.cf @@ -1,8 +1,4 @@ -###################################################################### -# # Comment lines -# -###################################################################### body common control { version => "1.2.3"; @@ -10,7 +6,6 @@ body common control inputs => { "$(sys.libdir)/stdlib.cf" }; } -######################################################## bundle agent testbundle { vars: diff --git a/content/examples/example-snippets/editing_password_or_group_files_custom.cf b/content/examples/example-snippets/editing_password_or_group_files_custom.cf index abafee481..75b50a816 100644 --- a/content/examples/example-snippets/editing_password_or_group_files_custom.cf +++ b/content/examples/example-snippets/editing_password_or_group_files_custom.cf @@ -17,9 +17,7 @@ bundle agent addpasswd edit_line => append_users_starting("addpasswd.pwd"); } -############################################################ # Library stuff -############################################################ bundle edit_line append_users_starting(v) { vars: @@ -32,7 +30,6 @@ bundle edit_line append_users_starting(v) "$($(v)[$(index)])" if => "add_$(index)"; } -############################################################ bundle edit_line append_groups_starting(v) { vars: diff --git a/content/examples/example-snippets/editing_tabular_files.cf b/content/examples/example-snippets/editing_tabular_files.cf index c87fda130..42aef46fb 100644 --- a/content/examples/example-snippets/editing_tabular_files.cf +++ b/content/examples/example-snippets/editing_tabular_files.cf @@ -1,20 +1,15 @@ -###################################################################### -# # File editing # # Normal ordering: # - delete # - replace | column_edit # - insert -# -###################################################################### body common control { version => "1.2.3"; bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { vars: @@ -34,14 +29,12 @@ bundle agent testbundle "/bin/echo" args => $(userset); } -######################################################## bundle edit_line set_user_param(user, field, val) { field_edits: "$(user):.*" edit_field => col(":", "$(field)", "$(val)", "set"); } -######################################################## bundle edit_line append_user_param(user, field, allusers) { vars: @@ -51,9 +44,7 @@ bundle edit_line append_user_param(user, field, allusers) "$(user):.*" edit_field => col(":", "$(field)", "$(val)", "alphanum"); } -######################################## # Bodies -######################################## body edit_field col(split, col, newval, method) { field_separator => $(split); diff --git a/content/examples/example-snippets/environment_variables.cf b/content/examples/example-snippets/environment_variables.cf index 4cb5b8b99..727335253 100644 --- a/content/examples/example-snippets/environment_variables.cf +++ b/content/examples/example-snippets/environment_variables.cf @@ -1,14 +1,9 @@ -####################################################### -# # Virtual environments -# -####################################################### body common control { bundlesequence => { "my_vm_cloud" }; } -####################################################### bundle agent my_vm_cloud { environments: @@ -20,7 +15,6 @@ bundle agent my_vm_cloud # default environment_state => "create" on host, and "suspended elsewhere" } -####################################################### body environment_resources virt_xml { env_spec_file => "/srv/xen/centos5-libvirt-create.xml"; diff --git a/content/examples/example-snippets/environments_(virtual).cf b/content/examples/example-snippets/environments_(virtual).cf index c0d031be2..292573108 100644 --- a/content/examples/example-snippets/environments_(virtual).cf +++ b/content/examples/example-snippets/environments_(virtual).cf @@ -1,14 +1,9 @@ -####################################################### -# # Virtual environments -# -####################################################### body common control { bundlesequence => { "my_vm_cloud" }; } -####################################################### bundle agent my_vm_cloud { vars: @@ -26,13 +21,11 @@ bundle agent my_vm_cloud # default environment_state => "create" on host, and "suspended elsewhere" } -####################################################### body environment_resources virt_xml(specfile) { env_spec_file => "$(specfile)"; } -####################################################### body environment_interface vnet(primary) { env_name => "$(this.promiser)"; diff --git a/content/examples/example-snippets/execresult_example.cf b/content/examples/example-snippets/execresult_example.cf index c0a66db8c..39c443254 100644 --- a/content/examples/example-snippets/execresult_example.cf +++ b/content/examples/example-snippets/execresult_example.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "example" }; } -########################################################### bundle agent example { vars: diff --git a/content/examples/example-snippets/get_a_list_of_users.cf b/content/examples/example-snippets/get_a_list_of_users.cf index 68a1734d8..1560f6c93 100644 --- a/content/examples/example-snippets/get_a_list_of_users.cf +++ b/content/examples/example-snippets/get_a_list_of_users.cf @@ -1,14 +1,9 @@ -####################################################### -# # GetUsers -# -####################################################### body common control { bundlesequence => { test }; } -####################################################### bundle agent test { vars: diff --git a/content/examples/example-snippets/global_classes.cf b/content/examples/example-snippets/global_classes.cf index 55b67c6c9..2c591a33f 100644 --- a/content/examples/example-snippets/global_classes.cf +++ b/content/examples/example-snippets/global_classes.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "g", "tryclasses_1", "tryclasses_2" }; } -################################# bundle common g { classes: @@ -11,14 +10,12 @@ bundle common g "client_network" expression => iprange("128.39.89.0/24"); } -################################# bundle agent tryclasses_1 { classes: "two" expression => "any"; } -################################# bundle agent tryclasses_2 { classes: @@ -35,7 +32,6 @@ body common control bundlesequence => { "g", "tryclasses_1", "tryclasses_2" }; } -################################# bundle common g { classes: @@ -43,14 +39,12 @@ bundle common g "client_network" expression => iprange("128.39.89.0/24"); } -################################# bundle agent tryclasses_1 { classes: "two" expression => "any"; } -################################# bundle agent tryclasses_2 { classes: @@ -60,5 +54,3 @@ bundle agent tryclasses_2 one.three.!two:: "Success"; } - -################################# diff --git a/content/examples/example-snippets/hashing_for_change_detection_(tripwire).cf b/content/examples/example-snippets/hashing_for_change_detection_(tripwire).cf index 92058b9c3..15eb91ae8 100644 --- a/content/examples/example-snippets/hashing_for_change_detection_(tripwire).cf +++ b/content/examples/example-snippets/hashing_for_change_detection_(tripwire).cf @@ -1,15 +1,10 @@ -######################################################## -# # Change detect -# -######################################################## body common control { bundlesequence => { "testbundle" }; inputs => { "$(sys.libdir)/stdlib.cf" }; } -######################################################## bundle agent testbundle { files: diff --git a/content/examples/example-snippets/inserting_lines_in_a_file.cf b/content/examples/example-snippets/inserting_lines_in_a_file.cf index bf892f569..473cd5f2a 100644 --- a/content/examples/example-snippets/inserting_lines_in_a_file.cf +++ b/content/examples/example-snippets/inserting_lines_in_a_file.cf @@ -1,15 +1,10 @@ -####################################################### -# # Insert a number of lines with vague whitespace -# -####################################################### body common control { any:: bundlesequence => { "insert" }; } -####################################################### bundle agent insert { vars: @@ -21,33 +16,25 @@ bundle agent insert edit_line => insert_name("$(insert.v)"); } -####################################################### # For the library -####################################################### bundle edit_line insert_name(name) { insert_lines: " $(name)" whitespace_policy => { "ignore_leading", "ignore_embedded" }; } -####################################################### body edit_defaults empty { empty_file_before_editing => "true"; } -####################################################### -# # Insert a number of lines -# -####################################################### body common control { any:: bundlesequence => { "insert" }; } -####################################################### bundle agent insert { vars: @@ -66,33 +53,25 @@ bundle agent insert edit_defaults => empty; } -####################################################### # For the library -####################################################### bundle edit_line insert_name(name) { insert_lines: "Begin$(const.n)$(name)$(const.n)End"; } -####################################################### body edit_defaults empty { empty_file_before_editing => "false"; } -####################################################### -# # Insert a number of lines -# -####################################################### body common control { any:: bundlesequence => { "insert" }; } -####################################################### bundle agent insert { vars: @@ -106,16 +85,13 @@ bundle agent insert # edit_defaults => empty; } -####################################################### # For the library -####################################################### bundle edit_line insert_name(name) { insert_lines: "$(name)"; } -####################################################### body edit_defaults empty { empty_file_before_editing => "true"; diff --git a/content/examples/example-snippets/laptop_support_configuration.cf b/content/examples/example-snippets/laptop_support_configuration.cf index cbaf305ae..6b6190f9a 100644 --- a/content/examples/example-snippets/laptop_support_configuration.cf +++ b/content/examples/example-snippets/laptop_support_configuration.cf @@ -1,28 +1,21 @@ -####################################################### -# # Laptop -# -####################################################### body common control { bundlesequence => { "update", "garbage_collection", "main", "backup" }; inputs => { "update.cf", "site.cf", "library.cf" }; } -####################################################### body agent control { # if default runtime is 5 mins we need this for long jobs ifelapsed => "15"; } -####################################################### body monitor control { forgetrate => "0.7"; } -####################################################### body executor control { splaytime => "1"; @@ -33,15 +26,12 @@ body executor control exec_command => "$(sys.workdir)/bin/cf-agent -f failsafe.cf && $(sys.workdir)/bin/cf-agent"; } -####################################################### # General site issues can be in bundles like this one -####################################################### bundle agent main { vars: "component" slist => { "cf-monitord", "cf-serverd" }; - # - - - - - - - - - - - - - - - - - - - - - - - - files: "$(sys.resolv)" # test on "/tmp/resolv.conf" # @@ -52,15 +42,12 @@ bundle agent main processes: "$(component)" restart_class => canonify("$(component)_not_running"); - # - - - - - - - - - - - - - - - - - - - - - - - - commands: "$(sys.workdir)/bin/$(component)" if => canonify("$(component)_not_running"); } -####################################################### # Backup -####################################################### bundle agent backup { files: @@ -71,9 +58,7 @@ bundle agent backup action => longjob; } -####################################################### # Garbage collection issues -####################################################### bundle agent garbage_collection { files: diff --git a/content/examples/example-snippets/ldap_interactions.cf b/content/examples/example-snippets/ldap_interactions.cf index af136173b..edef983c4 100644 --- a/content/examples/example-snippets/ldap_interactions.cf +++ b/content/examples/example-snippets/ldap_interactions.cf @@ -3,11 +3,9 @@ body common control bundlesequence => { "ldap", "followup" }; } -################################################################################################### # NOTE!! relying on LDAP or other network data without validation is EXTREMELY dangerous. # You could destroy a system by assuming that the service will respond with a # sensible result. CFEngine does not recommend reliance on network services in configuration. -################################################################################################### bundle agent ldap { vars: diff --git a/content/examples/example-snippets/linking_files.cf b/content/examples/example-snippets/linking_files.cf index 6414a5370..ff79487bc 100644 --- a/content/examples/example-snippets/linking_files.cf +++ b/content/examples/example-snippets/linking_files.cf @@ -1,20 +1,15 @@ -###################################################################### -# # File editing # # Normal ordering: # - delete # - replace | column_edit # - insert -# -###################################################################### body common control { version => "1.2.3"; bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -26,7 +21,6 @@ bundle agent testbundle "/home/mark/tmp/linktest" link_from => linkchildren("/usr/local/sbin"); } -######################################################### body link_from linkdetails(tofile) { source => "$(tofile)"; @@ -35,7 +29,6 @@ body link_from linkdetails(tofile) when_no_source => "force"; } -######################################################### body link_from linkchildren(tofile) { source => "$(tofile)"; @@ -46,18 +39,13 @@ body link_from linkchildren(tofile) when_linking_children => "if_no_such_file"; } -####################################################### -# # Test dead link removal -# -####################################################### body common control { any:: bundlesequence => { "testbundle" }; } -############################################ bundle agent testbundle { files: @@ -67,20 +55,17 @@ bundle agent testbundle action => tell_me; } -############################################ body depth_search recurse(d) { rmdeadlinks => "true"; depth => "$(d)"; } -############################################ body perms modestuff { mode => "o-w"; } -############################################ body action tell_me { report_level => "inform"; diff --git a/content/examples/example-snippets/listing_files-pattern_in_a_directory.cf b/content/examples/example-snippets/listing_files-pattern_in_a_directory.cf index db817a91d..ba1c439b1 100644 --- a/content/examples/example-snippets/listing_files-pattern_in_a_directory.cf +++ b/content/examples/example-snippets/listing_files-pattern_in_a_directory.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "example" }; } -########################################################### bundle agent example { vars: diff --git a/content/examples/example-snippets/locate_and_transform_files.cf b/content/examples/example-snippets/locate_and_transform_files.cf index 6f210a3ba..a2a9ef883 100644 --- a/content/examples/example-snippets/locate_and_transform_files.cf +++ b/content/examples/example-snippets/locate_and_transform_files.cf @@ -1,8 +1,4 @@ -####################################################### -# # Compressing files -# -####################################################### body common control { any:: @@ -10,7 +6,6 @@ body common control version => "1.2.3"; } -############################################ bundle agent testbundle { files: @@ -20,14 +15,12 @@ bundle agent testbundle depth_search => recurse("inf"); } -############################################ body file_select pdf_files { leaf_name => { ".*.pdf", ".*.fdf" }; file_result => "leaf_name"; } -############################################ body depth_search recurse(d) { depth => "$(d)"; diff --git a/content/examples/example-snippets/log_rotation.cf b/content/examples/example-snippets/log_rotation.cf index 9473b62f1..54863a410 100644 --- a/content/examples/example-snippets/log_rotation.cf +++ b/content/examples/example-snippets/log_rotation.cf @@ -3,14 +3,12 @@ body common control bundlesequence => { "testbundle" }; } -############################################ bundle agent testbundle { files: "/home/mark/tmp/rotateme" rename => rotate("4"); } -############################################ body rename rotate(level) { rotate => "$(level)"; diff --git a/content/examples/example-snippets/measurements.cf b/content/examples/example-snippets/measurements.cf index c0cf24196..029415193 100644 --- a/content/examples/example-snippets/measurements.cf +++ b/content/examples/example-snippets/measurements.cf @@ -1,25 +1,20 @@ #cop measurements,example -####################################################### # # Test file: # # First line # Blonk blonk bnklkygsuilnm -# -####################################################### body common control { bundlesequence => { "report" }; } -####################################################### body monitor control { forgetrate => "0.7"; histograms => "true"; } -####################################################### bundle agent report { reports: @@ -29,7 +24,6 @@ bundle agent report "; } -####################################################### bundle monitor watch { measurements: @@ -75,41 +69,35 @@ bundle monitor watch history_type => "log"; } -########################################################## body match_value scanlines(x) { select_line_matching => "^$(x)$"; } -########################################################## body action sample_min(x) { ifelapsed => $(x); expireafter => $(x); } -########################################################## body match_value find_blonks { select_line_number => "2"; extraction_regex => "Blonk blonk ([blonk]+).*"; } -########################################################## body match_value free_memory { select_line_matching => "MemFree:.*"; extraction_regex => "MemFree:\s+([0-9]+).*"; } -########################################################## body match_value proc_value(x, y) { select_line_matching => $(x); extraction_regex => $(y); } -########################################################## body match_value file_system { select_line_matching => "/.*"; diff --git a/content/examples/example-snippets/method_validation.cf b/content/examples/example-snippets/method_validation.cf index 3a4987d85..7bd4cd3e0 100644 --- a/content/examples/example-snippets/method_validation.cf +++ b/content/examples/example-snippets/method_validation.cf @@ -4,13 +4,11 @@ body common control version => "1.2.3"; } -########################################### body agent control { abortbundleclasses => { "invalid" }; } -########################################### bundle agent testbundle { vars: @@ -21,7 +19,6 @@ bundle agent testbundle "any" usebundle => subtest("$(userlist)"); } -########################################### bundle agent subtest(user) { classes: diff --git a/content/examples/example-snippets/methods.cf b/content/examples/example-snippets/methods.cf index d03fcea6d..0a19ff757 100644 --- a/content/examples/example-snippets/methods.cf +++ b/content/examples/example-snippets/methods.cf @@ -4,7 +4,6 @@ body common control version => "1.2.3"; } -########################################### bundle agent testbundle { vars: @@ -14,7 +13,6 @@ bundle agent testbundle "any" usebundle => subtest("$(userlist)"); } -########################################### bundle agent subtest(user) { commands: diff --git a/content/examples/example-snippets/mount_a_filesystem.cf b/content/examples/example-snippets/mount_a_filesystem.cf index 2246750e2..bbe47fde2 100644 --- a/content/examples/example-snippets/mount_a_filesystem.cf +++ b/content/examples/example-snippets/mount_a_filesystem.cf @@ -12,7 +12,6 @@ bundle agent mounts "/mnt" mount => nfs("slogans.iu.hio.no", "/home"); } -###################################################################### body mount nfs(server, source) { mount_type => "nfs"; diff --git a/content/examples/example-snippets/mount_nfs_filesystem.cf b/content/examples/example-snippets/mount_nfs_filesystem.cf index 2246750e2..bbe47fde2 100644 --- a/content/examples/example-snippets/mount_nfs_filesystem.cf +++ b/content/examples/example-snippets/mount_nfs_filesystem.cf @@ -12,7 +12,6 @@ bundle agent mounts "/mnt" mount => nfs("slogans.iu.hio.no", "/home"); } -###################################################################### body mount nfs(server, source) { mount_type => "nfs"; diff --git a/content/examples/example-snippets/ordering_promises.cf b/content/examples/example-snippets/ordering_promises.cf index d736650e4..d89036a0f 100644 --- a/content/examples/example-snippets/ordering_promises.cf +++ b/content/examples/example-snippets/ordering_promises.cf @@ -1,18 +1,13 @@ -################################################################## -# # cfengine 3 - ordering promises into dependent chains # ## # # cf-agent -f ./cftest.cf -K -# -################################################################## body common control { bundlesequence => { "order" }; } -################################################################## bundle agent order { vars: @@ -34,7 +29,6 @@ bundle agent order "/bin/echo seven"; } -############################################ body classes d(if, else) { promise_repaired => { "$(if)" }; diff --git a/content/examples/example-snippets/postfix_mail_configuration.cf b/content/examples/example-snippets/postfix_mail_configuration.cf index ee26b1fda..f3c73f00c 100644 --- a/content/examples/example-snippets/postfix_mail_configuration.cf +++ b/content/examples/example-snippets/postfix_mail_configuration.cf @@ -1,15 +1,10 @@ -####################################################### -# # Postfix -# -####################################################### body common control { inputs => { "$(sys.libdir)/stdlib.cf" }; bundlesequence => { postfix }; } -####################################################### bundle agent postfix { vars: @@ -28,9 +23,7 @@ bundle agent postfix ); } -####################################################### # For the library -####################################################### bundle edit_line prefix_postfix { # Value have the form NAME = "quoted space separated list" @@ -53,7 +46,6 @@ bundle edit_line prefix_postfix "$(parameter_name) = $(ps[$(parameter_name)])"; } -######################################################## bundle edit_line append_if_nsl(parameter) { insert_lines: diff --git a/content/examples/example-snippets/process_management.cf b/content/examples/example-snippets/process_management.cf index 275a131d3..1e05ce3a4 100644 --- a/content/examples/example-snippets/process_management.cf +++ b/content/examples/example-snippets/process_management.cf @@ -9,17 +9,12 @@ bundle agent test "sleep" signals => { "term", "kill" }; } -######################################################## -# # Simple test processes -# -######################################################## body common control { bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { processes: @@ -30,7 +25,6 @@ bundle agent testbundle "Out of control"; } -######################################################## body process_count up(s) { match_range => "5,10"; @@ -38,17 +32,12 @@ body process_count up(s) out_of_range_define => { "$(s)_out_of_control" }; } -######################################################## -# # Simple test processes -# -######################################################## body common control { bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { processes: @@ -57,7 +46,6 @@ bundle agent testbundle process_count => up("cfservd"); } -######################################################## body process_count up(s) { match_range => "1,10"; @@ -65,24 +53,18 @@ body process_count up(s) out_of_range_define => { "$(s)_out_of_control" }; } -######################################################## body process_select proc_finder(p) { stime_range => irange(ago("0", "0", "0", "2", "0", "0"), now); process_result => "stime"; } -######################################################## -# # Simple test processes -# -######################################################## body common control { bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { processes: @@ -91,7 +73,6 @@ bundle agent testbundle process_count => up("cfservd"); } -######################################################## body process_count up(s) { match_range => "1,10"; @@ -99,7 +80,6 @@ body process_count up(s) out_of_range_define => { "$(s)_out_of_control" }; } -######################################################## body process_select proc_finder(p) { process_owner => { "avahi", "bin" }; @@ -114,7 +94,6 @@ body common control bundlesequence => { "process_restart" }; } -######################################################### bundle agent process_restart { processes: @@ -130,7 +109,6 @@ body common control bundlesequence => { "process_restart" }; } -######################################################### bundle agent process_restart { vars: @@ -143,17 +121,12 @@ bundle agent process_restart "/var/cfengine/bin/$(component)" if => canonify("$(component)_not_running"); } -######################################################## -# # Simple test process restart -# -######################################################## body common control { bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { processes: @@ -169,7 +142,6 @@ bundle agent testbundle "/usr/local/sbin/cfservd"; } -######################################################## body process_count up(s) { match_range => "1,10"; diff --git a/content/examples/example-snippets/prune_processes.cf b/content/examples/example-snippets/prune_processes.cf index 5bceb01d8..9685ac732 100644 --- a/content/examples/example-snippets/prune_processes.cf +++ b/content/examples/example-snippets/prune_processes.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { processes: @@ -12,7 +11,6 @@ bundle agent testbundle signals => { "term" }; } -######################################################## body process_select big_processes(o) { process_owner => { $(o) }; diff --git a/content/examples/example-snippets/read_from_a_tcp_socket.cf b/content/examples/example-snippets/read_from_a_tcp_socket.cf index cf66f1364..c08b099a1 100644 --- a/content/examples/example-snippets/read_from_a_tcp_socket.cf +++ b/content/examples/example-snippets/read_from_a_tcp_socket.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "example" }; } -########################################################### bundle agent example { vars: diff --git a/content/examples/example-snippets/resolver_management.cf b/content/examples/example-snippets/resolver_management.cf index b65f843d3..216ec739a 100644 --- a/content/examples/example-snippets/resolver_management.cf +++ b/content/examples/example-snippets/resolver_management.cf @@ -1,8 +1,4 @@ -####################################################### -# # Resolve conf -# -####################################################### bundle common g # globals { @@ -15,7 +11,6 @@ bundle common g expression => reglist("@(nameservers)", "$(sys.ipv4[eth1])"); } -####################################################### body common control { any:: @@ -23,7 +18,6 @@ body common control domain => "iu.hio.no"; } -####################################################### bundle agent resolver(s, n) { files: @@ -38,9 +32,7 @@ bundle agent resolver(s, n) # or edit_defaults => modify } -####################################################### # For the library -####################################################### bundle edit_line doresolv(s, n) { vars: @@ -50,7 +42,6 @@ bundle edit_line doresolv(s, n) "$(line)"; } -####################################################### body edit_defaults reconstruct { empty_file_before_editing => "true"; @@ -58,7 +49,6 @@ body edit_defaults reconstruct max_file_size => "100000"; } -####################################################### body edit_defaults modify { empty_file_before_editing => "false"; diff --git a/content/examples/example-snippets/restart_process.cf b/content/examples/example-snippets/restart_process.cf index ffa4f1ca5..3565cc068 100644 --- a/content/examples/example-snippets/restart_process.cf +++ b/content/examples/example-snippets/restart_process.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "process_restart" }; } -######################################################### bundle agent process_restart { processes: diff --git a/content/examples/example-snippets/restart_process_1.cf b/content/examples/example-snippets/restart_process_1.cf index c47bf58a0..763f0c331 100644 --- a/content/examples/example-snippets/restart_process_1.cf +++ b/content/examples/example-snippets/restart_process_1.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "process_restart" }; } -######################################################### bundle agent process_restart { vars: diff --git a/content/examples/example-snippets/search_and_replace_text.cf b/content/examples/example-snippets/search_and_replace_text.cf index c788a5ac2..948d1a500 100644 --- a/content/examples/example-snippets/search_and_replace_text.cf +++ b/content/examples/example-snippets/search_and_replace_text.cf @@ -1,20 +1,15 @@ -###################################################################### -# # File editing # # Normal ordering: # - delete # - replace | column_edit # - insert -# -###################################################################### body common control { version => "1.2.3"; bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -23,7 +18,6 @@ bundle agent testbundle edit_line => myedit("second"); } -######################################################## bundle edit_line myedit(parameter) { vars: @@ -34,16 +28,13 @@ bundle edit_line myedit(parameter) "puppet" replace_with => With("cfengine 3"); } -######################################## # Bodies -######################################## body replace_with With(x) { replace_value => $(x); occurrences => "first"; } -######################################## body select_region MySection(x) { select_start => "\[$(x)\]"; diff --git a/content/examples/example-snippets/selecting_a_region_in_a_file.cf b/content/examples/example-snippets/selecting_a_region_in_a_file.cf index 2c4f2dc10..624808ea7 100644 --- a/content/examples/example-snippets/selecting_a_region_in_a_file.cf +++ b/content/examples/example-snippets/selecting_a_region_in_a_file.cf @@ -4,7 +4,6 @@ body common control bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -13,7 +12,6 @@ bundle agent testbundle edit_line => myedit("second"); } -######################################################## bundle edit_line myedit(parameter) { vars: @@ -26,9 +24,7 @@ bundle edit_line myedit(parameter) select_region => ToEnd("Start.*"); } -######################################## # Bodies -######################################## body replace_with comment { replace_value => "# $(match.1)"; @@ -37,7 +33,6 @@ body replace_with comment # first, last all } -######################################################## body select_region ToEnd(x) { select_start => $(x); diff --git a/content/examples/example-snippets/service_management_(windows).cf b/content/examples/example-snippets/service_management_(windows).cf index e5eaf1c0a..87fe925b1 100644 --- a/content/examples/example-snippets/service_management_(windows).cf +++ b/content/examples/example-snippets/service_management_(windows).cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "winservice" }; } -########################################################### bundle agent winservice { vars: diff --git a/content/examples/example-snippets/set_up_a_pxe_boot_server.cf b/content/examples/example-snippets/set_up_a_pxe_boot_server.cf index 2e3dda78d..4e53257ae 100644 --- a/content/examples/example-snippets/set_up_a_pxe_boot_server.cf +++ b/content/examples/example-snippets/set_up_a_pxe_boot_server.cf @@ -399,37 +399,31 @@ enable=1 classes => satisfied("packages_ok"); } -##################################################### ########### *** Bodies are here *** ################# -##################################################### body file_select pxelinux_files { leaf_name => { "pxelinux.0" }; file_result => "leaf_name"; } -##################################################### body copy_from mycopy_local(from, server) { source => "$(from)"; compare => "digest"; } -######################################################### body link_from mylink(x) { source => "$(x)"; link_type => "symlink"; } -####################################################### body classes satisfied(new_class) { promise_kept => { "$(new_class)" }; promise_repaired => { "$(new_class)" }; } -####################################################### bundle edit_line comment_lines_matching_apache2(comment) { vars: @@ -442,11 +436,8 @@ bundle edit_line comment_lines_matching_apache2(comment) "^($(regex))$" replace_with => comment("$(comment)"); } -####################################################### body file_select input_files { leaf_name => { ".*.cf", ".*.dat", ".*.txt" }; file_result => "leaf_name"; } - -####################################################### diff --git a/content/examples/example-snippets/set_up_a_web_server.cf b/content/examples/example-snippets/set_up_a_web_server.cf index 4c1d78bf9..f17882847 100644 --- a/content/examples/example-snippets/set_up_a_web_server.cf +++ b/content/examples/example-snippets/set_up_a_web_server.cf @@ -1,8 +1,4 @@ -##################################################### -# # Apache webserver module -# -##################################################### bundle agent web_server(state) { vars: @@ -58,9 +54,7 @@ bundle agent web_server(state) "off" expression => strcmp("$(state)", "off"); } -####################################################### # For the library -####################################################### bundle edit_line fixapache { vars: diff --git a/content/examples/example-snippets/set_up_hpc_clusters.cf b/content/examples/example-snippets/set_up_hpc_clusters.cf index 2bc541899..f84d9fbb3 100644 --- a/content/examples/example-snippets/set_up_hpc_clusters.cf +++ b/content/examples/example-snippets/set_up_hpc_clusters.cf @@ -1,4 +1,3 @@ -####################################################### body executor control { splaytime => "1"; @@ -9,7 +8,6 @@ body executor control schedule => { "Min00" }; } -####################################################### bundle agent services_disable { vars: @@ -36,7 +34,6 @@ bundle agent services_disable "$(xinetd_services)" signals => { "kill" }; } -############################################################################### bundle agent disable_xinetd(name) { vars: diff --git a/content/examples/example-snippets/set_up_name_resolution.cf b/content/examples/example-snippets/set_up_name_resolution.cf index 37dbcf6ca..080b87aba 100644 --- a/content/examples/example-snippets/set_up_name_resolution.cf +++ b/content/examples/example-snippets/set_up_name_resolution.cf @@ -11,7 +11,6 @@ bundle agent system_files # ...other system files ... } -####################################################### bundle edit_line resolver { delete_lines: diff --git a/content/examples/example-snippets/software_and_patch_installation_1.cf b/content/examples/example-snippets/software_and_patch_installation_1.cf index d7c879876..b6f4f2bcb 100644 --- a/content/examples/example-snippets/software_and_patch_installation_1.cf +++ b/content/examples/example-snippets/software_and_patch_installation_1.cf @@ -4,7 +4,6 @@ body common control bundlesequence => { "packages" }; } -############################################# bundle agent packages { vars: @@ -19,7 +18,6 @@ bundle agent packages package_method => msi_vmatch; } -############################################# body package_method msi_vmatch { package_changes => "individual"; diff --git a/content/examples/example-snippets/software_and_patch_installation_1_2.cf b/content/examples/example-snippets/software_and_patch_installation_1_2.cf index 845ca8bc2..93f054797 100644 --- a/content/examples/example-snippets/software_and_patch_installation_1_2.cf +++ b/content/examples/example-snippets/software_and_patch_installation_1_2.cf @@ -5,7 +5,6 @@ body common control inputs => { "cfengine_stdlib.cf" }; } -############################################# bundle agent packages { vars: diff --git a/content/examples/example-snippets/software_and_patch_installation_1_2_3.cf b/content/examples/example-snippets/software_and_patch_installation_1_2_3.cf index 025986019..5001c29b6 100644 --- a/content/examples/example-snippets/software_and_patch_installation_1_2_3.cf +++ b/content/examples/example-snippets/software_and_patch_installation_1_2_3.cf @@ -5,7 +5,6 @@ body common control inputs => { "cfengine_stdlib.cf" } } -############################################# bundle agent packages { vars: diff --git a/content/examples/example-snippets/software_distribution.cf b/content/examples/example-snippets/software_distribution.cf index dcffcb054..1222b437e 100644 --- a/content/examples/example-snippets/software_distribution.cf +++ b/content/examples/example-snippets/software_distribution.cf @@ -1,5 +1,3 @@ -######################################################################### -# # software_local.cf - Application Deployment From Directory Repository # # NOTE: Windows needs to support WMI queries about installed msi files @@ -23,8 +21,6 @@ # For example, ProductName "CFEngine Nova" with ProductVersion # "1.1.2" for 32-bit Windows will correspond to the filename # "cfengine-nova-1.1.2-i686.msi". -# -######################################################################### bundle agent check_software { vars: @@ -44,7 +40,6 @@ bundle agent check_software # "any" usebundle => remove_software( "@(check_software.exclude_software)", "$(sys.policy_hub)" ); } -######################################################################### bundle agent add_software(pkg_name) { vars: @@ -76,7 +71,6 @@ bundle agent add_software(pkg_name) "Failed to install one or more packages"; } -######################################################################### bundle agent update_software(sw_names) { vars: @@ -112,7 +106,6 @@ bundle agent update_software(sw_names) "Failed to update one or more packages"; } -######################################################################### bundle agent remove_software(pkg_name) { vars: diff --git a/content/examples/example-snippets/tidying_garbage_files.cf b/content/examples/example-snippets/tidying_garbage_files.cf index e3c21db33..e403302a2 100644 --- a/content/examples/example-snippets/tidying_garbage_files.cf +++ b/content/examples/example-snippets/tidying_garbage_files.cf @@ -1,15 +1,10 @@ -####################################################### -# # Deleting files, like cf2 tidy age=0 r=inf -# -####################################################### body common control { any:: bundlesequence => { "testbundle" }; } -############################################ bundle agent testbundle { files: @@ -19,21 +14,18 @@ bundle agent testbundle depth_search => recurse("inf"); } -######################################################### body depth_search recurse(d) { #include_basedir => "true"; depth => "$(d)"; } -######################################################### body delete tidy { dirlinks => "delete"; rmdirs => "false"; } -######################################################### body file_select zero_age # we can build old "include", "exclude", and "ignore" # from these as standard patterns - these bodies can diff --git a/content/examples/example-snippets/trigger_classes.cf b/content/examples/example-snippets/trigger_classes.cf index b93a02ec2..2cbe4655b 100644 --- a/content/examples/example-snippets/trigger_classes.cf +++ b/content/examples/example-snippets/trigger_classes.cf @@ -1,15 +1,10 @@ -####################################################### -# # Insert a number of lines and trigger a followup if edited -# -####################################################### body common control { any:: bundlesequence => { "insert" }; } -####################################################### bundle agent insert { vars: @@ -36,22 +31,18 @@ bundle agent insert "The potatoes are bananas"; } -####################################################### # For the library -####################################################### bundle edit_line insert_name(name) { insert_lines: "Begin$(const.n) $(name)$(const.n)End"; } -####################################################### body edit_defaults empty { empty_file_before_editing => "true"; } -####################################################### body classes trigger(x) { promise_repaired => { $(x) }; diff --git a/content/examples/example-snippets/unit_registry_cache.cf.cf b/content/examples/example-snippets/unit_registry_cache.cf.cf index d03209ed0..316cce263 100644 --- a/content/examples/example-snippets/unit_registry_cache.cf.cf +++ b/content/examples/example-snippets/unit_registry_cache.cf.cf @@ -5,7 +5,6 @@ body common control }; } -######################################### bundle agent registry_cache { databases: @@ -16,7 +15,6 @@ bundle agent registry_cache comment => "Save correct registry settings for Adobe products"; } -######################################### bundle agent registry_restore { databases: diff --git a/content/examples/example-snippets/unmount_nfs_filesystem.cf b/content/examples/example-snippets/unmount_nfs_filesystem.cf index de5f0cce0..b3847b875 100644 --- a/content/examples/example-snippets/unmount_nfs_filesystem.cf +++ b/content/examples/example-snippets/unmount_nfs_filesystem.cf @@ -1,12 +1,9 @@ -##################################################################### # Mount NFS -##################################################################### body common control { bundlesequence => { "mounts" }; } -##################################################################### bundle agent mounts { storage: @@ -14,7 +11,6 @@ bundle agent mounts "/mnt" mount => nfs("server.example.org", "/home"); } -###################################################################### body mount nfs(server, source) { mount_type => "nfs"; diff --git a/content/examples/example-snippets/updating_from_a_central_hub.cf b/content/examples/example-snippets/updating_from_a_central_hub.cf index 918373b54..5fcce1596 100644 --- a/content/examples/example-snippets/updating_from_a_central_hub.cf +++ b/content/examples/example-snippets/updating_from_a_central_hub.cf @@ -19,7 +19,6 @@ bundle agent update depth_search => recurse("inf"); } -####################################################### body server control { allowconnects => { "127.0.0.1", "10.20.30.0/24" }; @@ -27,7 +26,6 @@ body server control trustkeysfrom => { "127.0.0.1", "10.20.30.0/24" }; } -####################################################### bundle server my_access_rules() { access: diff --git a/content/examples/example-snippets/variation_in_hosts.cf b/content/examples/example-snippets/variation_in_hosts.cf index f2d90ae39..a0e386167 100644 --- a/content/examples/example-snippets/variation_in_hosts.cf +++ b/content/examples/example-snippets/variation_in_hosts.cf @@ -3,7 +3,6 @@ body common control bundlesequence => { "central" }; } -############################################ bundle agent central { classes: @@ -34,9 +33,7 @@ bundle agent central # Add more promises below ... } -######################################################### # Server config -######################################################### body server control { allowconnects => { "127.0.0.1", "::1", "10.20.30.0/24" }; @@ -45,7 +42,6 @@ body server control # allowusers } -######################################################### bundle server my_access_rules() { access: diff --git a/content/examples/example-snippets/warn_if_matching_line_in_file.cf b/content/examples/example-snippets/warn_if_matching_line_in_file.cf index 29e6466f2..f67c7e3bf 100644 --- a/content/examples/example-snippets/warn_if_matching_line_in_file.cf +++ b/content/examples/example-snippets/warn_if_matching_line_in_file.cf @@ -1,14 +1,9 @@ -######################################################## -# # Warn if line matched -# -######################################################## body common control { bundlesequence => { "testbundle" }; } -######################################################## bundle agent testbundle { files: @@ -17,14 +12,12 @@ bundle agent testbundle action => WarnOnly; } -######################################################## bundle edit_line delete_lines_matching(regex) { delete_lines: "$(regex)" action => WarnOnly; } -######################################################## body action WarnOnly { action_policy => "warn"; diff --git a/content/examples/example-snippets/web_server_modules.cf b/content/examples/example-snippets/web_server_modules.cf index edf4e9606..99caa65fe 100644 --- a/content/examples/example-snippets/web_server_modules.cf +++ b/content/examples/example-snippets/web_server_modules.cf @@ -1,15 +1,10 @@ -####################################################### -# # Apache 2 reconfig - modelled on SuSE -# -####################################################### body common control { inputs => { "$(sys.libdir)/stdlib.cf" }; bundlesequence => { apache }; } -####################################################### bundle agent apache { files: @@ -17,9 +12,7 @@ bundle agent apache "/etc/sysconfig/apache2" edit_line => fixapache; } -####################################################### # For the library -####################################################### bundle edit_line fixapache { vars: diff --git a/content/resources/additional-topics/STIGs.cf b/content/resources/additional-topics/STIGs.cf index 3f77bcdce..32c8f6419 100644 --- a/content/resources/additional-topics/STIGs.cf +++ b/content/resources/additional-topics/STIGs.cf @@ -1,5 +1,3 @@ -################################################################################ -# # _ _ _ _ # / \ / \ / \ / \ # ( S )( T )( I )( G ) @@ -17,8 +15,6 @@ # the permission of the CFEngine company. # # $Id:$ -# -################################################################################ body common control { bundlesequence => { "stigs" };