diff --git a/README.md b/README.md index b393cb0bb..692d384c1 100644 --- a/README.md +++ b/README.md @@ -325,7 +325,7 @@ The documentation generator will pre-process the markdown content before passing it to Hugo for the rendering. The pre-processor understands and replaces the macros. Macros all have the form -`[%CFEngine_MACRO(parameters)%]` +`{{< CFEngine_MACRO(parameters) >}}` and need to be used as a separate line, as the entire line will be replaced by the pre-processor. @@ -346,11 +346,11 @@ are skipped. The generator searches for `filename` in the `core/examples` subdirectory of WKRDIR. -- `[%CFEngine_include_example(filename)%]` +- `{{< CFEngine_include_example(filename) >}}` Injects the code from `filename`. -- `[%CFEngine_include_snippet(filename, begin_rx, end_rx [optional])%]` +- `{{< CFEngine_include_snippet(filename, begin_rx, end_rx [optional]) >}}` Searches `filename` for the first line that matches the regular expression `begin_rx`, and injects all lines as a code block from @@ -360,7 +360,7 @@ omitted, all lines until the end of the file will be injected. If the line that matches the regular expression is a comment, then it is excluded from the quote, otherwise it is included. -- `[%CFEngine_include_markdown(filename, begin_rx, end_rx [optional])%]` +- `{{< CFEngine_include_markdown(filename, begin_rx, end_rx [optional]) >}}` Searches `filename` for the first line that matches the regular expression `begin_rx`, and injects all lines **verbatim** from there @@ -369,7 +369,7 @@ all lines until the end of the file will be injected. #### Documenting policy libraries -- `[%CFEngine_library_include(filename)%]` +- `{{< CFEngine_library_include(filename) >}}` Parses the JSON version of the CFEngine policy in `filename` and generates documentation from it. @@ -411,7 +411,7 @@ The following macros require the syntax map to be generated via `cf-promises -s` into a file `syntax_map.json` within the `_generated` subdirectory of the documentation generator. -- `[%CFEngine_function_prototype(arg1, arg2, ...)%]` +- `{{< CFEngine_function_prototype(arg1, arg2, ...) >}}` Renders the prototype of the function that has the same name as the title of the current page. Parameters `arg1` etc are used for the names @@ -426,7 +426,7 @@ of the parameters: Use this before a `**Description:**` section in which the behavior of the function as well as the individual parameters are then explained. -- `[%CFEngine_function_attributes(arg1, arg2, ...)%]` +- `{{< CFEngine_function_attributes(arg1, arg2, ...) >}}` Renders a list of attributes for the function that has the same name as the title of the current page. `arg1` etc are used for the parameter names: @@ -446,7 +446,7 @@ Document the individual parameters either directly in the `**Description:**` section, or as a block after using this macro. You cannot use the macro if individual options of option-type parameters need detailed explanation. -- `[%CFEngine_promise_attribute(default)%]` +- `{{< CFEngine_promise_attribute(default) >}}` Renders the syntax description of the current promise attribute. The current markdown needs to comply with the following: @@ -467,7 +467,7 @@ title: promise_type ### attribute1 -[%CFEngine_promise_attribute(default)%] +{{< CFEngine_promise_attribute(default) >}} This will document "attribute1" of "promise_type" @@ -475,7 +475,7 @@ This will document "attribute1" of "promise_type" #### attribute1 -[%CFEngine_promise_attribute(default)%] +{{< CFEngine_promise_attribute(default) >}} This will document "attribute1" of "body" ``` @@ -494,17 +494,17 @@ The generated markdown is: If a `default` parameter is provided, then a `**Default value:**` statement is created. -- `[%CFEngine_function_table()%]` +- `{{< CFEngine_function_table() >}}` Renders a table of built-in functions, grouped by function category. -- `[%CFEngine_syntax_map(subtree)%]` +- `{{< CFEngine_syntax_map(subtree) >}}` Renders a nested tree of CFEngine words, starting at `subtree`. #### Other macros -- `[%CFEngine_redirect(target)]` +- `{{< CFEngine_redirect(target) >}}` Injects javascript that redirects the current page to the HTML page for `target`, which needs to be a title or title#section combination as in regular `[text][title#section]` @@ -545,7 +545,7 @@ requires a body template, then see next section). Longer explanation on what it does and why it is useful, over multiple paragraphs if necessary. - [%CFEngine_promise_attribute(default value)%] + {{< CFEngine_promise_attribute(default value) >}} More information about special input values. @@ -581,7 +581,7 @@ body type, with the most relevant attributes set to self-explanatory values. Longer explanation on what this body template is used for, over multiple paragraphs if necessary. - [%CFEngine_promise_attribute()%] + {{< CFEngine_promise_attribute() >}} **Example:** @@ -603,7 +603,7 @@ runnable code. No header necessary - there is one function per page, and the page's title is the name of the function. - [%CFEngine_function_prototype(parameter1, parameters2, ...)%] + {{< CFEngine_function_prototype(parameter1, parameters2, ...) >}} **Description:** Returns something based on `parameter1` and `parameter2`. @@ -614,7 +614,7 @@ title is the name of the function. Over multiple paragraphs if necessary. - [%CFEngine_function_attributes(parameter1, parameter2)%] + {{< CFEngine_function_attributes(parameter1, parameter2) >}} Explain important attribute values, correlations and limitations. diff --git a/cheatsheet.markdown b/cheatsheet.markdown index 3ee29183c..beed7b894 100644 --- a/cheatsheet.markdown +++ b/cheatsheet.markdown @@ -486,16 +486,16 @@ Examples from cfengine/core can be rendered using the `CFEngine_include_example` `[\%CFEngine_include_example(class-automatic-canonificiation.cf)\%]` {% raw %} - [%CFEngine_include_example(class-automatic-canonificiation.cf)%] + {{< CFEngine_include_example(class-automatic-canonificiation.cf) >}} {% endraw %} ### Include snippet of text from a file Sometimes it's nice to include a snippet from another file. For example, we dynamically generate the `--help` output for each component on each doc build and that output is included on each component page. -`[%CFEngine_include_snippet(cf-promises.help, [\s]*--[a-z], ^$)%]` +`{{< CFEngine_include_snippet(cf-promises.help, [\s]*--[a-z], ^$) >}}` -[%CFEngine_include_snippet(cf-promises.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-promises.help, [\s]*--[a-z], ^$) >}} --- @@ -504,7 +504,7 @@ Sometimes it's nice to include a snippet from another file. For example, we dyna Sometimes it's nice to include an external file
-[%CFEngine_include_markdown(masterfiles/CHANGELOG.md)%]
+{{< CFEngine_include_markdown(masterfiles/CHANGELOG.md) >}}
 
#### Including chunks of policy from the MPF @@ -512,10 +512,10 @@ Sometimes it's nice to include an external file Here I am including a bundle named `cfe_autorun_inventory_listening_ports`. It may be a common or an agent bundle (in case the bundle ever changes types).
-[%CFEngine_include_snippet(inventory/any.cf, bundle\s+(agent|common)\s+cfe_autorun_inventory_listening_ports, \})%]
+{{< CFEngine_include_snippet(inventory/any.cf, bundle\s+(agent|common)\s+cfe_autorun_inventory_listening_ports, \}) >}}
 
-[%CFEngine_include_snippet(inventory/any.cf, bundle\s+(agent|common)\s+cfe_autorun_inventory_listening_ports, \})%] +{{< CFEngine_include_snippet(inventory/any.cf, bundle\s+(agent|common)\s+cfe_autorun_inventory_listening_ports, \}) >}} ### Comments inside documentation @@ -555,21 +555,21 @@ If you are referring to something within UI / screenshots / buttons etc use bold ### symlink example -[%CFEngine_include_snippet(masterfiles/lib/files.cf, ^body\slink_from\sln_s.*, ^##)%] +{{< CFEngine_include_snippet(masterfiles/lib/files.cf, ^body\slink_from\sln_s.*, ^##) >}} ### Self documenting policy #### For the stdlib: -[%CFEngine_library_include(lib/commands)%] +{{< CFEngine_library_include(lib/commands) >}} #### For update.cf? -[%CFEngine_library_include(update)%] +{{< CFEngine_library_include(update) >}} #### for promises.cf? -[%CFEngine_library_include(promises)%] +{{< CFEngine_library_include(promises) >}} ## Variables diff --git a/content/examples/_index.markdown b/content/examples/_index.markdown index 374091efc..94fce17d9 100644 --- a/content/examples/_index.markdown +++ b/content/examples/_index.markdown @@ -257,4 +257,4 @@ of your main policy. For example, the LDAP query in `active_directory.cf` needs a domain name. In the variable declaration, replace "cftesting" with your domain name: -[%CFEngine_include_snippet(integrating_the_example_into_your_main_policy.cf, .* )%] +{{< CFEngine_include_snippet(integrating_the_example_into_your_main_policy.cf, .* ) >}} diff --git a/content/examples/example-snippets/active_directory.markdown b/content/examples/example-snippets/active_directory.markdown index 42abd392b..45727cfe6 100644 --- a/content/examples/example-snippets/active_directory.markdown +++ b/content/examples/example-snippets/active_directory.markdown @@ -6,16 +6,16 @@ sorting: 7 ## Active directory example -[%CFEngine_include_snippet(active_directory_example.cf, .* )%] +{{< CFEngine_include_snippet(active_directory_example.cf, .* ) >}} ## Active list users directory example -[%CFEngine_include_snippet(active_list_users_directory_example.cf, .* )%] +{{< CFEngine_include_snippet(active_list_users_directory_example.cf, .* ) >}} ## Active directory show users example -[%CFEngine_include_snippet(active_directory_show_users_example.cf, .* )%] +{{< CFEngine_include_snippet(active_directory_show_users_example.cf, .* ) >}} ## LDAP interactions -[%CFEngine_include_snippet(ldap_interactions.cf, .* )%] +{{< CFEngine_include_snippet(ldap_interactions.cf, .* ) >}} diff --git a/content/examples/example-snippets/basic-file-directory.markdown b/content/examples/example-snippets/basic-file-directory.markdown index b8713aeb7..2e7a4fb75 100644 --- a/content/examples/example-snippets/basic-file-directory.markdown +++ b/content/examples/example-snippets/basic-file-directory.markdown @@ -34,65 +34,65 @@ sorting: 6 Create files and directories and set permissions. -[%CFEngine_include_snippet(create_files_and_directories.cf, .* )%] +{{< CFEngine_include_snippet(create_files_and_directories.cf, .* ) >}} ## Copy single files Copy single files, locally (local_cp) or from a remote site (secure_cp). The Community Open Promise-Body Library (COPBL; cfengine_stdlib.cf) should be included in the /var/cfengine/inputs/ directory and input as below. -[%CFEngine_include_snippet(copy_single_files.cf, .* )%] +{{< CFEngine_include_snippet(copy_single_files.cf, .* ) >}} ## Copy directory trees Copy directory trees, locally (local_cp) or from a remote site (secure_cp). (depth_search => recurse("")) defines the number of sublevels to include, ("inf") gets entire tree. -[%CFEngine_include_snippet(copy_directory_trees.cf, .* )%] +{{< CFEngine_include_snippet(copy_directory_trees.cf, .* ) >}} ## Disabling and rotating files Use the following simple steps to disable and rotate files. See the Community Open Promise-Body Library if you wish more details on what disable and rotate does. -[%CFEngine_include_snippet(disabling_and_rotating_files.cf, .* )%] +{{< CFEngine_include_snippet(disabling_and_rotating_files.cf, .* ) >}} ## Add lines to a file There are numerous approaches to adding lines to a file. Often the order of a configuration file is unimportant, we just need to ensure settings within it. A simple way of adding lines is show below. -[%CFEngine_include_snippet(add_lines_to_a_file.cf, .* )%] +{{< CFEngine_include_snippet(add_lines_to_a_file.cf, .* ) >}} Also you could write this using a list variable: -[%CFEngine_include_snippet(add_lines_to_a_file_1.cf, .* )%] +{{< CFEngine_include_snippet(add_lines_to_a_file_1.cf, .* ) >}} ## Check file or directory permissions -[%CFEngine_include_snippet(check_file_or_directory_permissions.cf, .* )%] +{{< CFEngine_include_snippet(check_file_or_directory_permissions.cf, .* ) >}} ## Commenting lines in a file -[%CFEngine_include_snippet(commenting_lines_in_a_file.cf, .* )%] +{{< CFEngine_include_snippet(commenting_lines_in_a_file.cf, .* ) >}} ## Copy files -[%CFEngine_include_snippet(copy_files.cf, .* )%] +{{< CFEngine_include_snippet(copy_files.cf, .* ) >}} ## Copy and flatten directory -[%CFEngine_include_snippet(copy_and_flatten_directory.cf, .* )%] +{{< CFEngine_include_snippet(copy_and_flatten_directory.cf, .* ) >}} ## Copy then edit a file convergently To convergently chain a copy followed by edit, you need a staging file. First you copy to the staging file. Then you edit the final file and insert the staging file into it as part of the editing. This is convergent with respect to both stages of the process. -[%CFEngine_include_snippet(copy_then_edit_a_file_convergently.cf, .* )%] +{{< CFEngine_include_snippet(copy_then_edit_a_file_convergently.cf, .* ) >}} ## Deleting lines from a file -[%CFEngine_include_snippet(deleting_lines_from_a_file.cf, .* )%] +{{< CFEngine_include_snippet(deleting_lines_from_a_file.cf, .* ) >}} ## Deleting lines exception -[%CFEngine_include_snippet(deleting_lines_exception.cf, .* )%] +{{< CFEngine_include_snippet(deleting_lines_exception.cf, .* ) >}} ## Delete files recursively @@ -104,23 +104,23 @@ This is a huge topic. See also See Add lines to a file, See Editing tabular file Here is an example of how to comment out lines matching a number of patterns: -[%CFEngine_include_snippet(editing_files.cf, .* )%] +{{< CFEngine_include_snippet(editing_files.cf, .* ) >}} ## Editing tabular files -[%CFEngine_include_snippet(editing_tabular_files.cf, .* )%] +{{< CFEngine_include_snippet(editing_tabular_files.cf, .* ) >}} ## Inserting lines in a file -[%CFEngine_include_snippet(inserting_lines_in_a_file.cf, .* )%] +{{< CFEngine_include_snippet(inserting_lines_in_a_file.cf, .* ) >}} ## Back references in filenames -[%CFEngine_include_snippet(back_references_in_filenames.cf, .* )%] +{{< CFEngine_include_snippet(back_references_in_filenames.cf, .* ) >}} ## Add variable definitions to a file -[%CFEngine_include_snippet(add_variable_definitions_to_a_file.cf, .* )%] +{{< CFEngine_include_snippet(add_variable_definitions_to_a_file.cf, .* ) >}} Results in: @@ -130,32 +130,32 @@ Results in: An example of this would be to add variables to /etc/sysctl.conf on Linux: -[%CFEngine_include_snippet(add_variable_definitions_to_a_file_1.cf, .* )%] +{{< CFEngine_include_snippet(add_variable_definitions_to_a_file_1.cf, .* ) >}} ## Linking files -[%CFEngine_include_snippet(linking_files.cf, .* )%] +{{< CFEngine_include_snippet(linking_files.cf, .* ) >}} ## Listing files-pattern in a directory -[%CFEngine_include_snippet(listing_files-pattern_in_a_directory.cf, .* )%] +{{< CFEngine_include_snippet(listing_files-pattern_in_a_directory.cf, .* ) >}} ## Locate and transform files -[%CFEngine_include_snippet(locate_and_transform_files.cf, .* )%] +{{< CFEngine_include_snippet(locate_and_transform_files.cf, .* ) >}} ## BSD flags -[%CFEngine_include_snippet(bsd_flags.cf, .* )%] +{{< CFEngine_include_snippet(bsd_flags.cf, .* ) >}} ## Search and replace text -[%CFEngine_include_snippet(search_and_replace_text.cf, .* )%] +{{< CFEngine_include_snippet(search_and_replace_text.cf, .* ) >}} ## Selecting a region in a file -[%CFEngine_include_snippet(selecting_a_region_in_a_file.cf, .* )%] +{{< CFEngine_include_snippet(selecting_a_region_in_a_file.cf, .* ) >}} ## Warn if matching line in file -[%CFEngine_include_snippet(warn_if_matching_line_in_file.cf, .* )%] +{{< CFEngine_include_snippet(warn_if_matching_line_in_file.cf, .* ) >}} diff --git a/content/examples/example-snippets/cfengine-administration.markdown b/content/examples/example-snippets/cfengine-administration.markdown index d4292cd14..08ef0931a 100644 --- a/content/examples/example-snippets/cfengine-administration.markdown +++ b/content/examples/example-snippets/cfengine-administration.markdown @@ -15,8 +15,8 @@ This shows how dependencies can be chained in spite of the order of promises in Normally the order of promises in a bundle is followed, within each promise type, and the types are ordered according to normal ordering. -[%CFEngine_include_snippet(ordering_promises.cf, .* )%] +{{< CFEngine_include_snippet(ordering_promises.cf, .* ) >}} ## Aborting execution -[%CFEngine_include_snippet(aborting_execution.cf, .* )%] +{{< CFEngine_include_snippet(aborting_execution.cf, .* ) >}} diff --git a/content/examples/example-snippets/commands-scripts-execution.markdown b/content/examples/example-snippets/commands-scripts-execution.markdown index bd5c6a2f8..729eeb909 100644 --- a/content/examples/example-snippets/commands-scripts-execution.markdown +++ b/content/examples/example-snippets/commands-scripts-execution.markdown @@ -16,28 +16,28 @@ sorting: 5 Execute a command, for instance to start a MySQL service. Note that simple shell commands like rm or mkdir cannot be managed by CFEngine, so none of the protections that CFEngine offers can be applied to the process. Moreover, this starts a new process, adding to the burden on the system. -[%CFEngine_include_snippet(command_or_script_execution.cf, .* )%] +{{< CFEngine_include_snippet(command_or_script_execution.cf, .* ) >}} ## Change directory for command -[%CFEngine_include_snippet(change_directory_for_command.cf, .* )%] +{{< CFEngine_include_snippet(change_directory_for_command.cf, .* ) >}} ## Commands example -[%CFEngine_include_snippet(commands_example.cf, .* )%] +{{< CFEngine_include_snippet(commands_example.cf, .* ) >}} ## Execresult example -[%CFEngine_include_snippet(execresult_example.cf, .* )%] +{{< CFEngine_include_snippet(execresult_example.cf, .* ) >}} ## Methods -[%CFEngine_include_snippet(methods.cf, .* )%] +{{< CFEngine_include_snippet(methods.cf, .* ) >}} ## Method validation -[%CFEngine_include_snippet(method_validation.cf, .* )%] +{{< CFEngine_include_snippet(method_validation.cf, .* ) >}} ## Trigger classes -[%CFEngine_include_snippet(trigger_classes.cf, .* )%] +{{< CFEngine_include_snippet(trigger_classes.cf, .* ) >}} diff --git a/content/examples/example-snippets/database.markdown b/content/examples/example-snippets/database.markdown index 495841bf9..2b6b3758e 100644 --- a/content/examples/example-snippets/database.markdown +++ b/content/examples/example-snippets/database.markdown @@ -8,4 +8,4 @@ sorting: 8 ## Database creation -[%CFEngine_include_snippet(database_creation.cf, .* )%] +{{< CFEngine_include_snippet(database_creation.cf, .* ) >}} diff --git a/content/examples/example-snippets/file-template.markdown b/content/examples/example-snippets/file-template.markdown index e09711510..0b2b23ea2 100644 --- a/content/examples/example-snippets/file-template.markdown +++ b/content/examples/example-snippets/file-template.markdown @@ -15,12 +15,12 @@ With CFEngine you have a choice between editing _deltas_ into files or distribut Example template: -[%CFEngine_include_snippet(templating.cf, .* )%] +{{< CFEngine_include_snippet(templating.cf, .* ) >}} To copy and expand this template, you can use a pattern like this: -[%CFEngine_include_snippet(templating_1.cf, .* )%] +{{< CFEngine_include_snippet(templating_1.cf, .* ) >}} The the following driving code (based on _copy then edit_) can be placed in a library, after configuring to your environmental locations: -[%CFEngine_include_snippet(templating_1.cf, .* )%] +{{< CFEngine_include_snippet(templating_1.cf, .* ) >}} diff --git a/content/examples/example-snippets/file_permissions.markdown b/content/examples/example-snippets/file_permissions.markdown index 2fa52b40f..c38f58e5c 100644 --- a/content/examples/example-snippets/file_permissions.markdown +++ b/content/examples/example-snippets/file_permissions.markdown @@ -6,12 +6,12 @@ sorting: 15 ## ACL file example -[%CFEngine_include_snippet(acl_file_example.cf, .* )%] +{{< CFEngine_include_snippet(acl_file_example.cf, .* ) >}} ## ACL generic example -[%CFEngine_include_snippet(acl_generic_example.cf, .* )%] +{{< CFEngine_include_snippet(acl_generic_example.cf, .* ) >}} ## ACL secret example -[%CFEngine_include_snippet(acl_secret_example.cf, .* )%] +{{< CFEngine_include_snippet(acl_secret_example.cf, .* ) >}} diff --git a/content/examples/example-snippets/general.markdown b/content/examples/example-snippets/general.markdown index 4f652a954..ab20f43e8 100644 --- a/content/examples/example-snippets/general.markdown +++ b/content/examples/example-snippets/general.markdown @@ -12,7 +12,7 @@ sorting: 1 To get started with CFEngine, you can imagine the following template for entering examples. This part of the code is common to all the examples. -[%CFEngine_include_snippet(basic_example.cf, .* )%] +{{< CFEngine_include_snippet(basic_example.cf, .* ) >}} ## The general pattern @@ -36,8 +36,8 @@ what_type: ### Hello world -[%CFEngine_include_snippet(hello_world.cf, .* )%] +{{< CFEngine_include_snippet(hello_world.cf, .* ) >}} ### Array example -[%CFEngine_include_snippet(array_example.cf, .* )%] +{{< CFEngine_include_snippet(array_example.cf, .* ) >}} diff --git a/content/examples/example-snippets/network.markdown b/content/examples/example-snippets/network.markdown index ec96dbd72..add098457 100644 --- a/content/examples/example-snippets/network.markdown +++ b/content/examples/example-snippets/network.markdown @@ -18,30 +18,30 @@ sorting: 9 Finding the ethernet address can be hard, but on Linux it is straightforward. -[%CFEngine_include_snippet(find_mac_address.cf, .* )%] +{{< CFEngine_include_snippet(find_mac_address.cf, .* ) >}} ## Client-server example -[%CFEngine_include_snippet(client-server_example.cf, .* )%] +{{< CFEngine_include_snippet(client-server_example.cf, .* ) >}} ## Read from a TCP socket -[%CFEngine_include_snippet(read_from_a_tcp_socket.cf, .* )%] +{{< CFEngine_include_snippet(read_from_a_tcp_socket.cf, .* ) >}} ## Set up a PXE boot server Use CFEngine to set up a PXE boot server. -[%CFEngine_include_snippet(set_up_a_pxe_boot_server.cf, .* )%] +{{< CFEngine_include_snippet(set_up_a_pxe_boot_server.cf, .* ) >}} ## Resolver management -[%CFEngine_include_snippet(resolver_management.cf, .* )%] +{{< CFEngine_include_snippet(resolver_management.cf, .* ) >}} ## Mount NFS filesystem -[%CFEngine_include_snippet(mount_nfs_filesystem.cf, .* )%] +{{< CFEngine_include_snippet(mount_nfs_filesystem.cf, .* ) >}} ## Unmount NFS filesystem -[%CFEngine_include_snippet(unmount_nfs_filesystem.cf, .* )%] +{{< CFEngine_include_snippet(unmount_nfs_filesystem.cf, .* ) >}} diff --git a/content/examples/example-snippets/promise-patterns/example_aborting_execution.markdown b/content/examples/example-snippets/promise-patterns/example_aborting_execution.markdown index e0c50683e..ea0893f77 100644 --- a/content/examples/example-snippets/promise-patterns/example_aborting_execution.markdown +++ b/content/examples/example-snippets/promise-patterns/example_aborting_execution.markdown @@ -10,7 +10,7 @@ for example when validating input to a bundle. The following policy uses a list regular expressions for classes, or class expressions that [`cf-agent`][cf-agent] will watch out for. If any of these classes becomes defined, it will cause the current bundle to be aborted. -[%CFEngine_include_example(abort.cf)%] +{{< CFEngine_include_example(abort.cf) >}} This is how the policy runs when the userlist is valid: diff --git a/content/examples/example-snippets/promise-patterns/example_change_detection.markdown b/content/examples/example-snippets/promise-patterns/example_change_detection.markdown index c357d846b..185e42885 100644 --- a/content/examples/example-snippets/promise-patterns/example_change_detection.markdown +++ b/content/examples/example-snippets/promise-patterns/example_change_detection.markdown @@ -7,7 +7,7 @@ reviewed-by: atsaloli This policy will look for changes recursively in a directory. -[%CFEngine_include_example(change_detect.cf)%] +{{< CFEngine_include_example(change_detect.cf) >}} Here is an example run. diff --git a/content/examples/example-snippets/promise-patterns/example_copy_single_files.markdown b/content/examples/example-snippets/promise-patterns/example_copy_single_files.markdown index 2003dc1cc..955f9ee06 100644 --- a/content/examples/example-snippets/promise-patterns/example_copy_single_files.markdown +++ b/content/examples/example-snippets/promise-patterns/example_copy_single_files.markdown @@ -11,4 +11,4 @@ The CFEngine Standard Library (cfengine_stdlib.cf) should be included in the `/var/cfengine/inputs/libraries/` directory and inputs list as below. -[%CFEngine_include_example(copy_copbl.cf)%] +{{< CFEngine_include_example(copy_copbl.cf) >}} diff --git a/content/examples/example-snippets/promise-patterns/example_create_filedir.markdown b/content/examples/example-snippets/promise-patterns/example_create_filedir.markdown index b340f247c..cd7587a6c 100644 --- a/content/examples/example-snippets/promise-patterns/example_create_filedir.markdown +++ b/content/examples/example-snippets/promise-patterns/example_create_filedir.markdown @@ -7,7 +7,7 @@ The following is a standalone policy that will create the file `/home/mark/tmp/test_plain` and the directory `/home/mark/tmp/test_dir/` and set permissions on both. -[%CFEngine_include_example(create_filedir.cf)%] +{{< CFEngine_include_example(create_filedir.cf) >}} Example output: diff --git a/content/examples/example-snippets/promise-patterns/example_diskfree.markdown b/content/examples/example-snippets/promise-patterns/example_diskfree.markdown index 44053bda3..84ad4ef77 100644 --- a/content/examples/example-snippets/promise-patterns/example_diskfree.markdown +++ b/content/examples/example-snippets/promise-patterns/example_diskfree.markdown @@ -7,7 +7,7 @@ reviewed-by: atsaloli Check how much space (in KB) is available on a directory's current partition. -[%CFEngine_include_example(diskfree.cf)%] +{{< CFEngine_include_example(diskfree.cf) >}} Example output: diff --git a/content/examples/example-snippets/promise-patterns/example_edit_motd.markdown b/content/examples/example-snippets/promise-patterns/example_edit_motd.markdown index cce66ff6f..8dd8d801a 100644 --- a/content/examples/example-snippets/promise-patterns/example_edit_motd.markdown +++ b/content/examples/example-snippets/promise-patterns/example_edit_motd.markdown @@ -23,7 +23,7 @@ render a `/etc/motd` using a mustache template and add useful information as: The bundle is defined like this: -[%CFEngine_include_example(mustache_template_motd.cf)%] +{{< CFEngine_include_example(mustache_template_motd.cf) >}} **Example run:** diff --git a/content/examples/example-snippets/promise-patterns/example_enable_service.markdown b/content/examples/example-snippets/promise-patterns/example_enable_service.markdown index a7cdbc2f8..db7b9084a 100644 --- a/content/examples/example-snippets/promise-patterns/example_enable_service.markdown +++ b/content/examples/example-snippets/promise-patterns/example_enable_service.markdown @@ -7,7 +7,7 @@ reviewed-by: nickanderson This example shows how to ensure services are started or stopped appropriately. -[%CFEngine_include_example(services.cf)%] +{{< CFEngine_include_example(services.cf) >}} **Note:** Not all services behave in the standard way. Some services may require custom handling. For example it is not uncommon for some services to not provide diff --git a/content/examples/example-snippets/promise-patterns/example_ssh_keys.markdown b/content/examples/example-snippets/promise-patterns/example_ssh_keys.markdown index df2fdb170..58f1e9a33 100644 --- a/content/examples/example-snippets/promise-patterns/example_ssh_keys.markdown +++ b/content/examples/example-snippets/promise-patterns/example_ssh_keys.markdown @@ -40,7 +40,7 @@ the policy server. To deploy this policy simply place it in the `services/autorun` directory of your masterfiles. -[%CFEngine_include_example(simple_ssh_key_distribution.cf)%] +{{< CFEngine_include_example(simple_ssh_key_distribution.cf) >}} Example Run: diff --git a/content/examples/example-snippets/software-adminstration.markdown b/content/examples/example-snippets/software-adminstration.markdown index 4b8b0455a..492a9ae84 100644 --- a/content/examples/example-snippets/software-adminstration.markdown +++ b/content/examples/example-snippets/software-adminstration.markdown @@ -20,58 +20,58 @@ sorting: 4 Example for Debian: -[%CFEngine_include_snippet(software_and_patch_installation.cf, .* )%] +{{< CFEngine_include_snippet(software_and_patch_installation.cf, .* ) >}} Examples MSI for Windows, by name: -[%CFEngine_include_snippet(software_and_patch_installation_1.cf, .* )%] +{{< CFEngine_include_snippet(software_and_patch_installation_1.cf, .* ) >}} Windows MSI by version: -[%CFEngine_include_snippet(software_and_patch_installation_1.cf, .* )%] +{{< CFEngine_include_snippet(software_and_patch_installation_1.cf, .* ) >}} Examples for solaris: -[%CFEngine_include_snippet(packages_examples_solaris.cf, .* )%] +{{< CFEngine_include_snippet(packages_examples_solaris.cf, .* ) >}} Examples for yum based systems: -[%CFEngine_include_snippet(software_and_patch_installation_1_2.cf, .* )%] +{{< CFEngine_include_snippet(software_and_patch_installation_1_2.cf, .* ) >}} SuSE Linux's package manager zypper is the most powerful alternative: -[%CFEngine_include_snippet(software_and_patch_installation_1_2_3.cf, .* )%] +{{< CFEngine_include_snippet(software_and_patch_installation_1_2_3.cf, .* ) >}} ## Postfix mail configuration -[%CFEngine_include_snippet(postfix_mail_configuration.cf, .* )%] +{{< CFEngine_include_snippet(postfix_mail_configuration.cf, .* ) >}} ## Set up a web server Adapt this template to your operating system by adding multiple classes. Each web server runs something like the present module, which is entered into the bundlesequence like this: -[%CFEngine_include_snippet(set_up_a_web_server.cf, .* )%] +{{< CFEngine_include_snippet(set_up_a_web_server.cf, .* ) >}} ## Add software packages to the system -[%CFEngine_include_snippet(add_software_packages_to_the_system.cf, .* )%] +{{< CFEngine_include_snippet(add_software_packages_to_the_system.cf, .* ) >}} Note you can also arrange to hide all the differences between package managers on an OS basis, but since some OSs have multiple managers, this might not be 100 percent correct. ## Application baseline -[%CFEngine_include_snippet(application_baseline.cf, .* )%] +{{< CFEngine_include_snippet(application_baseline.cf, .* ) >}} ## Service management (windows) -[%CFEngine_include_snippet(service_management_(windows).cf, .* )%] +{{< CFEngine_include_snippet(service_management_(windows).cf, .* ) >}} ## Software distribution -[%CFEngine_include_snippet(software_distribution.cf, .* )%] +{{< CFEngine_include_snippet(software_distribution.cf, .* ) >}} ## Web server modules The problem of editing the correct modules into the list of standard modules for the Apache web server. This example is based on the standard configuration deployment of SuSE Linux. Simply provide the list of modules you want and another list that you don't want. -[%CFEngine_include_snippet(web_server_modules.cf, .* )%] +{{< CFEngine_include_snippet(web_server_modules.cf, .* ) >}} diff --git a/content/examples/example-snippets/system-administration.markdown b/content/examples/example-snippets/system-administration.markdown index 76c37cbff..c0eea5585 100644 --- a/content/examples/example-snippets/system-administration.markdown +++ b/content/examples/example-snippets/system-administration.markdown @@ -12,47 +12,47 @@ These examples show a simple setup for starting with a central approach to manag This shows the simplest approach in which all hosts are the same. It is too simple for most environments, but it serves as a starting point. Compare it to the next section that includes variation. -[%CFEngine_include_snippet(all_hosts_the_same.cf, .* )%] +{{< CFEngine_include_snippet(all_hosts_the_same.cf, .* ) >}} ### Variation in hosts -[%CFEngine_include_snippet(variation_in_hosts.cf, .* )%] +{{< CFEngine_include_snippet(variation_in_hosts.cf, .* ) >}} ### Updating from a central hub The configuration bundled with the CFEngine source code contains an example of centralized updating of policy that covers more subtleties than this example, and handles fault tolerance. Here is the main idea behind it. For simplicity, we assume that all hosts are on network 10.20.30.* and that the central policy server/hub is 10.20.30.123. -[%CFEngine_include_snippet(updating_from_a_central_hub.cf, .* )%] +{{< CFEngine_include_snippet(updating_from_a_central_hub.cf, .* ) >}} ## Laptop support configuration Laptops do not need a lot of confguration support. IP addresses are set by DHCP and conditions are changeable. But you want to set your DNS search domains to familiar settings in spite of local DHCP configuration, and another useful trick is to keep a regular backup of disk changes on the local disk. This won't help against disk destruction, but it is a huge advantage when your user accidentally deletes files while travelling or offline. -[%CFEngine_include_snippet(laptop_support_configuration.cf, .* )%] +{{< CFEngine_include_snippet(laptop_support_configuration.cf, .* ) >}} ## Process management -[%CFEngine_include_snippet(process_management.cf, .* )%] +{{< CFEngine_include_snippet(process_management.cf, .* ) >}} ## Kill process -[%CFEngine_include_snippet(kill_process.cf, .* )%] +{{< CFEngine_include_snippet(kill_process.cf, .* ) >}} ## Restart process A basic pattern for restarting processes: -[%CFEngine_include_snippet(restart_process.cf, .* )%] +{{< CFEngine_include_snippet(restart_process.cf, .* ) >}} This can be made more sophisticated to handle generic lists: -[%CFEngine_include_snippet(restart_process_1.cf, .* )%] +{{< CFEngine_include_snippet(restart_process_1.cf, .* ) >}} Why? Separating this into two parts gives a high level of control and conistency to CFEngine. There are many options for command execution, like the ability to run commands in a sandbox or as `setuid`. These should not be reproduced in processes. ## Mount a filesystem -[%CFEngine_include_snippet(mount_a_filesystem.cf, .* )%] +{{< CFEngine_include_snippet(mount_a_filesystem.cf, .* ) >}} ## Manage a system process @@ -64,27 +64,27 @@ Why? Separating this into two parts gives a high level of control and conistency The simplest example might look like this: -[%CFEngine_include_snippet(ensure_running.cf, .* )%] +{{< CFEngine_include_snippet(ensure_running.cf, .* ) >}} This example shows how the CFEngine components could be started using a pattern. -[%CFEngine_include_snippet(ensure_running_1.cf, .* )%] +{{< CFEngine_include_snippet(ensure_running_1.cf, .* ) >}} ### Ensure not running -[%CFEngine_include_snippet(ensure_not_running.cf, .* )%] +{{< CFEngine_include_snippet(ensure_not_running.cf, .* ) >}} ### Prune processes This example kills processes owned by a particular user that have exceeded 100000 bytes of resident memory. -[%CFEngine_include_snippet(prune_processes.cf, .* )%] +{{< CFEngine_include_snippet(prune_processes.cf, .* ) >}} ## Set up HPC clusters HPC cluster machines are usually all identical, so the CFEngine configuration is very simple. HPC clients value CPU and memory resources, so we can shut down unnecessary services to save CPU. We can also change the scheduling rate of CFEngine to run less frequently, and save a little: -[%CFEngine_include_snippet(set_up_hpc_clusters.cf, .* )%] +{{< CFEngine_include_snippet(set_up_hpc_clusters.cf, .* ) >}} ## Set up name resolution @@ -92,32 +92,32 @@ There are many ways to do name resolution setup1 We write a reusable bundle usin A simple and straightforward approach is to maintain a separate modular bundle for this task. This avoids too many levels of abstraction and keeps all the information in one place. We implement this as a simple editing promise for the /etc/resolv.conf file. -[%CFEngine_include_snippet(set_up_name_resolution.cf, .* )%] +{{< CFEngine_include_snippet(set_up_name_resolution.cf, .* ) >}} A second approach is to try to conceal the operational details behind a veil of abstraction. -[%CFEngine_include_snippet(set_up_name_resolution_1.cf, .* )%] +{{< CFEngine_include_snippet(set_up_name_resolution_1.cf, .* ) >}} DNS is not the only name service, of course. Unix has its older /etc/hosts file which can also be managed using file editing. We simply append this to the system_files bundle. -[%CFEngine_include_snippet(set_up_name_resolution_1.cf, .* )%] +{{< CFEngine_include_snippet(set_up_name_resolution_1.cf, .* ) >}} ## Set up sudo Setting up sudo is straightforward, and is best managed by copying trusted files from a repository. -[%CFEngine_include_snippet(set_up_sudo.cf, .* )%] +{{< CFEngine_include_snippet(set_up_sudo.cf, .* ) >}} ## Environments (virtual) -[%CFEngine_include_snippet(environments_(virtual).cf, .* )%] +{{< CFEngine_include_snippet(environments_(virtual).cf, .* ) >}} ## Environment variables -[%CFEngine_include_snippet(environment_variables.cf, .* )%] +{{< CFEngine_include_snippet(environment_variables.cf, .* ) >}} ## Tidying garbage files Emulating the `tidy` feature of CFEngine 2. -[%CFEngine_include_snippet(tidying_garbage_files.cf, .* )%] +{{< CFEngine_include_snippet(tidying_garbage_files.cf, .* ) >}} diff --git a/content/examples/example-snippets/system-file.markdown b/content/examples/example-snippets/system-file.markdown index b46a5acea..21f581bd1 100644 --- a/content/examples/example-snippets/system-file.markdown +++ b/content/examples/example-snippets/system-file.markdown @@ -8,21 +8,21 @@ sorting: 13 To change the password of a system, we need to edit a file. A file is a complex object - once open there is a new world of possible promises to make about its contents. CFEngine has bundles of promises that are specially for editing. -[%CFEngine_include_snippet(editing_password_or_group_files.cf, .* )%] +{{< CFEngine_include_snippet(editing_password_or_group_files.cf, .* ) >}} ## Editing password or group files custom In this example the bundles from the Community Open Promise-Body Library are included directly in the policy instead of being input as a separate file. -[%CFEngine_include_snippet(editing_password_or_group_files_custom.cf, .* )%] +{{< CFEngine_include_snippet(editing_password_or_group_files_custom.cf, .* ) >}} ## Log rotation -[%CFEngine_include_snippet(log_rotation.cf, .* )%] +{{< CFEngine_include_snippet(log_rotation.cf, .* ) >}} ## Garbage collection -[%CFEngine_include_snippet(garbage_collection.cf, .* )%] +{{< CFEngine_include_snippet(garbage_collection.cf, .* ) >}} ## Manage a system file @@ -33,7 +33,7 @@ In this example the bundles from the Community Open Promise-Body Library are inc ### Simple template -[%CFEngine_include_snippet(simple_template.cf, .* )%] +{{< CFEngine_include_snippet(simple_template.cf, .* ) >}} ### Simple versioned template @@ -41,24 +41,24 @@ The simplest approach to managing a file is to maintain a master copy by hand, k We'll assume that you have a version control repository that is located on some independent server, and has been checked out manually once (with authentication) in /mysite/masterfiles. -[%CFEngine_include_snippet(simple_versioned_template.cf, .* )%] +{{< CFEngine_include_snippet(simple_versioned_template.cf, .* ) >}} ### Macro template The next simplest approach to file management is to add variables to the template that will be expanded into local values at the end system, e.g. using variables like `$(sys.host)` for the name of the host within the body of the versioned template. -[%CFEngine_include_snippet(macro_template.cf, .* )%] +{{< CFEngine_include_snippet(macro_template.cf, .* ) >}} The macro template file may contain variables, as below, that get expanded by CFEngine. -[%CFEngine_include_snippet(macro_template_1.cf, .* )%] +{{< CFEngine_include_snippet(macro_template_1.cf, .* ) >}} ### Custom editing If you do not control the starting state of the file, because it is distributed by an operating system vendor for instance, then editing the final state is the best approach. That way, you will get changes that are made by the vendor, and will ensure your own modifications are kept even when updates arrive. -[%CFEngine_include_snippet(custom_editing.cf, .* )%] +{{< CFEngine_include_snippet(custom_editing.cf, .* ) >}} Another example shows how to set the values of variables using a data-driven approach and methods from the standard library. -[%CFEngine_include_snippet(custom_editing_1.cf, .* )%] +{{< CFEngine_include_snippet(custom_editing_1.cf, .* ) >}} diff --git a/content/examples/example-snippets/system-information.markdown b/content/examples/example-snippets/system-information.markdown index 292f73305..544acddd2 100644 --- a/content/examples/example-snippets/system-information.markdown +++ b/content/examples/example-snippets/system-information.markdown @@ -14,26 +14,26 @@ sorting: 11 ## Change detection -[%CFEngine_include_snippet(change_detection.cf, .* )%] +{{< CFEngine_include_snippet(change_detection.cf, .* ) >}} ## Hashing for change detection (tripwire) Change detection is a powerful and easy way to monitor your environment, increase awareness and harden your system against security breaches. -[%CFEngine_include_snippet(hashing_for_change_detection_(tripwire).cf, .* )%] +{{< CFEngine_include_snippet(hashing_for_change_detection_(tripwire).cf, .* ) >}} ## Check filesystem space -[%CFEngine_include_snippet(check_filesystem_space.cf, .* )%] +{{< CFEngine_include_snippet(check_filesystem_space.cf, .* ) >}} ## Class match example -[%CFEngine_include_snippet(class_match_example.cf, .* )%] +{{< CFEngine_include_snippet(class_match_example.cf, .* ) >}} ## Global classes -[%CFEngine_include_snippet(global_classes.cf, .* )%] +{{< CFEngine_include_snippet(global_classes.cf, .* ) >}} ## Logging -[%CFEngine_include_snippet(logging.cf, .* )%] +{{< CFEngine_include_snippet(logging.cf, .* ) >}} diff --git a/content/examples/example-snippets/system-security.markdown b/content/examples/example-snippets/system-security.markdown index 143739964..1b2d01c77 100644 --- a/content/examples/example-snippets/system-security.markdown +++ b/content/examples/example-snippets/system-security.markdown @@ -10,8 +10,8 @@ sorting: 10 ## Distribute root passwords -[%CFEngine_include_snippet(distribute_root_passwords.cf, .* )%] +{{< CFEngine_include_snippet(distribute_root_passwords.cf, .* ) >}} ## Distribute ssh keys -[%CFEngine_include_snippet(distribute_ssh_keys.cf, .* )%] +{{< CFEngine_include_snippet(distribute_ssh_keys.cf, .* ) >}} diff --git a/content/examples/example-snippets/timing-counting-measuring.markdown b/content/examples/example-snippets/timing-counting-measuring.markdown index 840780f4d..5b4504de0 100644 --- a/content/examples/example-snippets/timing-counting-measuring.markdown +++ b/content/examples/example-snippets/timing-counting-measuring.markdown @@ -8,4 +8,4 @@ sorting: 3 ## Measurements -[%CFEngine_include_snippet(measurements.cf, .* )%] +{{< CFEngine_include_snippet(measurements.cf, .* ) >}} diff --git a/content/examples/example-snippets/user-management.markdown b/content/examples/example-snippets/user-management.markdown index ab30fcbce..9408e701b 100644 --- a/content/examples/example-snippets/user-management.markdown +++ b/content/examples/example-snippets/user-management.markdown @@ -16,7 +16,7 @@ CFEngine's native `users` type promise. This example shows ensuring that the local users `root` is managed if there is a specific password hash defined. -[%CFEngine_include_example(local_user_password.cf)%] +{{< CFEngine_include_example(local_user_password.cf) >}} ```console root@debian-jessie:/core/examples# grep root /etc/shadow @@ -31,7 +31,7 @@ root:$6$1nRTeNoE$DpBSe.eDsuZaME0EydXBEf.DAwuzpSoIJhkhiIAPgRqVKlmI55EONfvjZorkxNQ This example shows ensuring that the local users `jack` and `jill` are present on all linux systems using the native `users` type promise. -[%CFEngine_include_example(local_users_present.cf)%] +{{< CFEngine_include_example(local_users_present.cf) >}} Lets check the environment to see that the users do not currently exist. @@ -84,7 +84,7 @@ This example shows ensuring that the local users `jack` and `jill` are locked if they are present on linux systems using the native `users` type promise. -[%CFEngine_include_example(local_users_locked.cf)%] +{{< CFEngine_include_example(local_users_locked.cf) >}} This output shows the state of the `/etc/shadow` file before running the example policy: @@ -106,7 +106,7 @@ jill:!x:16791:0:99999:7::1: This example shows ensuring that the local users `jack` and `jill` are absent on linux systems using the native `users` type promise. -[%CFEngine_include_example(local_users_absent.cf)%] +{{< CFEngine_include_example(local_users_absent.cf) >}} Before activating the example policy, lets inspect the current state of the system. @@ -181,7 +181,7 @@ already there. This example uses the native operating system commands to show ensuring that a group is present. -[%CFEngine_include_example(local_group_present.cf)%] +{{< CFEngine_include_example(local_group_present.cf) >}} First lets inspect the current state of the system. @@ -205,7 +205,7 @@ cfengineers:x:1001: This example shows using the native `users` type promise to ensure that a user is a member of a particular group. -[%CFEngine_include_example(local_user_secondary_group_member.cf)%] +{{< CFEngine_include_example(local_user_secondary_group_member.cf) >}} First lets inspect the current state of the system @@ -240,4 +240,4 @@ usermod: group 'cfengineers' does not exist ## Get a list of users -[%CFEngine_include_snippet(get_a_list_of_users.cf, .* )%] +{{< CFEngine_include_snippet(get_a_list_of_users.cf, .* ) >}} diff --git a/content/examples/example-snippets/windows-registry.markdown b/content/examples/example-snippets/windows-registry.markdown index 0f43db78c..e692b8ad7 100644 --- a/content/examples/example-snippets/windows-registry.markdown +++ b/content/examples/example-snippets/windows-registry.markdown @@ -10,12 +10,12 @@ sorting: 14 ## Windows registry -[%CFEngine_include_snippet(windows_registry.cf, .* )%] +{{< CFEngine_include_snippet(windows_registry.cf, .* ) >}} ## unit_registry_cache.cf -[%CFEngine_include_snippet(unit_registry_cache.cf.cf, .* )%] +{{< CFEngine_include_snippet(unit_registry_cache.cf.cf, .* ) >}} ## unit_registry.cf -[%CFEngine_include_snippet(unit_registry.cf.cf, .* )%] +{{< CFEngine_include_snippet(unit_registry.cf.cf, .* ) >}} diff --git a/content/examples/tutorials/file_comparison.markdown b/content/examples/tutorials/file_comparison.markdown index 91f65613a..d322d754d 100644 --- a/content/examples/tutorials/file_comparison.markdown +++ b/content/examples/tutorials/file_comparison.markdown @@ -401,4 +401,4 @@ bundle agent list_file_2 ## Full policy -[%CFEngine_include_snippet(documentation/examples/tutorials/file_compare_test.cf, .* )%] +{{< CFEngine_include_snippet(documentation/content/examples/tutorials/file_compare_test.cf, .* ) >}} diff --git a/content/examples/tutorials/tags.markdown b/content/examples/tutorials/tags.markdown index 3ec63aab0..537fc0dd0 100644 --- a/content/examples/tutorials/tags.markdown +++ b/content/examples/tutorials/tags.markdown @@ -28,7 +28,7 @@ it represents. This one is actually built into the standard [MPF inventory policy][inventory/any.cf#cfe_autorun_inventory_listening_ports], so it's available out of the box in either Community or Enterprise. -[%CFEngine_include_snippet(inventory/any.cf, bundle\s+(agent|common)\s+cfe_autorun_inventory_listening_ports, \})%] +{{< CFEngine_include_snippet(inventory/any.cf, bundle\s+(agent|common)\s+cfe_autorun_inventory_listening_ports, \}) >}} In the Enterprise Mission Portal, you can then make a report for "Ports listening" across all your machines. For more details, see diff --git a/content/examples/tutorials/writing-and-serving-policy/policy-style.markdown b/content/examples/tutorials/writing-and-serving-policy/policy-style.markdown index 5268d4c7e..77cc87660 100644 --- a/content/examples/tutorials/writing-and-serving-policy/policy-style.markdown +++ b/content/examples/tutorials/writing-and-serving-policy/policy-style.markdown @@ -383,19 +383,19 @@ Naming conventions can also help to provide clarity. Words delimited by an underscore. This style is prevalant for *variables*, *classes*, *bundle* and *body* names in the Masterfiles Policy Framework. -[%CFEngine_include_example(style_snake_case.cf)%] +{{< CFEngine_include_example(style_snake_case.cf) >}} ### Pascalecase Words delimited by capital Letters. -[%CFEngine_include_example(style_PascaleCase.cf)%] +{{< CFEngine_include_example(style_PascaleCase.cf) >}} ### Camelcase Words are delimited by capital letters, except the initial word. -[%CFEngine_include_example(style_camelCase.cf)%] +{{< CFEngine_include_example(style_camelCase.cf) >}} ### Hungarian notation @@ -404,7 +404,7 @@ help improve the readability of policy, especially when working with lists and data containers where the use of `@` or `$` significantly affects the behavior of the policy. -[%CFEngine_include_example(style_hungarian.cf)%] +{{< CFEngine_include_example(style_hungarian.cf) >}} ## Classes diff --git a/content/getting-started/installation/general-installation/_index.markdown b/content/getting-started/installation/general-installation/_index.markdown index 62b6d1982..cb0120b44 100644 --- a/content/getting-started/installation/general-installation/_index.markdown +++ b/content/getting-started/installation/general-installation/_index.markdown @@ -4,7 +4,7 @@ title: General installation sorting: 20 --- -[%CFEngine_include_markdown(install-bootstrap-configure-summary.include.markdown)%] +{{< CFEngine_include_markdown(install-bootstrap-configure-summary.include.markdown) >}} ## Before installation diff --git a/content/getting-started/installation/general-installation/installation-enterprise-vagrant.markdown b/content/getting-started/installation/general-installation/installation-enterprise-vagrant.markdown index b0e33f515..f6194ef79 100644 --- a/content/getting-started/installation/general-installation/installation-enterprise-vagrant.markdown +++ b/content/getting-started/installation/general-installation/installation-enterprise-vagrant.markdown @@ -223,4 +223,4 @@ Vagrant and VirtualBox are useful general purpose programs, so you might want to keep them around. If not, follow the standard procedures for your OS to remove these applications. -[%CFEngine_include_markdown(common_next_steps.include.markdown)%] +{{< CFEngine_include_markdown(common_next_steps.include.markdown) >}} diff --git a/content/getting-started/installation/installation-overview.markdown b/content/getting-started/installation/installation-overview.markdown index 7572ac8c4..e69dba83b 100644 --- a/content/getting-started/installation/installation-overview.markdown +++ b/content/getting-started/installation/installation-overview.markdown @@ -6,7 +6,7 @@ sorting: 30 ## Installation -[%CFEngine_include_markdown(install-bootstrap-configure-summary.include.markdown)%] +{{< CFEngine_include_markdown(install-bootstrap-configure-summary.include.markdown) >}} See [General installation][General installation] for a more detailed guide for how to install CFEngine, and links to installation guides for various versions of CFEngine and different configurations. diff --git a/content/guide/_index.markdown b/content/guide/_index.markdown index 7533d7aa4..a22fc4d7c 100644 --- a/content/guide/_index.markdown +++ b/content/guide/_index.markdown @@ -35,7 +35,7 @@ See also: ## Install it -[%CFEngine_include_markdown(install-bootstrap-configure-summary.include.markdown)%] +{{< CFEngine_include_markdown(install-bootstrap-configure-summary.include.markdown) >}} See [Installation][Installation] for a more detailed guide on how to get CFEngine up and running for various environments. diff --git a/content/reference/all-types.markdown b/content/reference/all-types.markdown index a3168500e..7a9d68dea 100644 --- a/content/reference/all-types.markdown +++ b/content/reference/all-types.markdown @@ -9,8 +9,8 @@ sorting: 110 ## All promise types -[%CFEngine_syntax_map(promiseTypes)] +{{< CFEngine_syntax_map(promiseTypes) >}} ## All body Types -[%CFEngine_syntax_map(bodyTypes)] +{{< CFEngine_syntax_map(bodyTypes) >}} diff --git a/content/reference/components/_index.markdown b/content/reference/components/_index.markdown index fa778bf07..bfe9cc4a9 100644 --- a/content/reference/components/_index.markdown +++ b/content/reference/components/_index.markdown @@ -420,7 +420,7 @@ body common control **Description:** Defines the protocol to use for all outgoing connections. -[%CFEngine_promise_attribute(undefined)%] +{{< CFEngine_promise_attribute(undefined) >}} **Note:** `protocol_version` can be specified at the individual promise level using the [`body copy_from protocol_version`][files#protocol_version] @@ -573,7 +573,7 @@ body common control For a list of possible ciphers, see man page for "openssl ciphers". -[%CFEngine_promise_attribute(undefined)%] +{{< CFEngine_promise_attribute(undefined) >}} **Example:** @@ -593,7 +593,7 @@ body common control **Description:** Minimum tls version to allow for **outgoing** connections from components other than `cf-serverd`. -[%CFEngine_promise_attribute(1.0)%] +{{< CFEngine_promise_attribute(1.0) >}} ```cf3 body common control diff --git a/content/reference/components/cf-agent.markdown b/content/reference/components/cf-agent.markdown index 1b0300b59..6113e353f 100644 --- a/content/reference/components/cf-agent.markdown +++ b/content/reference/components/cf-agent.markdown @@ -21,7 +21,7 @@ affected by `common` and `agent` control bodies. ## Command reference -[%CFEngine_include_snippet(cf-agent.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-agent.help, [\s]*--[a-z], ^$) >}} ### --simulate @@ -560,7 +560,7 @@ time a network connection should attempt to connect or read from server. The time is in seconds. It is not a guaranteed number, since it depends on system behavior. -[%CFEngine_promise_attribute(30 seconds)% +{{< CFEngine_promise_attribute(30 seconds) >}} **Example:** @@ -757,7 +757,7 @@ automatically. **Example:** -[%CFEngine_include_example(files_auto_define.cf)%] +{{< CFEngine_include_example(files_auto_define.cf) >}} ### files_single_copy diff --git a/content/reference/components/cf-check.markdown b/content/reference/components/cf-check.markdown index 6eadc88b3..353491d26 100644 --- a/content/reference/components/cf-check.markdown +++ b/content/reference/components/cf-check.markdown @@ -9,4 +9,4 @@ Utility for diagnosis and repair of local CFEngine databases. ## Command reference -[%CFEngine_include_snippet(cf-check.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-check.help, [\s]*--[a-z], ^$) >}} diff --git a/content/reference/components/cf-execd.markdown b/content/reference/components/cf-execd.markdown index 692da6cde..8f73bdbb6 100644 --- a/content/reference/components/cf-execd.markdown +++ b/content/reference/components/cf-execd.markdown @@ -27,7 +27,7 @@ network. ## Command reference -[%CFEngine_include_snippet(cf-execd.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-execd.help, [\s]*--[a-z], ^$) >}} ## Control promises diff --git a/content/reference/components/cf-hub.markdown b/content/reference/components/cf-hub.markdown index 18ab72832..1f843b5e6 100644 --- a/content/reference/components/cf-hub.markdown +++ b/content/reference/components/cf-hub.markdown @@ -25,7 +25,7 @@ avoid reporting on data generated by test or extraordinary executions. ## Command reference -[%CFEngine_include_snippet(cf-hub.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-hub.help, [\s]*--[a-z], ^$) >}} ## Control promises diff --git a/content/reference/components/cf-key.markdown b/content/reference/components/cf-key.markdown index 930fb33a7..9e349fe71 100644 --- a/content/reference/components/cf-key.markdown +++ b/content/reference/components/cf-key.markdown @@ -12,4 +12,4 @@ The CFEngine key generator makes key pairs for [remote authentication][Client se ## Command reference -[%CFEngine_include_snippet(cf-key.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-key.help, [\s]*--[a-z], ^$) >}} diff --git a/content/reference/components/cf-monitord.markdown b/content/reference/components/cf-monitord.markdown index f82c681f5..cbeabb87f 100644 --- a/content/reference/components/cf-monitord.markdown +++ b/content/reference/components/cf-monitord.markdown @@ -21,7 +21,7 @@ affected by `common` and `monitor` control bodies. ## Command reference -[%CFEngine_include_snippet(cf-monitord.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-monitord.help, [\s]*--[a-z], ^$) >}} ## Standard measurements: diff --git a/content/reference/components/cf-net.markdown b/content/reference/components/cf-net.markdown index de6ccd931..f82b24e07 100644 --- a/content/reference/components/cf-net.markdown +++ b/content/reference/components/cf-net.markdown @@ -13,7 +13,7 @@ It is in some ways an extremely light-weight version of `cf-agent` - policy eval ## Command reference -[%CFEngine_include_snippet(cf-net.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-net.help, [\s]*--[a-z], ^$) >}} diff --git a/content/reference/components/cf-promises.markdown b/content/reference/components/cf-promises.markdown index 97e5cb40f..b184391f9 100644 --- a/content/reference/components/cf-promises.markdown +++ b/content/reference/components/cf-promises.markdown @@ -23,4 +23,4 @@ are not evaluated prematurely (as you would expect). ## Command reference -[%CFEngine_include_snippet(cf-promises.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-promises.help, [\s]*--[a-z], ^$) >}} diff --git a/content/reference/components/cf-reactor.markdown b/content/reference/components/cf-reactor.markdown index 9ad9064ca..167da1c77 100644 --- a/content/reference/components/cf-reactor.markdown +++ b/content/reference/components/cf-reactor.markdown @@ -25,4 +25,4 @@ refreshes the CMDB data file (`host_specific.json`) for the particular host. ## Command reference -[%CFEngine_include_snippet(cf-reactor.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-reactor.help, [\s]*--[a-z], ^$) >}} diff --git a/content/reference/components/cf-runagent.markdown b/content/reference/components/cf-runagent.markdown index 58fbd58ed..83808ddfe 100644 --- a/content/reference/components/cf-runagent.markdown +++ b/content/reference/components/cf-runagent.markdown @@ -24,7 +24,7 @@ matching the bundle names. ## Command reference -[%CFEngine_include_snippet(cf-runagent.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-runagent.help, [\s]*--[a-z], ^$) >}} **See also:** [bundle resource_type in server access promises][access#resource_type], [cfruncommand in body server control][cf-serverd#cfruncommand] diff --git a/content/reference/components/cf-secret.markdown b/content/reference/components/cf-secret.markdown index 7d893b68e..8d57ab371 100644 --- a/content/reference/components/cf-secret.markdown +++ b/content/reference/components/cf-secret.markdown @@ -11,7 +11,7 @@ Files can be encrypted for one or more public keys. A matching private key is re ## Command reference -[%CFEngine_include_snippet(cf-secret.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-secret.help, [\s]*--[a-z], ^$) >}} ## Example encrypting and decrypting data @@ -68,11 +68,11 @@ No difference **Policy:** -[%CFEngine_include_example(cf-secret.cf, #\+begin_src\s+cfengine3\s*, .*end_src)%] +{{< CFEngine_include_example(cf-secret.cf, #\+begin_src\s+cfengine3\s*, .*end_src) >}} **Example Output:** -[%CFEngine_include_example(cf-secret.cf, #\+begin_src\s+static_example_output\s*, .*end_src)%] +{{< CFEngine_include_example(cf-secret.cf, #\+begin_src\s+static_example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/components/cf-serverd.markdown b/content/reference/components/cf-serverd.markdown index f412c5c22..122f9e9a0 100644 --- a/content/reference/components/cf-serverd.markdown +++ b/content/reference/components/cf-serverd.markdown @@ -31,7 +31,7 @@ affected by `common` and `server` control bodies. ## Command reference -[%CFEngine_include_snippet(cf-serverd.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-serverd.help, [\s]*--[a-z], ^$) >}} ## Control promises @@ -134,7 +134,7 @@ allowlegacyconnects => { } In CFEngine >= 3.9, legacy protocol is disallowed by default, and you have to specify a list of hosts allowed to use the legacy protocol. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** [`protocol_version`][Components#protocol_version] @@ -143,7 +143,7 @@ specify a list of hosts allowed to use the legacy protocol. **Description:** List of TLS ciphers the server accepts both **incoming** and **outgoing** (in the case of client initiated reporting with CFEngine Enterprise) connections using `cf-serverd`. For a list of possible ciphers, see man page for "openssl ciphers". -[%CFEngine_promise_attribute(AES256-GCM-SHA384:AES256-SHA)%] +{{< CFEngine_promise_attribute(AES256-GCM-SHA384:AES256-SHA) >}} **Example:** @@ -174,7 +174,7 @@ this does not do anything as the classic protocol does not support TLS ciphers. **Description:** Minimum TLS version allowed for both **incoming** and **outgoing** (in the case of client initiated reporting with CFEngine Enterprise) connections using `cf-serverd`. -[%CFEngine_promise_attribute(1.0)%] +{{< CFEngine_promise_attribute(1.0) >}} **Example:** diff --git a/content/reference/components/cf-support.markdown b/content/reference/components/cf-support.markdown index ccf7882c7..9d95fe882 100644 --- a/content/reference/components/cf-support.markdown +++ b/content/reference/components/cf-support.markdown @@ -11,7 +11,7 @@ The utility will prompt for an optional support ticket number as well as prompt ## Command reference -[%CFEngine_include_snippet(cf-support.help, [\s]*--[a-z], ^$)%] +{{< CFEngine_include_snippet(cf-support.help, [\s]*--[a-z], ^$) >}} ## History diff --git a/content/reference/functions/TEMPLATE b/content/reference/functions/TEMPLATE index 9d8d703d3..fba9189f0 100644 --- a/content/reference/functions/TEMPLATE +++ b/content/reference/functions/TEMPLATE @@ -5,13 +5,13 @@ published: false tags: [reference, functions, more, tags] --- -[%CFEngine_function_prototype(arguments, here)%] +{{< CFEngine_function_prototype(arguments, here) >}} **Description:** Brief description of function. **Return type:** `data|int|real|string|(i|r|s)list|class|(i|r)range|` -[%CFEngine_function_attributes(arguments, here)%] +{{< CFEngine_function_attributes(arguments, here) >}} Write a detailed description here. @@ -19,15 +19,15 @@ Write a detailed description here. The whole thing: -[%CFEngine_include_snippet(type.cf)%] +{{< CFEngine_include_snippet(type.cf) >}} Or, selected sections: -[%CFEngine_include_snippet(type.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(type.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(type.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(type.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/_index.markdown b/content/reference/functions/_index.markdown index cfdd306a1..ec09d5844 100644 --- a/content/reference/functions/_index.markdown +++ b/content/reference/functions/_index.markdown @@ -11,7 +11,7 @@ take an arbitrary amount of arguments. They can return scalar (string|int|real|bool), list (slist, ilist, rlist) and data values: -[%CFEngine_include_example(function-return-types.cf)%] +{{< CFEngine_include_example(function-return-types.cf) >}} ### Boolean return type @@ -194,4 +194,4 @@ wants. There are a large number of functions built into CFEngine. The following tables might make it easier for you to find the function you need. -[%CFEngine_function_table()%] +{{< CFEngine_function_table() >}} diff --git a/content/reference/functions/accessedbefore.markdown b/content/reference/functions/accessedbefore.markdown index 1d44cc956..5594f8021 100644 --- a/content/reference/functions/accessedbefore.markdown +++ b/content/reference/functions/accessedbefore.markdown @@ -3,26 +3,26 @@ layout: default title: accessedbefore --- -[%CFEngine_function_prototype(newer,older)%] +{{< CFEngine_function_prototype(newer,older) >}} **Description:** Compares the `atime` fields of two files. Return true if `newer` was accessed before `older`. -[%CFEngine_function_attributes(newer, older)%] +{{< CFEngine_function_attributes(newer, older) >}} **Example:** Prepare: -[%CFEngine_include_snippet(accessedbefore.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(accessedbefore.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(accessedbefore.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(accessedbefore.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(accessedbefore.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(accessedbefore.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `changedbefore()`, `isnewerthan()` diff --git a/content/reference/functions/accumulated.markdown b/content/reference/functions/accumulated.markdown index 36df83b16..e7d1c9ff7 100644 --- a/content/reference/functions/accumulated.markdown +++ b/content/reference/functions/accumulated.markdown @@ -3,7 +3,7 @@ layout: default title: accumulated --- -[%CFEngine_function_prototype(years, months, days, hours, minutes, seconds)%] +{{< CFEngine_function_prototype(years, months, days, hours, minutes, seconds) >}} **Description:** Convert an accumulated amount of time into a system representation. diff --git a/content/reference/functions/ago.markdown b/content/reference/functions/ago.markdown index 1e8a1260a..33fe375fa 100644 --- a/content/reference/functions/ago.markdown +++ b/content/reference/functions/ago.markdown @@ -3,7 +3,7 @@ layout: default title: ago --- -[%CFEngine_function_prototype(years, months, days, hours, minutes, seconds)%] +{{< CFEngine_function_prototype(years, months, days, hours, minutes, seconds) >}} **Description:** Convert a time relative to now to an integer system representation. @@ -43,10 +43,10 @@ Seconds of runtime **Example:** -[%CFEngine_include_snippet(ago.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(ago.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(ago.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(ago.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `now()`, `accumulated()`, `irange()`. diff --git a/content/reference/functions/and.markdown b/content/reference/functions/and.markdown index 467d26ccc..b4f31a712 100644 --- a/content/reference/functions/and.markdown +++ b/content/reference/functions/and.markdown @@ -3,7 +3,7 @@ layout: default title: and --- -[%CFEngine_function_prototype(...)%] +{{< CFEngine_function_prototype(...) >}} **Description:** Returns `any` if all arguments evaluate to true and `!any` if any argument evaluates to false. diff --git a/content/reference/functions/basename.markdown b/content/reference/functions/basename.markdown index 0cc03ed57..846ac58b2 100644 --- a/content/reference/functions/basename.markdown +++ b/content/reference/functions/basename.markdown @@ -3,17 +3,17 @@ layout: default title: basename --- -[%CFEngine_function_prototype(filename, optional_extension)%] +{{< CFEngine_function_prototype(filename, optional_extension) >}} **Description:** Retrieves the basename of a filename. This function implements the same behavior of basename program on Unix and Unix-like operating systems. -[%CFEngine_function_attributes(filename, optional_extension)%] +{{< CFEngine_function_attributes(filename, optional_extension) >}} **Example:** -[%CFEngine_include_example(basename.cf)%] +{{< CFEngine_include_example(basename.cf) >}} **History:** diff --git a/content/reference/functions/bundlesmatching.markdown b/content/reference/functions/bundlesmatching.markdown index c0b649544..52d6a5e13 100644 --- a/content/reference/functions/bundlesmatching.markdown +++ b/content/reference/functions/bundlesmatching.markdown @@ -3,7 +3,7 @@ layout: default title: bundlesmatching --- -[%CFEngine_function_prototype(name, tag1, tag2, ...)%] +{{< CFEngine_function_prototype(name, tag1, tag2, ...) >}} **Description:** Return the list of defined bundles matching `name` and any tags given. Both bundlename and tags are regular expressions. `name` is @@ -23,14 +23,14 @@ to do dynamic inputs and a dynamic bundle call chain. The dynamic chain is constrained by an explicit regular expression to avoid accidental or intentional running of unwanted bundles. -[%CFEngine_function_attributes(name, tag1, tag2, ...)%] +{{< CFEngine_function_attributes(name, tag1, tag2, ...) >}} **Example:** -[%CFEngine_include_snippet(bundlesmatching.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(bundlesmatching.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(bundlesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(bundlesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`findfiles()`][findfiles]. diff --git a/content/reference/functions/bundlestate.markdown b/content/reference/functions/bundlestate.markdown index 1653eed40..3500e754c 100644 --- a/content/reference/functions/bundlestate.markdown +++ b/content/reference/functions/bundlestate.markdown @@ -3,7 +3,7 @@ layout: default title: bundlestate --- -[%CFEngine_function_prototype(bundlename)%] +{{< CFEngine_function_prototype(bundlename) >}} **Description:** Returns the current evaluation data state for bundle `bundlename`. @@ -20,15 +20,15 @@ The namespace of the bundle should **not** be included if it's in the that). But if the bundle is in another namespace, you must prefix the name with the namespace in the normal `mynamespace:mybundle` fashion. -[%CFEngine_function_attributes(bundlename)%] +{{< CFEngine_function_attributes(bundlename) >}} **Example:** -[%CFEngine_include_snippet(bundlestate.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(bundlestate.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(bundlestate.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(bundlestate.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `getindices()`, `classesmatching()`, `variablesmatching()`, `mergedata()`, [template_method][files#template_method], `mustache`, `inline_mustache`, `datastate()` diff --git a/content/reference/functions/callstack_callers.markdown b/content/reference/functions/callstack_callers.markdown index aa5bc2624..82f8f8826 100644 --- a/content/reference/functions/callstack_callers.markdown +++ b/content/reference/functions/callstack_callers.markdown @@ -3,11 +3,11 @@ layout: default title: callstack_callers --- -[%CFEngine_function_prototype()%] +{{< CFEngine_function_prototype() >}} **Description:** Return the call stack for the current promise. -[%CFEngine_function_attributes()%] +{{< CFEngine_function_attributes() >}} This is a call stack inspection function and the specific content may be tied to a specific CFEngine version. Using it requires writing code that takes the diff --git a/content/reference/functions/callstack_promisers.markdown b/content/reference/functions/callstack_promisers.markdown index c76b85819..b80095c17 100644 --- a/content/reference/functions/callstack_promisers.markdown +++ b/content/reference/functions/callstack_promisers.markdown @@ -3,11 +3,11 @@ layout: default title: callstack_promisers --- -[%CFEngine_function_prototype()%] +{{< CFEngine_function_prototype() >}} **Description:** Return the promisers along the call stack for the current promise. -[%CFEngine_function_attributes()%] +{{< CFEngine_function_attributes() >}} This is a call stack inspection function and the specific content may be tied to a specific CFEngine version. Using it requires writing code that takes the diff --git a/content/reference/functions/canonify.markdown b/content/reference/functions/canonify.markdown index 2ecf4ce1a..95f04ed48 100644 --- a/content/reference/functions/canonify.markdown +++ b/content/reference/functions/canonify.markdown @@ -3,20 +3,20 @@ layout: default title: canonify --- -[%CFEngine_function_prototype(text)%] +{{< CFEngine_function_prototype(text) >}} **Description:** Convert an arbitrary string `text` into a legal class name. This function turns arbitrary text into class data. -[%CFEngine_function_attributes(text)%] +{{< CFEngine_function_attributes(text) >}} **Example:** -[%CFEngine_include_snippet(canonify.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(canonify.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(canonify.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(canonify.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [classify()][classify], `canonifyuniquely()`. diff --git a/content/reference/functions/canonifyuniquely.markdown b/content/reference/functions/canonifyuniquely.markdown index ec0ec7d4d..53c3be4db 100644 --- a/content/reference/functions/canonifyuniquely.markdown +++ b/content/reference/functions/canonifyuniquely.markdown @@ -3,7 +3,7 @@ layout: default title: canonifyuniquely --- -[%CFEngine_function_prototype(text)%] +{{< CFEngine_function_prototype(text) >}} **Description:** Convert an arbitrary string `text` into a unique legal class name. @@ -16,7 +16,7 @@ A common use case is when you need unique array keys for each file in a list, but files in the list may have the same name when `canonify`-ed. -[%CFEngine_function_attributes(text)%] +{{< CFEngine_function_attributes(text) >}} **Example:** diff --git a/content/reference/functions/cf_version_after.markdown b/content/reference/functions/cf_version_after.markdown index d8532c4bf..99f2542da 100644 --- a/content/reference/functions/cf_version_after.markdown +++ b/content/reference/functions/cf_version_after.markdown @@ -3,19 +3,19 @@ layout: default title: cf_version_after --- -[%CFEngine_function_prototype(string)%] +{{< CFEngine_function_prototype(string) >}} **Description:** Returns `true` if local CFEngine version is newer than specified `string`. -[%CFEngine_function_attributes(string)%] +{{< CFEngine_function_attributes(string) >}} **Example:** -[%CFEngine_include_snippet(cf_version_after.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_after.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(cf_version_after.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_after.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `version_compare()`, `cf_version_maximum()`, `cf_version_minimum()`, `cf_version_before()`, `cf_version_at()`, `cf_version_between()`. diff --git a/content/reference/functions/cf_version_at.markdown b/content/reference/functions/cf_version_at.markdown index 2d1647661..75ad7b2f2 100644 --- a/content/reference/functions/cf_version_at.markdown +++ b/content/reference/functions/cf_version_at.markdown @@ -3,19 +3,19 @@ layout: default title: cf_version_at --- -[%CFEngine_function_prototype(string)%] +{{< CFEngine_function_prototype(string) >}} **Description:** Returns `true` if local CFEngine version is the same as specified `string`. -[%CFEngine_function_attributes(string)%] +{{< CFEngine_function_attributes(string) >}} **Example:** -[%CFEngine_include_snippet(cf_version_at.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_at.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(cf_version_at.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_at.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `version_compare()`, `cf_version_maximum()`, `cf_version_minimum()`, `cf_version_after()`, `cf_version_before()`, `cf_version_between()`. diff --git a/content/reference/functions/cf_version_before.markdown b/content/reference/functions/cf_version_before.markdown index 65e5c0e75..636365c46 100644 --- a/content/reference/functions/cf_version_before.markdown +++ b/content/reference/functions/cf_version_before.markdown @@ -3,19 +3,19 @@ layout: default title: cf_version_before --- -[%CFEngine_function_prototype(string)%] +{{< CFEngine_function_prototype(string) >}} **Description:** Returns `true` if local CFEngine version is older than specified `string`. -[%CFEngine_function_attributes(string)%] +{{< CFEngine_function_attributes(string) >}} **Example:** -[%CFEngine_include_snippet(cf_version_before.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_before.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(cf_version_before.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_before.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `version_compare()`, `cf_version_maximum()`, `cf_version_minimum()`, `cf_version_after()`, `cf_version_at()`, `cf_version_between()`. diff --git a/content/reference/functions/cf_version_between.markdown b/content/reference/functions/cf_version_between.markdown index d052bb2f9..7da23ede1 100644 --- a/content/reference/functions/cf_version_between.markdown +++ b/content/reference/functions/cf_version_between.markdown @@ -3,19 +3,19 @@ layout: default title: cf_version_between --- -[%CFEngine_function_prototype(string, string)%] +{{< CFEngine_function_prototype(string, string) >}} **Description:** Returns `true` if local CFEngine version is between the first `string` and the second `string`. This function is inclusive. -[%CFEngine_function_attributes(string, string)%] +{{< CFEngine_function_attributes(string, string) >}} **Example:** -[%CFEngine_include_snippet(cf_version_between.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_between.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(cf_version_between.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_between.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `version_compare()`, `cf_version_maximum()`, `cf_version_minimum()`, `cf_version_after()`, `cf_version_before()`, `cf_version_at()`. diff --git a/content/reference/functions/cf_version_maximum.markdown b/content/reference/functions/cf_version_maximum.markdown index bcf646f66..3caee789f 100644 --- a/content/reference/functions/cf_version_maximum.markdown +++ b/content/reference/functions/cf_version_maximum.markdown @@ -3,19 +3,19 @@ layout: default title: cf_version_maximum --- -[%CFEngine_function_prototype(string)%] +{{< CFEngine_function_prototype(string) >}} **Description:** Returns `true` if local CFEngine version is the same or older than specified `string`. -[%CFEngine_function_attributes(string)%] +{{< CFEngine_function_attributes(string) >}} **Example:** -[%CFEngine_include_snippet(cf_version_maximum.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_maximum.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(cf_version_maximum.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_maximum.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `version_compare()`, `cf_version_minimum()`, `cf_version_after()`, `cf_version_before()`, `cf_version_at()`, `cf_version_between()`. diff --git a/content/reference/functions/cf_version_minimum.markdown b/content/reference/functions/cf_version_minimum.markdown index 243c93dc0..37bcc79a5 100644 --- a/content/reference/functions/cf_version_minimum.markdown +++ b/content/reference/functions/cf_version_minimum.markdown @@ -3,19 +3,19 @@ layout: default title: cf_version_minimum --- -[%CFEngine_function_prototype(string)%] +{{< CFEngine_function_prototype(string) >}} **Description:** Returns `true` if local CFEngine version is newer than or equal to specified `string`. -[%CFEngine_function_attributes(string)%] +{{< CFEngine_function_attributes(string) >}} **Example:** -[%CFEngine_include_snippet(cf_version_minimum.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_minimum.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(cf_version_minimum.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(cf_version_minimum.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `version_compare()`, `cf_version_maximum()`, `cf_version_after()`, `cf_version_before()`, `cf_version_at()`, `cf_version_between()`. diff --git a/content/reference/functions/changedbefore.markdown b/content/reference/functions/changedbefore.markdown index 8215be263..ce76ac8b3 100644 --- a/content/reference/functions/changedbefore.markdown +++ b/content/reference/functions/changedbefore.markdown @@ -3,7 +3,7 @@ layout: default title: changedbefore --- -[%CFEngine_function_prototype(newer,older)%] +{{< CFEngine_function_prototype(newer,older) >}} **Description:** Compares the `ctime` fields of two files. @@ -13,7 +13,7 @@ Change times include both file permissions and file contents. Comparisons like this are normally used for updating files (like the 'make' command). -[%CFEngine_function_attributes(newer, older)%] +{{< CFEngine_function_attributes(newer, older) >}} **Example:** diff --git a/content/reference/functions/classesmatching.markdown b/content/reference/functions/classesmatching.markdown index 2b9716630..c8f5a6342 100644 --- a/content/reference/functions/classesmatching.markdown +++ b/content/reference/functions/classesmatching.markdown @@ -3,7 +3,7 @@ layout: default title: classesmatching --- -[%CFEngine_function_prototype(name, tag1, tag2, ...)%] +{{< CFEngine_function_prototype(name, tag1, tag2, ...) >}} **Description:** Return the list of set classes matching `name` and any tags given. Both `name` and tags are regular expressions. `name` is required, tags @@ -19,15 +19,15 @@ using the [`meta`][Promise types#meta] attribute. If no classes match `name` and any tags given then an empty list is returned. -[%CFEngine_function_attributes(name, tag1, tag2, ...)%] +{{< CFEngine_function_attributes(name, tag1, tag2, ...) >}} **Example:** -[%CFEngine_include_snippet(classesmatching.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(classesmatching.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(classesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(classesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [variablesmatching()][variablesmatching], [bundlesmatching()][bundlesmatching], [classes defined via augments][Augments#classes], [classmatch()][classmatch], [countclassesmatching()][countclassesmatching] diff --git a/content/reference/functions/classfiltercsv.markdown b/content/reference/functions/classfiltercsv.markdown index b58aa50dc..96ab955d3 100644 --- a/content/reference/functions/classfiltercsv.markdown +++ b/content/reference/functions/classfiltercsv.markdown @@ -3,7 +3,7 @@ layout: default title: classfiltercsv --- -[%CFEngine_function_prototype(filename, has_header, class_column, optional_sort_column)%] +{{< CFEngine_function_prototype(filename, has_header, class_column, optional_sort_column) >}} **Description:** Parses CSV data from an [RFC 4180](http://www.ietf.org/rfc/rfc4180.txt) compliant file `filename` (`CRLF` line endings required), and returns a data variable that is @@ -16,21 +16,21 @@ given column. Both `class_column` and `optional_sort_column` must be integer indices starting from `0`, and must be at most the total amount of columns minus `1`. -[%CFEngine_function_attributes(filename, has_header, class_column, optional_sort_column)%] +{{< CFEngine_function_attributes(filename, has_header, class_column, optional_sort_column) >}} **Example:** **Prepare CSV:** -[%CFEngine_include_snippet(classfiltercsv.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(classfiltercsv.cf, #\+begin_src prep, .*end_src) >}} **Policy:** -[%CFEngine_include_snippet(classfiltercsv.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(classfiltercsv.cf, #\+begin_src cfengine3, .*end_src) >}} **Output:** -[%CFEngine_include_snippet(classfiltercsv.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(classfiltercsv.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/classfilterdata.markdown b/content/reference/functions/classfilterdata.markdown index dd4706fb8..ae4468432 100644 --- a/content/reference/functions/classfilterdata.markdown +++ b/content/reference/functions/classfilterdata.markdown @@ -3,7 +3,7 @@ layout: default title: classfilterdata --- -[%CFEngine_function_prototype(data_container, data_structure, key_or_index)%] +{{< CFEngine_function_prototype(data_container, data_structure, key_or_index) >}} **Description:** This function filters a data container (`data_container`) based on defined @@ -22,27 +22,27 @@ If the `data_structure` argument is specified to be: - `"auto"`, the interpretation is automatically detected based on the data structure. -[%CFEngine_function_attributes(data_container, data_structure, key_or_index)%] +{{< CFEngine_function_attributes(data_container, data_structure, key_or_index) >}} **Example (with array of arrays):** **Policy:** -[%CFEngine_include_snippet(classfilterdata_array_of_arrays.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(classfilterdata_array_of_arrays.cf, #\+begin_src cfengine3, .*end_src) >}} **Output:** -[%CFEngine_include_snippet(classfilterdata_array_of_arrays.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(classfilterdata_array_of_arrays.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Example (with array of objects):** **Policy:** -[%CFEngine_include_snippet(classfilterdata_array_of_objects.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(classfilterdata_array_of_objects.cf, #\+begin_src cfengine3, .*end_src) >}} **Output:** -[%CFEngine_include_snippet(classfilterdata_array_of_objects.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(classfilterdata_array_of_objects.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/classify.markdown b/content/reference/functions/classify.markdown index 03b496ff2..bfe759527 100644 --- a/content/reference/functions/classify.markdown +++ b/content/reference/functions/classify.markdown @@ -3,14 +3,14 @@ layout: default title: classify --- -[%CFEngine_function_prototype(text)%] +{{< CFEngine_function_prototype(text) >}} **Description:** Returns whether the canonicalization of `text` is a currently set class. This is useful for transforming variables into classes. -[%CFEngine_function_attributes(text)%] +{{< CFEngine_function_attributes(text) >}} **Example:** diff --git a/content/reference/functions/classmatch.markdown b/content/reference/functions/classmatch.markdown index 610306ed9..e75d2460b 100644 --- a/content/reference/functions/classmatch.markdown +++ b/content/reference/functions/classmatch.markdown @@ -3,7 +3,7 @@ layout: default title: classmatch --- -[%CFEngine_function_prototype(regex, tag1, tag2, ...)%] +{{< CFEngine_function_prototype(regex, tag1, tag2, ...) >}} **Description:** Tests whether `regex` matches any currently set class. @@ -12,14 +12,14 @@ currently defined class, otherwise returns false. You can optionally restrict the search by tags, which you can list after the regular expression. -[%CFEngine_function_attributes(regex, tag1, tag2, ...)%] +{{< CFEngine_function_attributes(regex, tag1, tag2, ...) >}} **Example:** -[%CFEngine_include_snippet(classmatch.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(classmatch.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(classmatch.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(classmatch.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [canonify()][canonify], [classify()][classify], [classesmatching()][classesmatching], [classes defined via augments][Augments#classes], [countclassesmatching()][countclassesmatching] diff --git a/content/reference/functions/concat.markdown b/content/reference/functions/concat.markdown index 1d85fefa7..7de59bc9b 100644 --- a/content/reference/functions/concat.markdown +++ b/content/reference/functions/concat.markdown @@ -3,7 +3,7 @@ layout: default title: concat --- -[%CFEngine_function_prototype(...)%] +{{< CFEngine_function_prototype(...) >}} **Description:** Concatenates all arguments into a string. diff --git a/content/reference/functions/countclassesmatching.markdown b/content/reference/functions/countclassesmatching.markdown index 95160a48c..f57c1d730 100644 --- a/content/reference/functions/countclassesmatching.markdown +++ b/content/reference/functions/countclassesmatching.markdown @@ -3,7 +3,7 @@ layout: default title: countclassesmatching --- -[%CFEngine_function_prototype(regex, tag1, tag2, ...)%] +{{< CFEngine_function_prototype(regex, tag1, tag2, ...) >}} **Description:** Count the number of defined classes matching `regex`. @@ -13,14 +13,14 @@ of classes matched. You can optionally restrict the search by tags, which you can list after the regular expression. -[%CFEngine_function_attributes(regex, tag1, tag2, ...)%] +{{< CFEngine_function_attributes(regex, tag1, tag2, ...) >}} **Example:** -[%CFEngine_include_snippet(countclassesmatching.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(countclassesmatching.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(countclassesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(countclassesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [classes defined via augments][Augments#classes], [classmatch()][classmatch], [classesmatching()][classesmatching] diff --git a/content/reference/functions/countlinesmatching.markdown b/content/reference/functions/countlinesmatching.markdown index e8e8bac3b..347225b92 100644 --- a/content/reference/functions/countlinesmatching.markdown +++ b/content/reference/functions/countlinesmatching.markdown @@ -3,7 +3,7 @@ layout: default title: countlinesmatching --- -[%CFEngine_function_prototype(regex, filename)%] +{{< CFEngine_function_prototype(regex, filename) >}} **Description:** Count the number of lines in file `filename` matching `regex`. @@ -12,12 +12,12 @@ This function matches lines in the named file, using an [anchored][anchored] regular expression that should match the whole line, and returns the number of lines matched. -[%CFEngine_function_attributes(regex, filename)%] +{{< CFEngine_function_attributes(regex, filename) >}} **Example:** -[%CFEngine_include_snippet(countlinesmatching.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(countlinesmatching.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(countlinesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(countlinesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/data_expand.markdown b/content/reference/functions/data_expand.markdown index eea0852d4..8e96b2eee 100644 --- a/content/reference/functions/data_expand.markdown +++ b/content/reference/functions/data_expand.markdown @@ -3,7 +3,7 @@ layout: default title: data_expand --- -[%CFEngine_function_prototype(data_container)%] +{{< CFEngine_function_prototype(data_container) >}} **Description:** Transforms a data container to expand all variable references. @@ -19,21 +19,21 @@ expanded. This function is chiefly useful if you want to read data from an external source and it can contain variable references. -[%CFEngine_function_attributes(data_container)%] +{{< CFEngine_function_attributes(data_container) >}} **Example:** Prepare to run the example policy: -[%CFEngine_include_snippet(data_expand.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(data_expand.cf, #\+begin_src prep, .*end_src) >}} Policy: -[%CFEngine_include_snippet(data_expand.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(data_expand.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(data_expand.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(data_expand.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.7.0 (2015). The [collecting functions][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/data_readstringarray.markdown b/content/reference/functions/data_readstringarray.markdown index 058f3682f..948fac78a 100644 --- a/content/reference/functions/data_readstringarray.markdown +++ b/content/reference/functions/data_readstringarray.markdown @@ -3,7 +3,7 @@ layout: default title: data_readstringarray --- -[%CFEngine_function_prototype(filename, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_prototype(filename, comment, split, maxentries, maxbytes) >}} **Description:** Returns a data container (map) with up to `maxentries`-1 fields from the first `maxbytes` bytes of file @@ -17,21 +17,21 @@ The `comment` field is a multiline regular expression and will strip out unwanted patterns from the file being read, leaving unstripped characters to be split into fields. Using the empty string (`""`) indicates no comments. -[%CFEngine_function_attributes(filename, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_attributes(filename, comment, split, maxentries, maxbytes) >}} **Example:** Prepare: -[%CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `data_readstringarrayidx()`, `data` diff --git a/content/reference/functions/data_readstringarrayidx.markdown b/content/reference/functions/data_readstringarrayidx.markdown index fa0506a84..af17d80df 100644 --- a/content/reference/functions/data_readstringarrayidx.markdown +++ b/content/reference/functions/data_readstringarrayidx.markdown @@ -3,7 +3,7 @@ layout: default title: data_readstringarrayidx --- -[%CFEngine_function_prototype(filename, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_prototype(filename, comment, split, maxentries, maxbytes) >}} **Description:** Returns a data container (array) with up to `maxentries` fields from the first `maxbytes` bytes of file `filename`. @@ -15,21 +15,21 @@ non-identifiers at first field (e.g. duplicates or names with spaces), unlike The `comment` field will strip out unwanted patterns from the file being read, leaving unstripped characters to be split into fields. Using the empty string (`""`) indicates no comments. -[%CFEngine_function_attributes(filename, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_attributes(filename, comment, split, maxentries, maxbytes) >}} **Example:** Prepare: -[%CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(data_readstringarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `data_readstringarray()`, `data` diff --git a/content/reference/functions/data_regextract.markdown b/content/reference/functions/data_regextract.markdown index 3d0c58880..0efad01f4 100644 --- a/content/reference/functions/data_regextract.markdown +++ b/content/reference/functions/data_regextract.markdown @@ -3,7 +3,7 @@ layout: default title: data_regextract --- -[%CFEngine_function_prototype(regex, string)%] +{{< CFEngine_function_prototype(regex, string) >}} **Description:** Returns a data container filled with backreferences and named captures if the *multiline* [anchored][anchored] `regex` matches the @@ -36,15 +36,15 @@ PCRE named captures are described in http://pcre.org/pcre.txt and several syntax Since the regular expression is run with /dotall/ and /multiline/ modes, to match the end of a line, use ```[^\n]*``` instead of ```$```. -[%CFEngine_function_attributes(regex, string)%] +{{< CFEngine_function_attributes(regex, string) >}} **Example:** -[%CFEngine_include_snippet(data_regextract.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(data_regextract.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(data_regextract.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(data_regextract.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/data_sysctlvalues.markdown b/content/reference/functions/data_sysctlvalues.markdown index a834a0c21..999dc40bb 100644 --- a/content/reference/functions/data_sysctlvalues.markdown +++ b/content/reference/functions/data_sysctlvalues.markdown @@ -3,21 +3,21 @@ layout: default title: data_sysctlvalues --- -[%CFEngine_function_prototype()%] +{{< CFEngine_function_prototype() >}} **Description:** Returns all sysctl values using `/proc/sys`. -[%CFEngine_function_attributes()%] +{{< CFEngine_function_attributes() >}} **Example:** Policy: -[%CFEngine_include_example(data_sysctlvalues.cf, #\+begin_src\s+cfengine3, .*end_src)%] +{{< CFEngine_include_example(data_sysctlvalues.cf, #\+begin_src\s+cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(data_sysctlvalues.cf, #\+begin_src\s+mock_example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(data_sysctlvalues.cf, #\+begin_src\s+mock_example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/datastate.markdown b/content/reference/functions/datastate.markdown index 29925ed80..42480f1d1 100644 --- a/content/reference/functions/datastate.markdown +++ b/content/reference/functions/datastate.markdown @@ -3,7 +3,7 @@ layout: default title: datastate --- -[%CFEngine_function_prototype()%] +{{< CFEngine_function_prototype() >}} **Description:** Returns the current evaluation data state. @@ -21,15 +21,15 @@ clearer. Mustache templates (see [template_method][files#template_method]), if not given a `template_data`, will use the output of `datastate()` as their input. -[%CFEngine_function_attributes()%] +{{< CFEngine_function_attributes() >}} **Example:** -[%CFEngine_include_snippet(datastate.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(datastate.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(datastate.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(datastate.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `getindices()`, `classesmatching()`, `variablesmatching()`, `mergedata()`, [template_method][files#template_method], `mustache`, `inline_mustache`, `bundlestate()` diff --git a/content/reference/functions/difference.markdown b/content/reference/functions/difference.markdown index a411fc663..828f2ccb8 100644 --- a/content/reference/functions/difference.markdown +++ b/content/reference/functions/difference.markdown @@ -3,22 +3,22 @@ layout: default title: difference --- -[%CFEngine_function_prototype(list1, list2)%] +{{< CFEngine_function_prototype(list1, list2) >}} **Description:** Returns the unique elements in `list1` that are not in `list2`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list1, list2)%] +{{< CFEngine_function_attributes(list1, list2) >}} **Example:** -[%CFEngine_include_snippet(difference.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(difference.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(difference.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(difference.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/dirname.markdown b/content/reference/functions/dirname.markdown index 1566bdcff..26d713aa5 100644 --- a/content/reference/functions/dirname.markdown +++ b/content/reference/functions/dirname.markdown @@ -3,22 +3,22 @@ layout: default title: dirname --- -[%CFEngine_function_prototype(path)%] +{{< CFEngine_function_prototype(path) >}} **Description:** Return the parent directory name for given `path`. This function returns the directory name for `path`. If `path` is a directory, then the name of its parent directory is returned. -[%CFEngine_function_attributes(path)%] +{{< CFEngine_function_attributes(path) >}} **Example:** -[%CFEngine_include_snippet(dirname.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(dirname.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(dirname.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(dirname.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in 3.3.0, Nova 2.2.0 (2011) diff --git a/content/reference/functions/diskfree.markdown b/content/reference/functions/diskfree.markdown index 4f262c6ee..795df8286 100644 --- a/content/reference/functions/diskfree.markdown +++ b/content/reference/functions/diskfree.markdown @@ -3,19 +3,19 @@ layout: default title: diskfree --- -[%CFEngine_function_prototype(path)%] +{{< CFEngine_function_prototype(path) >}} **Descriptions**: Return the free space (in KB) available on the current partition of `path`. If `path` is not found, this function returns 0. -[%CFEngine_function_attributes(path)%] +{{< CFEngine_function_attributes(path) >}} **Example:** -[%CFEngine_include_snippet(diskfree.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(diskfree.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(diskfree.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(diskfree.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/escape.markdown b/content/reference/functions/escape.markdown index 4fe4c5674..04a97b75f 100644 --- a/content/reference/functions/escape.markdown +++ b/content/reference/functions/escape.markdown @@ -3,7 +3,7 @@ layout: default title: escape --- -[%CFEngine_function_prototype(text)%] +{{< CFEngine_function_prototype(text) >}} **Description:** Escape regular expression characters in `text`. @@ -12,15 +12,15 @@ expression is required, but the literal string contains special characters. The function simply 'escapes' all the regular expression characters, so that you do not have to. -[%CFEngine_function_attributes(path)%] +{{< CFEngine_function_attributes(path) >}} **Example:** -[%CFEngine_include_snippet(escape.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(escape.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(escape.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(escape.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} In this example, the string "192.168.2.1" is "escaped" to be equivalent to "192\\.168\\.2\\.1", because without the backslashes, the regular expression diff --git a/content/reference/functions/eval.markdown b/content/reference/functions/eval.markdown index c0ef77886..cf669175a 100644 --- a/content/reference/functions/eval.markdown +++ b/content/reference/functions/eval.markdown @@ -3,7 +3,7 @@ layout: default title: eval --- -[%CFEngine_function_prototype(expression, mode, options)%] +{{< CFEngine_function_prototype(expression, mode, options) >}} **Description:** Returns `expression` evaluated according to `mode` and `options`. Currently only the `math` and `class` modes with @@ -73,11 +73,11 @@ The following functions can be used, with parentheses: - `abs`: absolute value - `step`: 0 if the argument is negative, 1 otherwise -[%CFEngine_function_attributes(expression, mode, options)%] +{{< CFEngine_function_attributes(expression, mode, options) >}} **Example:** -[%CFEngine_include_example(eval.cf)%] +{{< CFEngine_include_example(eval.cf) >}} **History:** diff --git a/content/reference/functions/every.markdown b/content/reference/functions/every.markdown index 07f490141..f214c9d58 100644 --- a/content/reference/functions/every.markdown +++ b/content/reference/functions/every.markdown @@ -3,7 +3,7 @@ layout: default title: every --- -[%CFEngine_function_prototype(regex, list)%] +{{< CFEngine_function_prototype(regex, list) >}} **Description:** Returns whether every element in the variable `list` matches the [unanchored][unanchored] `regex`. @@ -20,11 +20,11 @@ list. **Example:** -[%CFEngine_include_snippet(every.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(every.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(every.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(every.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/execresult.markdown b/content/reference/functions/execresult.markdown index 8dc13d35c..a512674c3 100644 --- a/content/reference/functions/execresult.markdown +++ b/content/reference/functions/execresult.markdown @@ -3,7 +3,7 @@ layout: default title: execresult --- -[%CFEngine_function_prototype(command, shell, output)%] +{{< CFEngine_function_prototype(command, shell, output) >}} **Description:** Execute `command` and return output (both `stdout` and `stderr`) as `string`. @@ -18,20 +18,20 @@ potential security issue. The optional `output` argument allows you to select which output will be included, betweeen `stdout`, `stderr` or `both`. The default is `both`. -[%CFEngine_function_attributes(command, shell, output)%] +{{< CFEngine_function_attributes(command, shell, output) >}} **Example:** Prepare: -[%CFEngine_include_snippet(execresult.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(execresult.cf, #\+begin_src prep, .*end_src) >}} Policy: -[%CFEngine_include_snippet(execresult.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(execresult.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(execresult.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(execresult.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** you should never use this function to execute commands that make changes to the system, or perform lengthy computations. Such an diff --git a/content/reference/functions/execresult_as_data.markdown b/content/reference/functions/execresult_as_data.markdown index 1e80da971..225940b74 100644 --- a/content/reference/functions/execresult_as_data.markdown +++ b/content/reference/functions/execresult_as_data.markdown @@ -3,7 +3,7 @@ layout: default title: execresult_as_data --- -[%CFEngine_function_prototype(command, shell, output)%] +{{< CFEngine_function_prototype(command, shell, output) >}} **Description:** Execute `command` and return a data container including command output and exit code. @@ -11,17 +11,17 @@ Functions in the same way as [`execresult()`][execresult], and takes the same pa Unlike [`execresult()`][execresult], and [`returnszero()`][returnszero], this function allows you to test, store, or inspect both exit code and output from the same command execution. -[%CFEngine_function_attributes(command, shell, output)%] +{{< CFEngine_function_attributes(command, shell, output) >}} **Example:** Policy: -[%CFEngine_include_snippet(execresult_as_data.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(execresult_as_data.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(execresult_as_data.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(execresult_as_data.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** you should never use this function to execute commands that make changes to the system, or perform lengthy computations. Consider using diff --git a/content/reference/functions/expandrange.markdown b/content/reference/functions/expandrange.markdown index dd9cf7347..f0a3958e6 100644 --- a/content/reference/functions/expandrange.markdown +++ b/content/reference/functions/expandrange.markdown @@ -3,7 +3,7 @@ layout: default title: expandrange --- -[%CFEngine_function_prototype(string_template, stepsize)%] +{{< CFEngine_function_prototype(string_template, stepsize) >}} **Description:** Generates a list based on an ordered list of numbers selected from a range of integers, in steps specified by the second argument. @@ -13,7 +13,7 @@ be represented as regular expressions. The list of strings is composed from the in the first argument, and a numerical range in square brackets is replaced by successive numbers from the range. -[%CFEngine_function_attributes(string_template, stepsize)%] +{{< CFEngine_function_attributes(string_template, stepsize) >}} ```cf3 vars: diff --git a/content/reference/functions/file_hash.markdown b/content/reference/functions/file_hash.markdown index dd5308611..15713da33 100644 --- a/content/reference/functions/file_hash.markdown +++ b/content/reference/functions/file_hash.markdown @@ -3,7 +3,7 @@ layout: default title: file_hash --- -[%CFEngine_function_prototype(file, algorithm)%] +{{< CFEngine_function_prototype(file, algorithm) >}} **Description:** Return the hash of `file` using the hash `algorithm`. @@ -15,21 +15,21 @@ to get the same answer from this function as you would from every other tool, since it depends on how whitespace and end of file characters are handled. -[%CFEngine_function_attributes(file, algorithm)%] +{{< CFEngine_function_attributes(file, algorithm) >}} **Example:** Prepare: -[%CFEngine_include_snippet(filestat.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(filestat.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(file_hash.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(file_hash.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(file_hash.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(file_hash.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.7.0 diff --git a/content/reference/functions/fileexists.markdown b/content/reference/functions/fileexists.markdown index 7e209e7ad..8addc58b4 100644 --- a/content/reference/functions/fileexists.markdown +++ b/content/reference/functions/fileexists.markdown @@ -3,7 +3,7 @@ layout: default title: fileexists --- -[%CFEngine_function_prototype(filename)%] +{{< CFEngine_function_prototype(filename) >}} **Description:** Returns whether the file `filename` can be accessed. @@ -18,14 +18,14 @@ this function to return true. link target exists. Alternatively use `test` with `returnszero()`, for example `returnszero("/bin/test -f myfile")`. -[%CFEngine_function_attributes(filename)%] +{{< CFEngine_function_attributes(filename) >}} **Example:** -[%CFEngine_include_snippet(fileexists.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(fileexists.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(fileexists.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(fileexists.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `filestat()`, `isdir()`, `islink()`, `isplain()`, `returnszero()` diff --git a/content/reference/functions/filesexist.markdown b/content/reference/functions/filesexist.markdown index af4f2c0df..b9fd96a2d 100644 --- a/content/reference/functions/filesexist.markdown +++ b/content/reference/functions/filesexist.markdown @@ -3,7 +3,7 @@ layout: default title: filesexist --- -[%CFEngine_function_prototype(list)%] +{{< CFEngine_function_prototype(list) >}} **Description:** Returns whether all the files in `list` can be accessed. @@ -19,11 +19,11 @@ this function to return true. **Example:** -[%CFEngine_include_snippet(filesexist.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(filesexist.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(filesexist.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(filesexist.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.12. diff --git a/content/reference/functions/filesize.markdown b/content/reference/functions/filesize.markdown index 665b6435a..f22c4f8ab 100644 --- a/content/reference/functions/filesize.markdown +++ b/content/reference/functions/filesize.markdown @@ -3,23 +3,23 @@ layout: default title: filesize --- -[%CFEngine_function_prototype(filename)%] +{{< CFEngine_function_prototype(filename) >}} **Description:** Returns the size of the file `filename` in bytes. If the file object does not exist, the function call fails and the variable does not expand. -[%CFEngine_function_attributes(filename)%] +{{< CFEngine_function_attributes(filename) >}} **Example:** Run: -[%CFEngine_include_snippet(filesize.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(filesize.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(filesize.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(filesize.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.1.3, Nova 2.0.2 (2010). diff --git a/content/reference/functions/filestat.markdown b/content/reference/functions/filestat.markdown index f0cde4cb2..29ef7d0ed 100644 --- a/content/reference/functions/filestat.markdown +++ b/content/reference/functions/filestat.markdown @@ -3,7 +3,7 @@ layout: default title: filestat --- -[%CFEngine_function_prototype(filename, field)%] +{{< CFEngine_function_prototype(filename, field) >}} **Description:** Returns the requested file field `field` for the file object `filename`. @@ -45,15 +45,15 @@ On SELinux, the contexts are the same as what you see with `ls -Z`. Prepare: -[%CFEngine_include_snippet(filestat.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(filestat.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(filestat.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(filestat.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(filestat.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(filestat.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/filter.markdown b/content/reference/functions/filter.markdown index 50206de54..65b492168 100644 --- a/content/reference/functions/filter.markdown +++ b/content/reference/functions/filter.markdown @@ -3,7 +3,7 @@ layout: default title: filter --- -[%CFEngine_function_prototype(filter, list, is_regex, invert, max_return)%] +{{< CFEngine_function_prototype(filter, list, is_regex, invert, max_return) >}} **Description:** Transforms a list or data container into a list subset thereof. @@ -30,11 +30,11 @@ Invert filter. **Example:** -[%CFEngine_include_snippet(filter.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(filter.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(filter.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(filter.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/findfiles.markdown b/content/reference/functions/findfiles.markdown index 42936fba2..97eced76f 100644 --- a/content/reference/functions/findfiles.markdown +++ b/content/reference/functions/findfiles.markdown @@ -3,7 +3,7 @@ layout: default title: findfiles --- -[%CFEngine_function_prototype(glob1, glob2, ...)%] +{{< CFEngine_function_prototype(glob1, glob2, ...) >}} **Description:** Return the list of files that match any of the given glob patterns. @@ -28,11 +28,11 @@ allows you to do dynamic inputs and a dynamic bundle call chain. **Example:** -[%CFEngine_include_snippet(findfiles.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(findfiles.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(findfiles.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(findfiles.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/findfiles_up.markdown b/content/reference/functions/findfiles_up.markdown index 0a2b604b8..0ce04ccf0 100644 --- a/content/reference/functions/findfiles_up.markdown +++ b/content/reference/functions/findfiles_up.markdown @@ -3,7 +3,7 @@ layout: default title: findfiles_up --- -[%CFEngine_function_prototype(path, glob, level)%] +{{< CFEngine_function_prototype(path, glob, level) >}} **Description:** Return a data array of files that match a given glob pattern by searching up the directory tree. @@ -31,15 +31,15 @@ deep. * `[!a-z]` matches any letter not from `a` to `z`. * `{foo,bar}` matches `foo` or `bar`. -[%CFEngine_function_attributes(path, glob, level)%] +{{< CFEngine_function_attributes(path, glob, level) >}} **Example:** -[%CFEngine_include_snippet(findfiles_up.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(findfiles_up.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(findfiles_up.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(findfiles_up.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/findlocalusers.markdown b/content/reference/functions/findlocalusers.markdown index eb74b0d7f..43bda4319 100644 --- a/content/reference/functions/findlocalusers.markdown +++ b/content/reference/functions/findlocalusers.markdown @@ -3,11 +3,11 @@ layout: default title: findlocalusers --- -[%CFEngine_function_prototype(filter)%] +{{< CFEngine_function_prototype(filter) >}} **Description:** Returns a data container of all local users with their attributes that are matching a filter. If no filter is specified, it will return all the local users. -[%CFEngine_function_attributes(filter)%] +{{< CFEngine_function_attributes(filter) >}} The `filter` argument can be used to look up users with specific attributes that match values. The filter is a `"data"` container or `"slist"` comprised of pairs of attribute and value/regex pattern `{ "attribute1=value1", "attribute2=value2", ... }`. @@ -21,11 +21,11 @@ The possible attributes are: **Example:** -[%CFEngine_include_snippet(findlocalusers.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(findlocalusers.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(findlocalusers.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(findlocalusers.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/findprocesses.markdown b/content/reference/functions/findprocesses.markdown index b641a7efc..6f9575188 100644 --- a/content/reference/functions/findprocesses.markdown +++ b/content/reference/functions/findprocesses.markdown @@ -3,7 +3,7 @@ layout: default title: findprocesses --- -[%CFEngine_function_prototype(regex)%] +{{< CFEngine_function_prototype(regex) >}} **Description:** Return the list of processes that match the given regular expression `regex`. @@ -13,7 +13,7 @@ table. Use `.*sherlock.*` to find all the processes that match `sherlock`. Use `.*\bsherlock\b.*` to exclude partial matches like `sherlock123` (`\b` matches a word boundary). -[%CFEngine_function_attributes(regex)%] +{{< CFEngine_function_attributes(regex) >}} The returned data container is a list of key-value maps. Each one is guaranteed to have the key `pid` with the process ID. The key `line` diff --git a/content/reference/functions/format.markdown b/content/reference/functions/format.markdown index 8310b1f69..c9a59a4f2 100644 --- a/content/reference/functions/format.markdown +++ b/content/reference/functions/format.markdown @@ -3,7 +3,7 @@ layout: default title: format --- -[%CFEngine_function_prototype(string, ...)%] +{{< CFEngine_function_prototype(string, ...) >}} **Description:** Applies sprintf-style formatting to a given `string`. @@ -21,11 +21,11 @@ format *specifier* contains the *modifiers* `hLqjzt`; or if any format **Example:** -[%CFEngine_include_snippet(format.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(format.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(format.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(format.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Note:** the underlying `sprintf` system call may behave differently on some platforms for some formats. Test carefully. For example, the format `%08s` will use spaces to fill the string up to 8 characters on libc platforms, but on Darwin (Mac OS X) it will use zeroes. According to [SUSv4](http://pubs.opengroup.org/onlinepubs/9699919799/functions/sprintf.html) the behavior is undefined for this specific case. diff --git a/content/reference/functions/getacls.markdown b/content/reference/functions/getacls.markdown index 7e7e2bf75..0e29dfdd0 100644 --- a/content/reference/functions/getacls.markdown +++ b/content/reference/functions/getacls.markdown @@ -3,7 +3,7 @@ layout: default title: getacls --- -[%CFEngine_function_prototype(path, type)%] +{{< CFEngine_function_prototype(path, type) >}} **Description:** Return the Access Control List (ACL) for a given file- or directory path. diff --git a/content/reference/functions/getbundlemetatags.markdown b/content/reference/functions/getbundlemetatags.markdown index e79efa770..42692542b 100644 --- a/content/reference/functions/getbundlemetatags.markdown +++ b/content/reference/functions/getbundlemetatags.markdown @@ -3,11 +3,11 @@ layout: default title: getbundlemetatags --- -[%CFEngine_function_prototype(bundlename, optional_tag)%] +{{< CFEngine_function_prototype(bundlename, optional_tag) >}} **Description:** Returns the list of [`meta`][Promise types#meta] tags for bundle `bundlename`. -[%CFEngine_function_attributes(bundlename, optional_tag)%] +{{< CFEngine_function_attributes(bundlename, optional_tag) >}} The `optional_tag` can be used to look up a specific tag's value. If you have: @@ -30,11 +30,11 @@ then `getbundlemetatags( "example", "mykey" )` will return a list with two entri **Example:** -[%CFEngine_include_snippet(getbundlemetatags.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getbundlemetatags.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getbundlemetatags.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getbundlemetatags.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/getclassmetatags.markdown b/content/reference/functions/getclassmetatags.markdown index 76fc50b14..e14341b9a 100644 --- a/content/reference/functions/getclassmetatags.markdown +++ b/content/reference/functions/getclassmetatags.markdown @@ -3,11 +3,11 @@ layout: default title: getclassmetatags --- -[%CFEngine_function_prototype(classname, optional_tag)%] +{{< CFEngine_function_prototype(classname, optional_tag) >}} **Description:** Returns the list of [`meta`][Promise types#meta] tags for class `classname`. -[%CFEngine_function_attributes(classname, optional_tag)%] +{{< CFEngine_function_attributes(classname, optional_tag) >}} The `optional_tag` can be used to look up a specific tag's value. If you format your tags like `meta => { "mykey=myvalue1", "mykey=myvalue2"}` then the @@ -16,11 +16,11 @@ your tags like `meta => { "mykey=myvalue1", "mykey=myvalue2"}` then the **Example:** -[%CFEngine_include_snippet(getclassmetatags.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getclassmetatags.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getclassmetatags.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getclassmetatags.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/getenv.markdown b/content/reference/functions/getenv.markdown index 79686bb21..e051d9a61 100644 --- a/content/reference/functions/getenv.markdown +++ b/content/reference/functions/getenv.markdown @@ -3,7 +3,7 @@ layout: default title: getenv --- -[%CFEngine_function_prototype(variable, maxlength)%] +{{< CFEngine_function_prototype(variable, maxlength) >}} **Description:** Return the environment variable `variable`, truncated at `maxlength` characters @@ -13,15 +13,15 @@ Returns an empty string if the environment variable is not defined. lead to security issues. Choose a reasonable value based on the environment variable you are querying. -[%CFEngine_function_attributes(variable, maxlength)%] +{{< CFEngine_function_attributes(variable, maxlength) >}} **Example:** -[%CFEngine_include_snippet(getenv.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getenv.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getenv.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getenv.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** This function was introduced in CFEngine version 3.0.4 (2010) diff --git a/content/reference/functions/getfields.markdown b/content/reference/functions/getfields.markdown index f11902c1d..ce29725c5 100644 --- a/content/reference/functions/getfields.markdown +++ b/content/reference/functions/getfields.markdown @@ -3,7 +3,7 @@ layout: default title: getfields --- -[%CFEngine_function_prototype(regex, filename, split, array_lval)%] +{{< CFEngine_function_prototype(regex, filename, split, array_lval) >}} **Description:** Fill `array_lval` with fields in the lines from file `filename` that match `regex`, split on `split`. @@ -34,11 +34,11 @@ The base name of the array that returns the values. **Example:** -[%CFEngine_include_snippet(getfields.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getfields.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getfields.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getfields.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** This function matches lines (using a regular expression) in the named diff --git a/content/reference/functions/getgid.markdown b/content/reference/functions/getgid.markdown index 95e5fcfc8..ab64d8aae 100644 --- a/content/reference/functions/getgid.markdown +++ b/content/reference/functions/getgid.markdown @@ -3,7 +3,7 @@ layout: default title: getgid --- -[%CFEngine_function_prototype(groupname)%] +{{< CFEngine_function_prototype(groupname) >}} **Description:** Return the integer group id of the group `groupname` on this host. @@ -11,15 +11,15 @@ host. If the named group does not exist, the function will fail and the variable will not be defined. -[%CFEngine_function_attributes(groupname)%] +{{< CFEngine_function_attributes(groupname) >}} **Example:** -[%CFEngine_include_snippet(getgid.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getgid.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getgid.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getgid.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** On Windows, which does not support group ids, the variable will not be diff --git a/content/reference/functions/getindices.markdown b/content/reference/functions/getindices.markdown index ecd92fbbc..3a6c44363 100644 --- a/content/reference/functions/getindices.markdown +++ b/content/reference/functions/getindices.markdown @@ -3,7 +3,7 @@ layout: default title: getindices --- -[%CFEngine_function_prototype(varref)%] +{{< CFEngine_function_prototype(varref) >}} **Description:** Returns the list of keys in `varref` which can be the name of an array or container. @@ -27,15 +27,15 @@ variable. values. For each such `i` you can then ask for `getindices("varref[i]")` to get a list of the `j` values (and so on, for higher levels of indexing). -[%CFEngine_function_attributes(varref)%] +{{< CFEngine_function_attributes(varref) >}} **Example:** -[%CFEngine_include_snippet(getindices.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getindices.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getindices.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getindices.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/getuid.markdown b/content/reference/functions/getuid.markdown index 2dcb482a8..d59058f07 100644 --- a/content/reference/functions/getuid.markdown +++ b/content/reference/functions/getuid.markdown @@ -3,21 +3,21 @@ layout: default title: getuid --- -[%CFEngine_function_prototype(username)%] +{{< CFEngine_function_prototype(username) >}} **Description:** Return the integer user id of the named user on this host If the named user is not registered the variable will not be defined. -[%CFEngine_function_attributes(username)%] +{{< CFEngine_function_attributes(username) >}} **Example:** -[%CFEngine_include_snippet(getuid.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getuid.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getuid.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getuid.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** On Windows, which does not support user ids, the variable will not be defined. diff --git a/content/reference/functions/getuserinfo.markdown b/content/reference/functions/getuserinfo.markdown index 91dfeb750..3c42cf32a 100644 --- a/content/reference/functions/getuserinfo.markdown +++ b/content/reference/functions/getuserinfo.markdown @@ -3,7 +3,7 @@ layout: default title: getuserinfo --- -[%CFEngine_function_prototype(optional_uidorname)%] +{{< CFEngine_function_prototype(optional_uidorname) >}} **Description:** Return information about the current user or any other, looked up by user ID (UID) or user name. @@ -16,11 +16,11 @@ LDAP, for instance). On platforms that don't support these POSIX functions, the function simply fails. -[%CFEngine_function_attributes(optional_uidorname)%] +{{< CFEngine_function_attributes(optional_uidorname) >}} **Example:** -[%CFEngine_include_snippet(getuserinfo.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getuserinfo.cf, #\+begin_src cfengine3, .*end_src) >}} **Typical Results:** diff --git a/content/reference/functions/getusers.markdown b/content/reference/functions/getusers.markdown index c794d7c24..ab0f0dfd5 100644 --- a/content/reference/functions/getusers.markdown +++ b/content/reference/functions/getusers.markdown @@ -3,19 +3,19 @@ layout: default title: getusers --- -[%CFEngine_function_prototype(exclude_names, exclude_ids)%] +{{< CFEngine_function_prototype(exclude_names, exclude_ids) >}} **Description:** Returns a list of all users defined, except those names in the comma separated string of `exclude_names` and the comma separated string of uids in `exclude_ids` -[%CFEngine_function_attributes(exclude_names, exclude_ids)%] +{{< CFEngine_function_attributes(exclude_names, exclude_ids) >}} **Example:** -[%CFEngine_include_snippet(getusers.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getusers.cf, #\+begin_src cfengine3, .*end_src) >}} **Output:** -[%CFEngine_include_snippet(getusers.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getusers.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/getvalues.markdown b/content/reference/functions/getvalues.markdown index a3a1dcf5e..5eca4e05c 100644 --- a/content/reference/functions/getvalues.markdown +++ b/content/reference/functions/getvalues.markdown @@ -3,7 +3,7 @@ layout: default title: getvalues --- -[%CFEngine_function_prototype(varref)%] +{{< CFEngine_function_prototype(varref) >}} **Description:** Returns the list of values in `varref` which can be the name of an array or container. @@ -24,15 +24,15 @@ look at the values of `d[k]`, not at the top level of `d`. Make sure you specify the correct scope when supplying the name of the variable. -[%CFEngine_function_attributes(varref)%] +{{< CFEngine_function_attributes(varref) >}} **Example:** -[%CFEngine_include_snippet(getvalues.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getvalues.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getvalues.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getvalues.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/getvariablemetatags.markdown b/content/reference/functions/getvariablemetatags.markdown index f9f15f1b4..252d3e44f 100644 --- a/content/reference/functions/getvariablemetatags.markdown +++ b/content/reference/functions/getvariablemetatags.markdown @@ -3,14 +3,14 @@ layout: default title: getvariablemetatags --- -[%CFEngine_function_prototype(varname, optional_tag)%] +{{< CFEngine_function_prototype(varname, optional_tag) >}} **Description:** Returns the list of [`meta`][Promise types#meta] tags for variable `varname`. Make sure you specify the correct scope when supplying the name of the variable. -[%CFEngine_function_attributes(varname, optional_tag)%] +{{< CFEngine_function_attributes(varname, optional_tag) >}} The `optional_tag` can be used to look up a specific tag's value. If you format your tags like `meta => { "mykey=myvalue1", "mykey=myvalue2"}` then the @@ -19,11 +19,11 @@ your tags like `meta => { "mykey=myvalue1", "mykey=myvalue2"}` then the **Example:** -[%CFEngine_include_snippet(getvariablemetatags.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(getvariablemetatags.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(getvariablemetatags.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(getvariablemetatags.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/grep.markdown b/content/reference/functions/grep.markdown index 868885cdf..91722a457 100644 --- a/content/reference/functions/grep.markdown +++ b/content/reference/functions/grep.markdown @@ -3,22 +3,22 @@ layout: default title: grep --- -[%CFEngine_function_prototype(regex, list)%] +{{< CFEngine_function_prototype(regex, list) >}} **Description:** Returns the sub-list if items in `list` matching the [anchored][anchored] regular expression `regex`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(regex, list)%] +{{< CFEngine_function_attributes(regex, list) >}} **Example:** -[%CFEngine_include_snippet(grep.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(grep.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(grep.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(grep.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/groupexists.markdown b/content/reference/functions/groupexists.markdown index 5274b81b3..b794c36d7 100644 --- a/content/reference/functions/groupexists.markdown +++ b/content/reference/functions/groupexists.markdown @@ -3,18 +3,18 @@ layout: default title: groupexists --- -[%CFEngine_function_prototype(group)%] +{{< CFEngine_function_prototype(group) >}} **Description:** Returns whether a group `group` exists on this host. The group may be specified by name or identifier. -[%CFEngine_function_attributes(group)%] +{{< CFEngine_function_attributes(group) >}} **Example:** -[%CFEngine_include_snippet(groupexists.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(groupexists.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(groupexists.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(groupexists.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/hash.markdown b/content/reference/functions/hash.markdown index f7574a029..c32aa8ea5 100644 --- a/content/reference/functions/hash.markdown +++ b/content/reference/functions/hash.markdown @@ -3,7 +3,7 @@ layout: default title: hash --- -[%CFEngine_function_prototype(input, algorithm)%] +{{< CFEngine_function_prototype(input, algorithm) >}} **Description:** Return the hash of `input` using the hash `algorithm`. @@ -12,14 +12,14 @@ to get the same answer from this function as you would from every other tool, since it depends on how whitespace and end of file characters are handled. -[%CFEngine_function_attributes(input, algorithm)%] +{{< CFEngine_function_attributes(input, algorithm) >}} **Example:** -[%CFEngine_include_snippet(hash.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(hash.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(hash.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(hash.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `file_hash()` diff --git a/content/reference/functions/hash_to_int.markdown b/content/reference/functions/hash_to_int.markdown index 469305063..8ae1d6142 100644 --- a/content/reference/functions/hash_to_int.markdown +++ b/content/reference/functions/hash_to_int.markdown @@ -3,7 +3,7 @@ layout: default title: hash_to_int --- -[%CFEngine_function_prototype( lower, upper, string )%] +{{< CFEngine_function_prototype( lower, upper, string ) >}} **Description:** Generates an integer between `lower` and `upper` range based on hash of `string`. @@ -15,15 +15,15 @@ spreading out the scheduling, or even for static load balancing. The result would may be coupled with an `ifelse()` clause of some sort, or just used directly. -[%CFEngine_function_attributes(lower (inclusive), upper (exclusive), string)%] +{{< CFEngine_function_attributes(lower (inclusive), upper (exclusive), string) >}} **Example:** -[%CFEngine_include_snippet(hash_to_int.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(hash_to_int.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(hash_to_int.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(hash_to_int.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/hashmatch.markdown b/content/reference/functions/hashmatch.markdown index 48651499c..78f8d4825 100644 --- a/content/reference/functions/hashmatch.markdown +++ b/content/reference/functions/hashmatch.markdown @@ -3,14 +3,14 @@ layout: default title: hashmatch --- -[%CFEngine_function_prototype(filename, algorithm, hash)%] +{{< CFEngine_function_prototype(filename, algorithm, hash) >}} **Description:** Compute the hash of file `filename` using the hash `algorithm` and test if it matches `hash`. This function may be used to determine whether a system has a particular version of a binary file (e.g. software patch). -[%CFEngine_function_attributes(filename, algorithm, hash)%] +{{< CFEngine_function_attributes(filename, algorithm, hash) >}} `hash` is an ASCII representation of the hash for comparison. diff --git a/content/reference/functions/host2ip.markdown b/content/reference/functions/host2ip.markdown index 7983818ea..fe93aafb6 100644 --- a/content/reference/functions/host2ip.markdown +++ b/content/reference/functions/host2ip.markdown @@ -3,7 +3,7 @@ layout: default title: host2ip --- -[%CFEngine_function_prototype(hostname)%] +{{< CFEngine_function_prototype(hostname) >}} **Description:** Returns the primary name-service IP address for the named host `hostname`. If resolution fails, the input `hostname` is returned (for compatibility reasons). @@ -15,7 +15,7 @@ lookup procedure for a name, so it mimics internal processes and can therefore be used not only to cache multiple lookups in the configuration, but to debug the behavior of the resolver. -[%CFEngine_function_attributes(hostname)%] +{{< CFEngine_function_attributes(hostname) >}} **Example:** diff --git a/content/reference/functions/hostinnetgroup.markdown b/content/reference/functions/hostinnetgroup.markdown index f3d026e73..335dbb4a0 100644 --- a/content/reference/functions/hostinnetgroup.markdown +++ b/content/reference/functions/hostinnetgroup.markdown @@ -3,11 +3,11 @@ layout: default title: hostinnetgroup --- -[%CFEngine_function_prototype(netgroup)%] +{{< CFEngine_function_prototype(netgroup) >}} **Description:** True if the current host is in the named `netgroup`. -[%CFEngine_function_attributes(netgroup)%] +{{< CFEngine_function_attributes(netgroup) >}} **Example:** diff --git a/content/reference/functions/hostrange.markdown b/content/reference/functions/hostrange.markdown index 0b8b3f877..b9a436a3d 100644 --- a/content/reference/functions/hostrange.markdown +++ b/content/reference/functions/hostrange.markdown @@ -3,7 +3,7 @@ layout: default title: hostrange --- -[%CFEngine_function_prototype(prefix, range)%] +{{< CFEngine_function_prototype(prefix, range) >}} **Description:** Returns whether the unqualified name of the current host lies in the `range` of enumerated hostnames specified with `prefix`. @@ -18,12 +18,12 @@ numeric part of the unqualified host name and string comparison of `prefix` (lowercase) with the part of the unqualified host name until the last numeric part. -[%CFEngine_function_attributes(prefix, range)%] +{{< CFEngine_function_attributes(prefix, range) >}} **Example:** -[%CFEngine_include_example(hostrange.cf, #\+begin_src\s+cfengine3\s*, .*end_src)%] +{{< CFEngine_include_example(hostrange.cf, #\+begin_src\s+cfengine3\s*, .*end_src) >}} **Example Output:** -[%CFEngine_include_example(hostrange.cf, #\+begin_src\s+static_example_output\s*, .*end_src)%] +{{< CFEngine_include_example(hostrange.cf, #\+begin_src\s+static_example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/hostsseen.markdown b/content/reference/functions/hostsseen.markdown index 308722cf9..5057c4b2c 100644 --- a/content/reference/functions/hostsseen.markdown +++ b/content/reference/functions/hostsseen.markdown @@ -3,7 +3,7 @@ layout: default title: hostsseen --- -[%CFEngine_function_prototype(horizon, seen, field)%] +{{< CFEngine_function_prototype(horizon, seen, field) >}} **Description:** Returns a list with the information `field` of hosts that were seen or not seen within the last `horizon` hours up to `lastseenexpireafter`. @@ -13,7 +13,7 @@ within the number of hours specified in `horizon`. The argument `seen` may be lastseen or notseen, the latter selecting all hosts not observed to have connected within the specified time. -[%CFEngine_function_attributes(horizon, seen, field)%] +{{< CFEngine_function_attributes(horizon, seen, field) >}} **Example:** diff --git a/content/reference/functions/hostswithclass.markdown b/content/reference/functions/hostswithclass.markdown index 4059c9d1b..b8a948129 100644 --- a/content/reference/functions/hostswithclass.markdown +++ b/content/reference/functions/hostswithclass.markdown @@ -5,7 +5,7 @@ title: hostswithclass **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(class, field)%] +{{< CFEngine_function_prototype(class, field) >}} **Description:** Returns a list from the CFEngine Database with the information `field` of hosts on which `classs` is set. @@ -17,7 +17,7 @@ hostnames, ip-addresses or public key SHAs of hosts that have a given class. configuration files for (classes of) hosts. Hosts are selected based on the classes set during the most recently collected agent run. -[%CFEngine_function_attributes(class, field)%] +{{< CFEngine_function_attributes(class, field) >}} **Example:** diff --git a/content/reference/functions/hostswithgroup.markdown b/content/reference/functions/hostswithgroup.markdown index d8c5539ac..a645a2abc 100644 --- a/content/reference/functions/hostswithgroup.markdown +++ b/content/reference/functions/hostswithgroup.markdown @@ -5,13 +5,13 @@ title: hostswithgroup **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(group_name, field)%] +{{< CFEngine_function_prototype(group_name, field) >}} **Description:** Returns a list from the CFEngine Database with the information `field` of all hosts sharing the group `group_name`. On CFEngine Enterprise, this hub function can be used to return a list of hostnames, ip-addresses or public key SHAs of hosts that are from the same group. It works very similarly as its twin `hostswithclass()`. -[%CFEngine_function_attributes(group_name, field)%] +{{< CFEngine_function_attributes(group_name, field) >}} **Example:** diff --git a/content/reference/functions/hubknowledge.markdown b/content/reference/functions/hubknowledge.markdown index 4ab884f0f..b8b51dc8e 100644 --- a/content/reference/functions/hubknowledge.markdown +++ b/content/reference/functions/hubknowledge.markdown @@ -5,7 +5,7 @@ title: hubknowledge **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(id)%] +{{< CFEngine_function_prototype(id) >}} **Description:** Read global knowledge from the CFEngine Database host by `id`. @@ -27,7 +27,7 @@ a CFEngine system back to the client machines. The data available through this channel are generated automatically by discovery, unlike `remotescalar` which accesses user defined data. -[%CFEngine_function_attributes(id)%] +{{< CFEngine_function_attributes(id) >}} **Example:** diff --git a/content/reference/functions/ifelse.markdown b/content/reference/functions/ifelse.markdown index dbd2fbba1..ca284717c 100644 --- a/content/reference/functions/ifelse.markdown +++ b/content/reference/functions/ifelse.markdown @@ -3,7 +3,7 @@ layout: default title: ifelse --- -[%CFEngine_function_prototype(...)%] +{{< CFEngine_function_prototype(...) >}} **Description:** Evaluate each pair of arguments up to the last one as a (`class`, `value`) tuple, returning `value` if `class` is set. diff --git a/content/reference/functions/int.markdown b/content/reference/functions/int.markdown index e2e86ee2a..5e680acc7 100644 --- a/content/reference/functions/int.markdown +++ b/content/reference/functions/int.markdown @@ -3,17 +3,17 @@ layout: default title: int --- -[%CFEngine_function_prototype(string)%] +{{< CFEngine_function_prototype(string) >}} **Description:** Convert numeric string to int. -[%CFEngine_function_attributes(string)%] +{{< CFEngine_function_attributes(string) >}} If `string` represents a floating point number then the decimals are *truncated*. **Example:** -[%CFEngine_include_example(int.cf)%] +{{< CFEngine_include_example(int.cf) >}} **See also:** [`string()`][string] diff --git a/content/reference/functions/intersection.markdown b/content/reference/functions/intersection.markdown index 2dc38bef7..18b6467ec 100644 --- a/content/reference/functions/intersection.markdown +++ b/content/reference/functions/intersection.markdown @@ -3,20 +3,20 @@ layout: default title: intersection --- -[%CFEngine_function_prototype(list1, list2)%] +{{< CFEngine_function_prototype(list1, list2) >}} **Description:** Returns the unique elements in list1 that are also in list2. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list1, list2)%] +{{< CFEngine_function_attributes(list1, list2) >}} **Example:** -[%CFEngine_include_snippet(intersection.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(intersection.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(intersection.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(intersection.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [About collecting functions][Functions#collecting functions], `difference()`. diff --git a/content/reference/functions/ip2host.markdown b/content/reference/functions/ip2host.markdown index 410a5eca6..b699fa840 100644 --- a/content/reference/functions/ip2host.markdown +++ b/content/reference/functions/ip2host.markdown @@ -3,7 +3,7 @@ layout: default title: ip2host --- -[%CFEngine_function_prototype(ip)%] +{{< CFEngine_function_prototype(ip) >}} **Description:** Returns the primary name-service host name for the IP address `ip`. @@ -15,15 +15,15 @@ if supported by the resolver library. Note that DNS lookups may take time and thus cause CFEngine agents to wait for responses, slowing their progress significantly. -[%CFEngine_function_attributes(ip)%] +{{< CFEngine_function_attributes(ip) >}} **Example:** -[%CFEngine_include_snippet(ip2host.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(ip2host.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(ip2host.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(ip2host.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `host2ip()`, `iprange()`, `isipinsubnet()` diff --git a/content/reference/functions/iprange.markdown b/content/reference/functions/iprange.markdown index 82c78f1e3..b24c728af 100644 --- a/content/reference/functions/iprange.markdown +++ b/content/reference/functions/iprange.markdown @@ -3,14 +3,14 @@ layout: default title: iprange --- -[%CFEngine_function_prototype(range, optional_interface)%] +{{< CFEngine_function_prototype(range, optional_interface) >}} **Description:** Returns whether the current host lies in the range of IP addresses specified, optionally checking only `interface`. Pattern matching based on IP addresses. -[%CFEngine_function_attributes(range, optional_interface)%] +{{< CFEngine_function_attributes(range, optional_interface) >}} **Example:** diff --git a/content/reference/functions/irange.markdown b/content/reference/functions/irange.markdown index 311c0a65e..4a849b4c2 100644 --- a/content/reference/functions/irange.markdown +++ b/content/reference/functions/irange.markdown @@ -3,7 +3,7 @@ layout: default title: irange --- -[%CFEngine_function_prototype(arg1, arg2)%] +{{< CFEngine_function_prototype(arg1, arg2) >}} **Description:** Define a range of integer values for CFEngine internal use. @@ -12,7 +12,7 @@ generally interchangeably say `"1,10"` or `irange("1","10")`. However, if you want to create a range of dates or times, you must use `irange()` if you also use the functions `ago()`, `now()`, `accumulated()`, etc. -[%CFEngine_function_attributes(arg1, arg2)%] +{{< CFEngine_function_attributes(arg1, arg2) >}} **Example:** diff --git a/content/reference/functions/is_type.markdown b/content/reference/functions/is_type.markdown index 5ed3785d2..7d90a6552 100644 --- a/content/reference/functions/is_type.markdown +++ b/content/reference/functions/is_type.markdown @@ -3,11 +3,11 @@ layout: default title: is_type --- -[%CFEngine_function_prototype(var, type)%] +{{< CFEngine_function_prototype(var, type) >}} **Description:** Returns whether a variable `var` is of type `type` -[%CFEngine_function_attributes(var, type)%] +{{< CFEngine_function_attributes(var, type) >}} This function compares the type description of `var` with the string `type`. The function expects a variable identifier as the first argument and a type string as the second argument. The type accepts both the type and an optional subtype. The function evaluates to false by default if the variable or the type string is wrong. @@ -15,11 +15,11 @@ To see the possible data types and their subtypes, see `type()` **Example:** -[%CFEngine_include_snippet(is_type.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(is_type.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(is_type.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(is_type.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/isconnectable.markdown b/content/reference/functions/isconnectable.markdown index 7daa1d002..2d26bae95 100644 --- a/content/reference/functions/isconnectable.markdown +++ b/content/reference/functions/isconnectable.markdown @@ -3,17 +3,17 @@ layout: default title: isconnectable --- -[%CFEngine_function_prototype(hostname, port, timeout)%] +{{< CFEngine_function_prototype(hostname, port, timeout) >}} **Description:** Checks whether a port is connectable -[%CFEngine_function_attributes(hostname, port, timeout)%] +{{< CFEngine_function_attributes(hostname, port, timeout) >}} This function checks whether a `hostname`:`port` is connectable within `timeout` in seconds, before it times out. If `timeout` is 0, the connection blocks forever. `timeout` defaults to 30 s. **Example:** -[%CFEngine_include_example(isconnectable.cf)%] +{{< CFEngine_include_example(isconnectable.cf) >}} **History:** diff --git a/content/reference/functions/isdir.markdown b/content/reference/functions/isdir.markdown index 0a7f59baa..fb266a670 100644 --- a/content/reference/functions/isdir.markdown +++ b/content/reference/functions/isdir.markdown @@ -3,20 +3,20 @@ layout: default title: isdir --- -[%CFEngine_function_prototype(filename)%] +{{< CFEngine_function_prototype(filename) >}} **Description:** Returns whether the named object `filename` is a directory. The CFEngine process must have access to `filename` in order for this to work. -[%CFEngine_function_attributes(filename)%] +{{< CFEngine_function_attributes(filename) >}} **Example:** -[%CFEngine_include_snippet(isdir.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isdir.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isdir.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isdir.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `fileexists()`, `filestat()`, `islink()`, `isplain()`, `returnszero()` diff --git a/content/reference/functions/isexecutable.markdown b/content/reference/functions/isexecutable.markdown index e33bc57d2..840d013b0 100644 --- a/content/reference/functions/isexecutable.markdown +++ b/content/reference/functions/isexecutable.markdown @@ -3,18 +3,18 @@ layout: default title: isexecutable --- -[%CFEngine_function_prototype(filename)%] +{{< CFEngine_function_prototype(filename) >}} **Description:** Returns whether the named object `filename` has execution rights for the current user. -[%CFEngine_function_attributes(filename)%] +{{< CFEngine_function_attributes(filename) >}} **Example:** -[%CFEngine_include_snippet(isexecutable.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isexecutable.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isexecutable.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isexecutable.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.1.0b1,Nova 2.0.0b1 (2010) diff --git a/content/reference/functions/isgreaterthan.markdown b/content/reference/functions/isgreaterthan.markdown index 1048b2e8d..a4e53f1cf 100644 --- a/content/reference/functions/isgreaterthan.markdown +++ b/content/reference/functions/isgreaterthan.markdown @@ -3,19 +3,19 @@ layout: default title: isgreaterthan --- -[%CFEngine_function_prototype(value1, value2)%] +{{< CFEngine_function_prototype(value1, value2) >}} **Description:** Returns whether `value1` is greater than `value2`. The comparison is made numerically if possible. If the values are strings, the comparison is lexical (based on C's strcmp()). -[%CFEngine_function_attributes(value1, value2)%] +{{< CFEngine_function_attributes(value1, value2) >}} **Example:** -[%CFEngine_include_snippet(isgreaterthan.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isgreaterthan.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isgreaterthan.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isgreaterthan.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/isipinsubnet.markdown b/content/reference/functions/isipinsubnet.markdown index b28e3284e..4112d494e 100644 --- a/content/reference/functions/isipinsubnet.markdown +++ b/content/reference/functions/isipinsubnet.markdown @@ -3,21 +3,21 @@ layout: default title: isipinsubnet --- -[%CFEngine_function_prototype(range, ip_address1, ip_address2, ...)%] +{{< CFEngine_function_prototype(range, ip_address1, ip_address2, ...) >}} **Description:** Returns whether the given `range` contains any of the following IP addresses. -[%CFEngine_function_attributes(range, ip_address1, ip_address2, ...)%] +{{< CFEngine_function_attributes(range, ip_address1, ip_address2, ...) >}} **Example:** Run: -[%CFEngine_include_snippet(isipinsubnet.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isipinsubnet.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isipinsubnet.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isipinsubnet.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `iprange()`, `host2ip()`, `ip2host()` diff --git a/content/reference/functions/islessthan.markdown b/content/reference/functions/islessthan.markdown index 1516653cd..74ed57d5a 100644 --- a/content/reference/functions/islessthan.markdown +++ b/content/reference/functions/islessthan.markdown @@ -3,21 +3,21 @@ layout: default title: islessthan --- -[%CFEngine_function_prototype(value1, value2)%] +{{< CFEngine_function_prototype(value1, value2) >}} **Description:** Returns whether `value1` is less than `value2`. The comparison is made numerically if possible. If the values are strings, the comparison is lexical (based on C's strcmp()). -[%CFEngine_function_attributes(value1, value2)%] +{{< CFEngine_function_attributes(value1, value2) >}} **Example:** -[%CFEngine_include_snippet(islessthan.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(islessthan.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(islessthan.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(islessthan.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`isgreaterthan()`][isgreaterthan]. diff --git a/content/reference/functions/islink.markdown b/content/reference/functions/islink.markdown index 1816392bc..8888fe5fe 100644 --- a/content/reference/functions/islink.markdown +++ b/content/reference/functions/islink.markdown @@ -3,7 +3,7 @@ layout: default title: islink --- -[%CFEngine_function_prototype(filename)%] +{{< CFEngine_function_prototype(filename) >}} **Description:** Returns whether the named object `filename` is a symbolic link. @@ -19,20 +19,20 @@ be detected using this function. expected target, and check if the link target exists. Alternatively use `test` with `returnszero()`, for example `returnszero("/bin/test -f myfile")`. -[%CFEngine_function_attributes(filename)%] +{{< CFEngine_function_attributes(filename) >}} **Example:** Prepare: -[%CFEngine_include_snippet(islink.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(islink.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(islink.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(islink.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(islink.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(islink.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `fileexists()`, `filestat()`, `isdir()`, `isplain()`, `returnszero()` diff --git a/content/reference/functions/isnewerthan.markdown b/content/reference/functions/isnewerthan.markdown index aa6e8c572..b0f0a0035 100644 --- a/content/reference/functions/isnewerthan.markdown +++ b/content/reference/functions/isnewerthan.markdown @@ -3,7 +3,7 @@ layout: default title: isnewerthan --- -[%CFEngine_function_prototype(newer, older)%] +{{< CFEngine_function_prototype(newer, older) >}} **Description:** Returns whether the file `newer` is newer (modified later) than the file `older`. @@ -12,20 +12,20 @@ This function compares the modification time (mtime) of the files. Note that access changes such as ownership and permissions as well as status changes such as last time the file was read are not included in the mtime timestamp. -[%CFEngine_function_attributes(newer, older)%] +{{< CFEngine_function_attributes(newer, older) >}} **Example:** Prepare: -[%CFEngine_include_snippet(isnewerthan.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(isnewerthan.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(isnewerthan.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isnewerthan.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isnewerthan.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isnewerthan.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `accessedbefore()`, `changedbefore()` diff --git a/content/reference/functions/isnewerthantime.markdown b/content/reference/functions/isnewerthantime.markdown index 219c14720..2acda460a 100644 --- a/content/reference/functions/isnewerthantime.markdown +++ b/content/reference/functions/isnewerthantime.markdown @@ -3,7 +3,7 @@ layout: default title: isnewerthantime --- -[%CFEngine_function_prototype(file, time)%] +{{< CFEngine_function_prototype(file, time) >}} **Description:** Returns whether the file `file` is newer (modified later) than the time `time`. @@ -12,20 +12,20 @@ This function compares the modification time (mtime) of the file. Note that access changes such as ownership and permissions as well as status changes such as last time the file was read are not included in the mtime timestamp. -[%CFEngine_function_attributes(file, time)%] +{{< CFEngine_function_attributes(file, time) >}} **Example:** Prepare: -[%CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `isnewerthan()` diff --git a/content/reference/functions/isplain.markdown b/content/reference/functions/isplain.markdown index 10aa84a47..c84e11450 100644 --- a/content/reference/functions/isplain.markdown +++ b/content/reference/functions/isplain.markdown @@ -3,19 +3,19 @@ layout: default title: isplain --- -[%CFEngine_function_prototype(filename)%] +{{< CFEngine_function_prototype(filename) >}} **Description:** Returns whether the named object `filename` is a plain/regular file. -[%CFEngine_function_attributes(filename)%] +{{< CFEngine_function_attributes(filename) >}} **Example:** -[%CFEngine_include_snippet(isplain.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isplain.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isplain.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isplain.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `fileexists()`, `filestat()`, `isdir()`, `islink()`, `returnszero()` diff --git a/content/reference/functions/isreadable.markdown b/content/reference/functions/isreadable.markdown index 214fb4e8e..53166a0fc 100644 --- a/content/reference/functions/isreadable.markdown +++ b/content/reference/functions/isreadable.markdown @@ -3,7 +3,7 @@ layout: default title: isreadable --- -[%CFEngine_function_prototype(path, timeout)%] +{{< CFEngine_function_prototype(path, timeout) >}} **Description:** Check if a file is readable. @@ -38,11 +38,11 @@ penalty. **Example:** -[%CFEngine_include_snippet(isreadable.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isreadable.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isreadable.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isreadable.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in 3.22. diff --git a/content/reference/functions/isvariable.markdown b/content/reference/functions/isvariable.markdown index 02af50866..b15088dc1 100644 --- a/content/reference/functions/isvariable.markdown +++ b/content/reference/functions/isvariable.markdown @@ -3,7 +3,7 @@ layout: default title: isvariable --- -[%CFEngine_function_prototype(var)%] +{{< CFEngine_function_prototype(var) >}} **Description:** Returns whether a variable named `var` is defined. @@ -12,12 +12,12 @@ The variable need only exist. This says nothing about its value. Use are also checked, so this is a way to check if a classic CFEngine array or a data container has a specific key or element. -[%CFEngine_function_attributes(var)%] +{{< CFEngine_function_attributes(var) >}} **Example:** -[%CFEngine_include_snippet(isvariable.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(isvariable.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(isvariable.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(isvariable.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/join.markdown b/content/reference/functions/join.markdown index 6af4f2ab6..bd085d14f 100644 --- a/content/reference/functions/join.markdown +++ b/content/reference/functions/join.markdown @@ -3,7 +3,7 @@ layout: default title: join --- -[%CFEngine_function_prototype(glue, list)%] +{{< CFEngine_function_prototype(glue, list) >}} **Description:** Join the items of `list` into a string, using the conjunction in `glue`. @@ -12,15 +12,15 @@ join string in first argument. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(glue, list)%] +{{< CFEngine_function_attributes(glue, list) >}} **Example:** -[%CFEngine_include_snippet(join.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(join.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(join.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(join.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/lastnode.markdown b/content/reference/functions/lastnode.markdown index 06fabf2c7..89faeb4d1 100644 --- a/content/reference/functions/lastnode.markdown +++ b/content/reference/functions/lastnode.markdown @@ -3,7 +3,7 @@ layout: default title: lastnode --- -[%CFEngine_function_prototype(string, separator)%] +{{< CFEngine_function_prototype(string, separator) >}} **Description:** Returns the part of `string` after the last `separator`. @@ -11,15 +11,15 @@ This function returns the final node in a chain, given a regular expression to split on. This is mainly useful for finding leaf-names of files, from a fully qualified path name. -[%CFEngine_function_attributes(string, separator)%] +{{< CFEngine_function_attributes(string, separator) >}} **Example:** -[%CFEngine_include_snippet(lastnode.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(lastnode.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(lastnode.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(lastnode.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`filestat()`][filestat], [`dirname()`][dirname], [`splitstring()`][splitstring]. diff --git a/content/reference/functions/laterthan.markdown b/content/reference/functions/laterthan.markdown index 2b4f27ac7..28804efff 100644 --- a/content/reference/functions/laterthan.markdown +++ b/content/reference/functions/laterthan.markdown @@ -3,7 +3,7 @@ layout: default title: laterthan --- -[%CFEngine_function_prototype(year, month, day, hour, minute, second)%] +{{< CFEngine_function_prototype(year, month, day, hour, minute, second) >}} **Description:** Returns whether the current time is later than the given date and time. @@ -11,7 +11,7 @@ date and time. The specified date/time is an absolute date in the local timezone. Note that, unlike some other functions, the month argument is 1-based (i.e. 1 corresponds to January). -[%CFEngine_function_attributes(year, month, day, hour, minute, second)%] +{{< CFEngine_function_attributes(year, month, day, hour, minute, second) >}} **Example:** diff --git a/content/reference/functions/ldaparray.markdown b/content/reference/functions/ldaparray.markdown index 514677b2b..eb775f94b 100644 --- a/content/reference/functions/ldaparray.markdown +++ b/content/reference/functions/ldaparray.markdown @@ -5,7 +5,7 @@ title: ldaparray **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(array, uri, dn, filter, scope, security)%] +{{< CFEngine_function_prototype(array, uri, dn, filter, scope, security) >}} **Description:** Fills `array` with the entire LDAP record, and returns whether there was a match for the search. @@ -14,7 +14,7 @@ This function retrieves an entire record with all elements and populates an associative array with the entries. It returns a class that is true if there was a match for the search, and false if nothing was retrieved. -[%CFEngine_function_attributes(array, uri, dn, filter, scope, security)%] +{{< CFEngine_function_attributes(array, uri, dn, filter, scope, security) >}} `dn` specifies the distinguished name, an ldap formatted name built from components, e.g. "dc=cfengine,dc=com". `filter` is an ldap search, e.g. diff --git a/content/reference/functions/ldaplist.markdown b/content/reference/functions/ldaplist.markdown index 874855d53..a181df08b 100644 --- a/content/reference/functions/ldaplist.markdown +++ b/content/reference/functions/ldaplist.markdown @@ -5,14 +5,14 @@ title: ldaplist **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(uri, dn, filter, record, scope, security)%] +{{< CFEngine_function_prototype(uri, dn, filter, record, scope, security) >}} **Description:** Returns a list with all named values from multiple ldap records. This function retrieves a single field from all matching LDAP records identified by the search parameters. -[%CFEngine_function_attributes(uri, dn, filter, record, scope, security)%] +{{< CFEngine_function_attributes(uri, dn, filter, record, scope, security) >}} `dn` specifies the distinguished name, an ldap formatted name built from components, e.g. "dc=cfengine,dc=com". `filter` is an ldap search, e.g. diff --git a/content/reference/functions/ldapvalue.markdown b/content/reference/functions/ldapvalue.markdown index 899c3a45d..c0656dce3 100644 --- a/content/reference/functions/ldapvalue.markdown +++ b/content/reference/functions/ldapvalue.markdown @@ -5,14 +5,14 @@ title: ldapvalue **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(uri, dn, filter, record, scope, security)%] +{{< CFEngine_function_prototype(uri, dn, filter, record, scope, security) >}} **Description:** Returns the first matching named value from ldap. This function retrieves a single field from a single LDAP record identified by the search parameters. The first matching value it taken. -[%CFEngine_function_attributes(uri, dn, filter, record, scope, security)%] +{{< CFEngine_function_attributes(uri, dn, filter, record, scope, security) >}} `dn` specifies the distinguished name, an ldap formatted name built from components, e.g. "dc=cfengine,dc=com". `filter` is an ldap search, e.g. diff --git a/content/reference/functions/length.markdown b/content/reference/functions/length.markdown index 60bfb5f5c..1a9f4e7b6 100644 --- a/content/reference/functions/length.markdown +++ b/content/reference/functions/length.markdown @@ -3,21 +3,21 @@ layout: default title: length --- -[%CFEngine_function_prototype(list)%] +{{< CFEngine_function_prototype(list) >}} **Description:** Returns the length of `list`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list)%] +{{< CFEngine_function_attributes(list) >}} **Example:** -[%CFEngine_include_snippet(length.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(length.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(length.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(length.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/lsdir.markdown b/content/reference/functions/lsdir.markdown index f79f84e01..307006b87 100644 --- a/content/reference/functions/lsdir.markdown +++ b/content/reference/functions/lsdir.markdown @@ -3,22 +3,22 @@ layout: default title: lsdir --- -[%CFEngine_function_prototype(path, regex, include_base)%] +{{< CFEngine_function_prototype(path, regex, include_base) >}} **Description:** Returns a list of files in the directory `path` matching the regular expression `regex`. If `include_base` is true, full paths are returned, otherwise only names relative to the directory are returned. -[%CFEngine_function_attributes(path, regex, include_base)%] +{{< CFEngine_function_attributes(path, regex, include_base) >}} **Example:** -[%CFEngine_include_snippet(lsdir.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(lsdir.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(lsdir.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(lsdir.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Tips:** diff --git a/content/reference/functions/makerule.markdown b/content/reference/functions/makerule.markdown index c72c6212c..731211265 100644 --- a/content/reference/functions/makerule.markdown +++ b/content/reference/functions/makerule.markdown @@ -3,7 +3,7 @@ layout: default title: makerule --- -[%CFEngine_function_prototype(target, sources)%] +{{< CFEngine_function_prototype(target, sources) >}} **Description:** Evaluates whether a `target` file needs to be built or rebuilt from one or more `sources` files. @@ -27,7 +27,7 @@ The makerule function emulates the same semantics and sets a class if the target needs to be built or rebuit, i.e. if the top line of an equivalent makefile is true. -[%CFEngine_function_attributes(target, sources)%] +{{< CFEngine_function_attributes(target, sources) >}} The `sources` argument may be either a scalar (indicating a single source) or a list reference or a data container. If the `sources` diff --git a/content/reference/functions/maparray.markdown b/content/reference/functions/maparray.markdown index c3fd35993..d870f1669 100644 --- a/content/reference/functions/maparray.markdown +++ b/content/reference/functions/maparray.markdown @@ -3,7 +3,7 @@ layout: default title: maparray --- -[%CFEngine_function_prototype(pattern, array_or_container)%] +{{< CFEngine_function_prototype(pattern, array_or_container) >}} **Description:** Returns a list with each `array_or_container` element modified by a `pattern`. @@ -26,15 +26,15 @@ value (implicit looping). The order of the array keys is not guaranteed. Use the `sort` function if you need order in the resulting output. -[%CFEngine_function_attributes(pattern, array_or_container)%] +{{< CFEngine_function_attributes(pattern, array_or_container) >}} **Example:** -[%CFEngine_include_snippet(maparray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(maparray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(maparray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(maparray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. The delayed evaluation behavior was introduced in 3.10. diff --git a/content/reference/functions/mapdata.markdown b/content/reference/functions/mapdata.markdown index 8f1f46360..0f5ac43ae 100644 --- a/content/reference/functions/mapdata.markdown +++ b/content/reference/functions/mapdata.markdown @@ -3,7 +3,7 @@ layout: default title: mapdata --- -[%CFEngine_function_prototype(interpretation, pattern, array_or_container)%] +{{< CFEngine_function_prototype(interpretation, pattern, array_or_container) >}} **Description:** Returns a data container holding a JSON array. The array is a map across each element of `array_or_container`, modified by @@ -27,15 +27,15 @@ the example below for an illustration. The order of the keys is not guaranteed. Use the `sort()` function if you need order in the resulting output. -[%CFEngine_function_attributes(interpretation, pattern, array_or_container)%] +{{< CFEngine_function_attributes(interpretation, pattern, array_or_container) >}} **Example:** -[%CFEngine_include_snippet(mapdata.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(mapdata.cf, #\+begin_src cfengine3, .*end_src) >}} Output: (when `show_example` is defined) -[%CFEngine_include_snippet(mapdata.cf, #\+begin_src\s+show_example_example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(mapdata.cf, #\+begin_src\s+show_example_example_output\s*, .*end_src) >}} **json_pipe** @@ -52,11 +52,11 @@ power for advanced cases where the built-in CFEngine functions are not enough. **Example with json_pipe:** -[%CFEngine_include_snippet(mapdata_jsonpipe.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(mapdata_jsonpipe.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(mapdata_jsonpipe.cf, #\+begin_src\s+output\s*, .*end_src)%] +{{< CFEngine_include_snippet(mapdata_jsonpipe.cf, #\+begin_src\s+output\s*, .*end_src) >}} **History:** Was introduced in 3.7.0. `canonify` mode was introduced in 3.9.0. The [collecting function][Functions#collecting functions] behavior was added in 3.9. The `json_pipe` mode was added in 3.9. The delayed evaluation behavior was introduced in 3.10. diff --git a/content/reference/functions/maplist.markdown b/content/reference/functions/maplist.markdown index dfe7fdf82..41a7ca514 100644 --- a/content/reference/functions/maplist.markdown +++ b/content/reference/functions/maplist.markdown @@ -3,7 +3,7 @@ layout: default title: maplist --- -[%CFEngine_function_prototype(pattern, list)%] +{{< CFEngine_function_prototype(pattern, list) >}} **Description:** Return a list with each element in `list` modified by a pattern. @@ -16,15 +16,15 @@ The `$(this)` variable expands to the currently processed entry from `list`. This is essentially like the map() function in Perl, and applies to lists. -[%CFEngine_function_attributes(pattern, list)%] +{{< CFEngine_function_attributes(pattern, list) >}} **Example:** -[%CFEngine_include_snippet(maplist.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(maplist.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(maplist.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(maplist.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in 3.3.0, Nova 2.2.0 (2011). The [collecting function][Functions#collecting functions] behavior was added in 3.9. The delayed evaluation behavior was introduced in 3.10. diff --git a/content/reference/functions/max.markdown b/content/reference/functions/max.markdown index 7e0bca981..2c44bfa3f 100644 --- a/content/reference/functions/max.markdown +++ b/content/reference/functions/max.markdown @@ -3,21 +3,21 @@ layout: default title: max --- -[%CFEngine_function_prototype(list, sortmode)%] +{{< CFEngine_function_prototype(list, sortmode) >}} **Description:** Return the maximum of the items in `list` according to `sortmode` (same sort modes as in `sort()`). [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list, sortmode)%] +{{< CFEngine_function_attributes(list, sortmode) >}} **Example:** -[%CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.6.0 (2014). `canonify` mode was introduced in 3.9.0. The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/mean.markdown b/content/reference/functions/mean.markdown index d2dfe7bbf..0901d1c94 100644 --- a/content/reference/functions/mean.markdown +++ b/content/reference/functions/mean.markdown @@ -3,21 +3,21 @@ layout: default title: mean --- -[%CFEngine_function_prototype(list)%] +{{< CFEngine_function_prototype(list) >}} **Description:** Return the mean of the numbers in `list`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list)%] +{{< CFEngine_function_attributes(list) >}} **Example:** -[%CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.6.0 (2014). The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/mergedata.markdown b/content/reference/functions/mergedata.markdown index ce95724fc..b99262d65 100644 --- a/content/reference/functions/mergedata.markdown +++ b/content/reference/functions/mergedata.markdown @@ -3,7 +3,7 @@ layout: default title: mergedata --- -[%CFEngine_function_prototype(one, two, etc)%] +{{< CFEngine_function_prototype(one, two, etc) >}} **Description:** Returns the merger of any named data containers or lists. Can also wrap and unwrap data containers. @@ -30,23 +30,23 @@ traditional list and array data types in CFEngine. - true and false are reserved bare values - In the event of key collision the *last* key merged wins -[%CFEngine_function_attributes()%] +{{< CFEngine_function_attributes() >}} **Example:** -[%CFEngine_include_snippet(mergedata.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(mergedata.cf, #\+begin_src cfengine3, .*end_src) >}} **Output:** -[%CFEngine_include_snippet(mergedata.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(mergedata.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Example:** -[%CFEngine_include_snippet(mergedata-last-key-wins.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(mergedata-last-key-wins.cf, #\+begin_src cfengine3, .*end_src) >}} **Output:** -[%CFEngine_include_snippet(mergedata-last-key-wins.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(mergedata-last-key-wins.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/min.markdown b/content/reference/functions/min.markdown index be8515304..153711736 100644 --- a/content/reference/functions/min.markdown +++ b/content/reference/functions/min.markdown @@ -3,21 +3,21 @@ layout: default title: min --- -[%CFEngine_function_prototype(list, sortmode)%] +{{< CFEngine_function_prototype(list, sortmode) >}} **Description:** Return the minimum of the items in `list` according to `sortmode` (same sort modes as in `sort()`). [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list, sortmode)%] +{{< CFEngine_function_attributes(list, sortmode) >}} **Example:** -[%CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.6.0 (2014). The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/network_connections.markdown b/content/reference/functions/network_connections.markdown index f8d51cb11..bb8777563 100644 --- a/content/reference/functions/network_connections.markdown +++ b/content/reference/functions/network_connections.markdown @@ -3,11 +3,11 @@ layout: default title: network_connections --- -[%CFEngine_function_prototype()%] +{{< CFEngine_function_prototype() >}} **Description:** Return the list of current network connections. -[%CFEngine_function_attributes()%] +{{< CFEngine_function_attributes() >}} The returned data container has four keys: diff --git a/content/reference/functions/none.markdown b/content/reference/functions/none.markdown index 99d8b4519..5d1f395bb 100644 --- a/content/reference/functions/none.markdown +++ b/content/reference/functions/none.markdown @@ -3,24 +3,24 @@ layout: default title: none --- -[%CFEngine_function_prototype(regex, list)%] +{{< CFEngine_function_prototype(regex, list) >}} **Description:** Returns whether no element in `list` matches the regular expression `regex`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(regex, list)%] +{{< CFEngine_function_attributes(regex, list) >}} The regular expression is [unanchored][unanchored]. **Example:** -[%CFEngine_include_snippet(none.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(none.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(none.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(none.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/not.markdown b/content/reference/functions/not.markdown index a545da267..619d80869 100644 --- a/content/reference/functions/not.markdown +++ b/content/reference/functions/not.markdown @@ -3,12 +3,12 @@ layout: default title: not --- -[%CFEngine_function_prototype(expression)%] +{{< CFEngine_function_prototype(expression) >}} **Description:** Returns `any` if all arguments evaluate to false and `!any` if any argument evaluates to true. -[%CFEngine_function_attributes(expression)%] +{{< CFEngine_function_attributes(expression) >}} **Argument Descriptions:** diff --git a/content/reference/functions/now.markdown b/content/reference/functions/now.markdown index c423f6d4e..2b9beae15 100644 --- a/content/reference/functions/now.markdown +++ b/content/reference/functions/now.markdown @@ -3,7 +3,7 @@ layout: default title: now --- -[%CFEngine_function_prototype()%] +{{< CFEngine_function_prototype() >}} **Description:** Return the time at which this agent run started in system representation. @@ -75,7 +75,7 @@ body file_select pdf_modified_within_last_year `processes` type promises using ```process_select``` can use this function to select processes based on relative execution time. -[%CFEngine_include_example(processes_define_class_based_on_process_runtime.cf)%] +{{< CFEngine_include_example(processes_define_class_based_on_process_runtime.cf) >}} **See also:** diff --git a/content/reference/functions/nth.markdown b/content/reference/functions/nth.markdown index fddcefec5..b3dbd0b48 100644 --- a/content/reference/functions/nth.markdown +++ b/content/reference/functions/nth.markdown @@ -3,7 +3,7 @@ layout: default title: nth --- -[%CFEngine_function_prototype(list_or_container, position_or_key)%] +{{< CFEngine_function_prototype(list_or_container, position_or_key) >}} **Description:** Returns the element of `list_or_container` at zero-based `position_or_key`. @@ -23,15 +23,15 @@ Since 3.15, Nth supports negative indices when indexing lists, starting from the other end of the list. With a `position_or_key` of `-1`, you will get `4` from the list `[1,2,3,4]`. -[%CFEngine_function_attributes(list_or_container, position_or_key)%] +{{< CFEngine_function_attributes(list_or_container, position_or_key) >}} **Example:** -[%CFEngine_include_snippet(nth.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(nth.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(nth.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(nth.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/on.markdown b/content/reference/functions/on.markdown index d7515d914..da07ea6a1 100644 --- a/content/reference/functions/on.markdown +++ b/content/reference/functions/on.markdown @@ -3,13 +3,13 @@ layout: default title: on --- -[%CFEngine_function_prototype(year, month, day, hour, minute, second)%] +{{< CFEngine_function_prototype(year, month, day, hour, minute, second) >}} **Description:** Returns the specified date/time in integer system representation. The specified date/time is an absolute date in the local timezone. -[%CFEngine_function_attributes(year, month, day, hour, minute, second)%] +{{< CFEngine_function_attributes(year, month, day, hour, minute, second) >}} **Example:** diff --git a/content/reference/functions/or.markdown b/content/reference/functions/or.markdown index 6d4d08deb..36356f0cb 100644 --- a/content/reference/functions/or.markdown +++ b/content/reference/functions/or.markdown @@ -3,7 +3,7 @@ layout: default title: or --- -[%CFEngine_function_prototype(...)%] +{{< CFEngine_function_prototype(...) >}} **Description:** Returns `any` if any argument evaluates to true and `!any` if any argument evaluates to false. diff --git a/content/reference/functions/packagesmatching.markdown b/content/reference/functions/packagesmatching.markdown index 290794bbc..2d5dc9753 100644 --- a/content/reference/functions/packagesmatching.markdown +++ b/content/reference/functions/packagesmatching.markdown @@ -3,7 +3,7 @@ layout: default title: packagesmatching --- -[%CFEngine_function_prototype(package_regex, version_regex, arch_regex, method_regex)%] +{{< CFEngine_function_prototype(package_regex, version_regex, arch_regex, method_regex) >}} **Description:** Return a data container with the list of installed packages matching the parameters. @@ -25,7 +25,7 @@ this: ] ``` -[%CFEngine_function_attributes(package_regex, version_regex, arch_regex, method_regex)%] +{{< CFEngine_function_attributes(package_regex, version_regex, arch_regex, method_regex) >}} **IMPORTANT:** The data source used when querying depends on policy configuration. When `package_inventory` in `body common control` is configured, CFEngine will record the packages installed and the package updates available for the configured package modules. @@ -41,7 +41,7 @@ At no time will both the standard and the legacy data be available to these func The following code extracts just the package names, then looks for some desired packages, and finally reports if they are installed. -[%CFEngine_include_example(packagesmatching.cf)%] +{{< CFEngine_include_example(packagesmatching.cf) >}} **Refresh rules:** diff --git a/content/reference/functions/packageupdatesmatching.markdown b/content/reference/functions/packageupdatesmatching.markdown index e656df5ea..8be6e6d60 100644 --- a/content/reference/functions/packageupdatesmatching.markdown +++ b/content/reference/functions/packageupdatesmatching.markdown @@ -3,7 +3,7 @@ layout: default title: packageupdatesmatching --- -[%CFEngine_function_prototype(package_regex, version_regex, arch_regex, method_regex)%] +{{< CFEngine_function_prototype(package_regex, version_regex, arch_regex, method_regex) >}} **Description:** Return a data container with the list of available packages matching the parameters. @@ -25,7 +25,7 @@ this: ] ``` -[%CFEngine_function_attributes(package_regex, version_regex, arch_regex, method_regex)%] +{{< CFEngine_function_attributes(package_regex, version_regex, arch_regex, method_regex) >}} **IMPORTANT:** The data source used when querying depends on policy configuration. When `package_inventory` in `body common control` is configured, CFEngine will record the packages installed and the package updates available for the configured package modules. diff --git a/content/reference/functions/parseintarray.markdown b/content/reference/functions/parseintarray.markdown index ad5d01fa7..c55b3ef96 100644 --- a/content/reference/functions/parseintarray.markdown +++ b/content/reference/functions/parseintarray.markdown @@ -30,11 +30,11 @@ split into fields. Using the empty string (`""`) indicates no comments. **Example:** -[%CFEngine_include_snippet(parseintarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(parseintarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(parseintarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(parseintarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.1.5a1, Nova 2.1.0 (2011** diff --git a/content/reference/functions/parsejson.markdown b/content/reference/functions/parsejson.markdown index 6b06497e0..612f72857 100644 --- a/content/reference/functions/parsejson.markdown +++ b/content/reference/functions/parsejson.markdown @@ -3,12 +3,12 @@ layout: default title: parsejson --- -[%CFEngine_function_prototype(json_data)%] +{{< CFEngine_function_prototype(json_data) >}} **Description:** Parses JSON data directly from an inlined string and returns the result as a `data` variable -[%CFEngine_function_attributes(json_data)%] +{{< CFEngine_function_attributes(json_data) >}} Please note that because JSON uses double quotes, it's usually most convenient to use single quotes for the string (CFEngine allows both diff --git a/content/reference/functions/parserealarray.markdown b/content/reference/functions/parserealarray.markdown index 0fcefbdb1..f576b4567 100644 --- a/content/reference/functions/parserealarray.markdown +++ b/content/reference/functions/parserealarray.markdown @@ -31,11 +31,11 @@ split into fields. Using the empty string (`""`) indicates no comments. **Example:** -[%CFEngine_include_snippet(parserealarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(parserealarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(parserealarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(parserealarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.1.5a1, Nova 2.1.0 (2011) diff --git a/content/reference/functions/parsestringarray.markdown b/content/reference/functions/parsestringarray.markdown index 34b69464e..564e9730c 100644 --- a/content/reference/functions/parsestringarray.markdown +++ b/content/reference/functions/parsestringarray.markdown @@ -31,11 +31,11 @@ split into fields. Using the empty string (`""`) indicates no comments. **Example:** -[%CFEngine_include_snippet(parsestringarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(parsestringarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(parsestringarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(parsestringarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.1.5a1, Nova 2.1.0 (2011) diff --git a/content/reference/functions/parsestringarrayidx.markdown b/content/reference/functions/parsestringarrayidx.markdown index 9e22f8140..8cc53acf7 100644 --- a/content/reference/functions/parsestringarrayidx.markdown +++ b/content/reference/functions/parsestringarrayidx.markdown @@ -3,7 +3,7 @@ layout: default title: parsestringarrayidx --- -[%CFEngine_function_prototype(array, input, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_prototype(array, input, comment, split, maxentries, maxbytes) >}} **Description:** Populates the two-dimensional array `array` with up to `maxentries` fields from the first `maxbytes` bytes of the string `input`. @@ -15,14 +15,14 @@ The `comment` field is a multiline regular expression and will strip out unwanted patterns from the file being read, leaving unstripped characters to be split into fields. Using the empty string (`""`) indicates no comments. -[%CFEngine_function_attributes(array, input, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_attributes(array, input, comment, split, maxentries, maxbytes) >}} **Example:** -[%CFEngine_include_snippet(parsestringarrayidx.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(parsestringarrayidx.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(parsestringarrayidx.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(parsestringarrayidx.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.1.5, Nova 2.1.0 (2011) diff --git a/content/reference/functions/parseyaml.markdown b/content/reference/functions/parseyaml.markdown index 577e014df..40b42e05d 100644 --- a/content/reference/functions/parseyaml.markdown +++ b/content/reference/functions/parseyaml.markdown @@ -3,12 +3,12 @@ layout: default title: parseyaml --- -[%CFEngine_function_prototype(yaml_data)%] +{{< CFEngine_function_prototype(yaml_data) >}} **Description:** Parses YAML data directly from an inlined string and returns the result as a `data` variable -[%CFEngine_function_attributes(yaml_data)%] +{{< CFEngine_function_attributes(yaml_data) >}} Please note that it's usually most convenient to use single quotes for the string (CFEngine allows both types of quotes around a string). diff --git a/content/reference/functions/peerleader.markdown b/content/reference/functions/peerleader.markdown index a227a5184..c14f7bc79 100644 --- a/content/reference/functions/peerleader.markdown +++ b/content/reference/functions/peerleader.markdown @@ -3,7 +3,7 @@ layout: default title: peerleader --- -[%CFEngine_function_prototype(filename, regex, groupsize)%] +{{< CFEngine_function_prototype(filename, regex, groupsize) >}} **Description:** Returns the current host's partition peer leader. @@ -36,7 +36,7 @@ fails otherwise. If the current host name (fully qualified or unqualified) is the peer leader, the string `localhost` is used instead of the host name. -[%CFEngine_function_attributes(filename, regex, groupsize)%] +{{< CFEngine_function_attributes(filename, regex, groupsize) >}} `groupsize` must be between 2 and 64 to avoid nonsensical promises. @@ -44,12 +44,12 @@ leader, the string `localhost` is used instead of the host name. Prepare: -[%CFEngine_include_snippet(peerleader.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(peerleader.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(peerleader.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(peerleader.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(peerleader.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(peerleader.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/peerleaders.markdown b/content/reference/functions/peerleaders.markdown index 754701a4b..476775629 100644 --- a/content/reference/functions/peerleaders.markdown +++ b/content/reference/functions/peerleaders.markdown @@ -3,7 +3,7 @@ layout: default title: peerleaders --- -[%CFEngine_function_prototype(filename, regex, groupsize)%] +{{< CFEngine_function_prototype(filename, regex, groupsize) >}} **Description:** Returns a list of partition peer leaders from a file of host names. @@ -33,7 +33,7 @@ The `comment` field is a multiline regular expression and will strip out unwanted patterns from the file being read, leaving unstripped characters to be split into fields. Using the empty string (`""`) indicates no comments. -[%CFEngine_function_attributes(filename, regex, groupsize)%] +{{< CFEngine_function_attributes(filename, regex, groupsize) >}} `groupsize` must be between 2 and 64 to avoid nonsensical promises. @@ -41,12 +41,12 @@ split into fields. Using the empty string (`""`) indicates no comments. Prepare: -[%CFEngine_include_snippet(peerleaders.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(peerleaders.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(peerleaders.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(peerleaders.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(peerleaders.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(peerleaders.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/peers.markdown b/content/reference/functions/peers.markdown index 25ad20edf..dff248158 100644 --- a/content/reference/functions/peers.markdown +++ b/content/reference/functions/peers.markdown @@ -3,7 +3,7 @@ layout: default title: peers --- -[%CFEngine_function_prototype(filename, regex, groupsize)%] +{{< CFEngine_function_prototype(filename, regex, groupsize) >}} **Description:** Returns the current host's partition peers (excluding it). @@ -33,7 +33,7 @@ The current host (unqualified or fully qualified) should belong to this file if it is expected to interact with the others. The function returns an empty list otherwise. -[%CFEngine_function_attributes(filename, regex, groupsize)%] +{{< CFEngine_function_attributes(filename, regex, groupsize) >}} `groupsize` must be between 2 and 64 to avoid nonsensical promises. @@ -41,12 +41,12 @@ returns an empty list otherwise. Prepare: -[%CFEngine_include_snippet(peers.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(peers.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(peers.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(peers.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(peers.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(peers.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/processexists.markdown b/content/reference/functions/processexists.markdown index 54e9c4995..4433c6bc4 100644 --- a/content/reference/functions/processexists.markdown +++ b/content/reference/functions/processexists.markdown @@ -3,7 +3,7 @@ layout: default title: processexists --- -[%CFEngine_function_prototype(regex)%] +{{< CFEngine_function_prototype(regex) >}} **Description:** Return whether a process matches the given [anchored][anchored] regular expression `regex`. @@ -13,7 +13,7 @@ table. Use `.*sherlock.*` to find all the processes that match `sherlock`. Use `.*\bsherlock\b.*` to exclude partial matches like `sherlock123` (`\b` matches a word boundary). -[%CFEngine_function_attributes(regex)%] +{{< CFEngine_function_attributes(regex) >}} The process table is usually obtained with something like `ps -eo user,pid,ppid,pgid,%cpu,%mem,vsize,ni,rss,stat,nlwp,stime,time,args`, and the diff --git a/content/reference/functions/product.markdown b/content/reference/functions/product.markdown index 716b822ff..68db0ed1f 100644 --- a/content/reference/functions/product.markdown +++ b/content/reference/functions/product.markdown @@ -3,7 +3,7 @@ layout: default title: product --- -[%CFEngine_function_prototype(list)%] +{{< CFEngine_function_prototype(list) >}} **Description:** Returns the product of the reals in `list`. @@ -13,15 +13,15 @@ collect summary information from a source external to CFEngine. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list)%] +{{< CFEngine_function_attributes(list) >}} **Example:** -[%CFEngine_include_snippet(product.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(product.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(product.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(product.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.1.0b1,Nova 2.0.0b1 (2010). The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/randomint.markdown b/content/reference/functions/randomint.markdown index 0029c7635..75e4e41c2 100644 --- a/content/reference/functions/randomint.markdown +++ b/content/reference/functions/randomint.markdown @@ -3,7 +3,7 @@ layout: default title: randomint --- -[%CFEngine_function_prototype(lower, upper)%] +{{< CFEngine_function_prototype(lower, upper) >}} **Description:** Returns a random integer between `lower` and *up to but not including* `upper`. @@ -18,12 +18,12 @@ context class expression as shown in the example. **NOTE:** The randomness produced by randomint is not safe for cryptographic usage. -[%CFEngine_function_attributes(lower, upper)%] +{{< CFEngine_function_attributes(lower, upper) >}} **Example:** -[%CFEngine_include_snippet(randomint.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(randomint.cf, #\+begin_src cfengine3, .*end_src) >}} Output: (when `show_random` is defined) -[%CFEngine_include_snippet(randomint.cf, #\+begin_src\s+show_random_example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(randomint.cf, #\+begin_src\s+show_random_example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/read_module_protocol.markdown b/content/reference/functions/read_module_protocol.markdown index c0f9ea997..cee846f80 100644 --- a/content/reference/functions/read_module_protocol.markdown +++ b/content/reference/functions/read_module_protocol.markdown @@ -3,17 +3,17 @@ layout: default title: read_module_protocol --- -[%CFEngine_function_prototype(file_path)%] +{{< CFEngine_function_prototype(file_path) >}} **Description:** Interprets `file_path` as module protocol output. This function is useful for reducing overhead by caching and then reading module protocol results from a file. -[%CFEngine_function_attributes(file_path)%] +{{< CFEngine_function_attributes(file_path) >}} **Example:** -[%CFEngine_include_example(read_module_protocol.cf)%] +{{< CFEngine_include_example(read_module_protocol.cf) >}} **See also:** [usemodule()][usemodule], [Module Protocol][commands#module] diff --git a/content/reference/functions/readcsv.markdown b/content/reference/functions/readcsv.markdown index 97b9c0234..7d24a963b 100644 --- a/content/reference/functions/readcsv.markdown +++ b/content/reference/functions/readcsv.markdown @@ -3,7 +3,7 @@ layout: default title: readcsv --- -[%CFEngine_function_prototype(filename, optional_maxbytes)%] +{{< CFEngine_function_prototype(filename, optional_maxbytes) >}} **Description:** Parses CSV data from the file `filename` and returns the result as a `data` variable. @@ -19,21 +19,21 @@ The returned data is in the same format as `data_readstringarrayidx()`, that is, a data container that holds a JSON array of JSON arrays. -[%CFEngine_function_attributes(filename, optional_maxbytes)%] +{{< CFEngine_function_attributes(filename, optional_maxbytes) >}} **Example:** Prepare: -[%CFEngine_include_snippet(readcsv.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readcsv.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readcsv.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readcsv.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readcsv.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readcsv.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Note:** CSV files formatted according to RFC 4180 must end with the `CRLF` sequence. Thus a text file created on Unix with standard Unix tools diff --git a/content/reference/functions/readdata.markdown b/content/reference/functions/readdata.markdown index 6280f87c3..056fed7b7 100644 --- a/content/reference/functions/readdata.markdown +++ b/content/reference/functions/readdata.markdown @@ -3,7 +3,7 @@ layout: default title: readdata --- -[%CFEngine_function_prototype(filename, filetype)%] +{{< CFEngine_function_prototype(filename, filetype) >}} **Description:** Parses CSV, JSON, or YAML data from file `filename` and returns the result as a `data` variable. @@ -17,21 +17,21 @@ this function behaves like `readcsv()`, `readjson()`, `readyaml()` or `readenvfi These functions have an optional parameter `maxbytes` (default: `inf`). `maxbytes` can not be set using `readdata()`, if needed use one of the mentioned functions instead. -[%CFEngine_function_attributes(filename, filetype)%] +{{< CFEngine_function_attributes(filename, filetype) >}} **Example:** Prepare: -[%CFEngine_include_snippet(readdata.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readdata.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readdata.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readdata.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readdata.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readdata.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`data_expand()`][data_expand], `readcsv()`, `readyaml()`, `readjson()`, `readenvfile()`, `validdata()`, `data` documentation. diff --git a/content/reference/functions/readenvfile.markdown b/content/reference/functions/readenvfile.markdown index c2e4980bd..3dc10b55a 100644 --- a/content/reference/functions/readenvfile.markdown +++ b/content/reference/functions/readenvfile.markdown @@ -3,7 +3,7 @@ layout: default title: readenvfile --- -[%CFEngine_function_prototype(filename, optional_maxbytes)%] +{{< CFEngine_function_prototype(filename, optional_maxbytes) >}} **Description:** Parses key-value pairs from the file `filename` in env file format (`man os-release`). @@ -12,7 +12,7 @@ Keys and values are interpreted as strings. `maxbytes` is optional, if specified, only the first `maxbytes` bytes are read from `filename`. [Details of the os-release/env file format on freedesktop.org](https://www.freedesktop.org/software/systemd/man/os-release.html) -[%CFEngine_function_attributes(filename, otpional_maxbytes)%] +{{< CFEngine_function_attributes(filename, otpional_maxbytes) >}} **Syntax example:** @@ -26,15 +26,15 @@ vars: Prepare: -[%CFEngine_include_snippet(readenvfile.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readenvfile.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readenvfile.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readenvfile.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readenvfile.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readenvfile.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** This function is used internally to load `/etc/os-release` into `sys.os_release`. diff --git a/content/reference/functions/readfile.markdown b/content/reference/functions/readfile.markdown index f1bc71453..9f5817c73 100644 --- a/content/reference/functions/readfile.markdown +++ b/content/reference/functions/readfile.markdown @@ -3,28 +3,28 @@ layout: default title: readfile --- -[%CFEngine_function_prototype(filename, optional_maxbytes)%] +{{< CFEngine_function_prototype(filename, optional_maxbytes) >}} **Description:** Returns the first `maxbytes` bytes from file `filename`. `maxbytes` is optional, if specified, only the first `maxbytes` bytes are read from `filename`. When `maxbytes` is `0`, `inf` or not specified, the whole file will be read (but see **Notes** below). -[%CFEngine_function_attributes(filename, optional_maxbytes)%] +{{< CFEngine_function_attributes(filename, optional_maxbytes) >}} **Example:** Prepare: -[%CFEngine_include_snippet(readfile.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readfile.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readfile.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readfile.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readfile.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readfile.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/functions/readintarray.markdown b/content/reference/functions/readintarray.markdown index 82196c45c..4113a640e 100644 --- a/content/reference/functions/readintarray.markdown +++ b/content/reference/functions/readintarray.markdown @@ -36,14 +36,14 @@ lines matched. Prepare: -[%CFEngine_include_snippet(readintarray.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readintarray.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readintarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readintarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readintarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readintarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`readstringarray()`][readstringarray], [`readrealarray()`][readrealarray], [`parseintarray()`][parseintarray], [`parserealarray()`][parserealarray], [`parsestringarray()`][parsestringarray] diff --git a/content/reference/functions/readintlist.markdown b/content/reference/functions/readintlist.markdown index a719c5d70..a3b44b5da 100644 --- a/content/reference/functions/readintlist.markdown +++ b/content/reference/functions/readintlist.markdown @@ -3,7 +3,7 @@ layout: default title: readintlist --- -[%CFEngine_function_prototype(filename, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_prototype(filename, comment, split, maxentries, maxbytes) >}} **Description:** Splits the file `filename` into separated values and returns the list. @@ -12,20 +12,20 @@ The `comment` field is a multiline regular expression and will strip out unwanted patterns from the file being read, leaving unstripped characters to be split into fields. Using the empty string (`""`) indicates no comments. -[%CFEngine_function_attributes(filename, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_attributes(filename, comment, split, maxentries, maxbytes) >}} **Example:** Prepare: -[%CFEngine_include_snippet(readintlist.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readintlist.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readintlist.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readintlist.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readintlist.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readintlist.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`readstringlist()`][readstringlist], [`readreallist()`][readreallist] diff --git a/content/reference/functions/readjson.markdown b/content/reference/functions/readjson.markdown index c34aab76a..4650b9dfe 100644 --- a/content/reference/functions/readjson.markdown +++ b/content/reference/functions/readjson.markdown @@ -3,13 +3,13 @@ layout: default title: readjson --- -[%CFEngine_function_prototype(filename, optional_maxbytes)%] +{{< CFEngine_function_prototype(filename, optional_maxbytes) >}} **Description:** Parses JSON data from the file `filename` and returns the result as a `data` variable. `maxbytes` is optional, if specified, only the first `maxbytes` bytes are read from `filename`. -[%CFEngine_function_attributes(filename, optional_maxbytes)%] +{{< CFEngine_function_attributes(filename, optional_maxbytes) >}} **Example:** diff --git a/content/reference/functions/readrealarray.markdown b/content/reference/functions/readrealarray.markdown index 47e4fbfc2..851eb8d82 100644 --- a/content/reference/functions/readrealarray.markdown +++ b/content/reference/functions/readrealarray.markdown @@ -112,14 +112,14 @@ array_name[games][6] /bin/bash ``` Prepare: -[%CFEngine_include_snippet(readrealarray.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readrealarray.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readrealarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readrealarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readrealarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readrealarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`readstringarray()`][readstringarray], [`readintarray()`][readintarray], [`parserealarray()`][parserealarray], [`parserealarray()`][parserealarray], [`parsestringarray()`][parsestringarray] diff --git a/content/reference/functions/readreallist.markdown b/content/reference/functions/readreallist.markdown index 694b149ea..213861efb 100644 --- a/content/reference/functions/readreallist.markdown +++ b/content/reference/functions/readreallist.markdown @@ -27,14 +27,14 @@ split into fields. Using the empty string (`""`) indicates no comments. Prepare: -[%CFEngine_include_snippet(readreallist.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readreallist.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readreallist.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readreallist.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readreallist.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readreallist.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`readstringlist()`][readstringlist], [`readintlist()`][readintlist] diff --git a/content/reference/functions/readstringarray.markdown b/content/reference/functions/readstringarray.markdown index 457eaa1f0..c85ee6ffe 100644 --- a/content/reference/functions/readstringarray.markdown +++ b/content/reference/functions/readstringarray.markdown @@ -112,14 +112,14 @@ array_name[games][6] /bin/bash ``` Prepare: -[%CFEngine_include_snippet(readrealarray.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readrealarray.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readrealarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readrealarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readrealarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readrealarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`readrealarray()`][readrealarray], [`readintarray()`][readintarray], [`parserealarray()`][parserealarray], [`parserealarray()`][parserealarray], [`parsestringarray()`][parsestringarray] diff --git a/content/reference/functions/readstringarrayidx.markdown b/content/reference/functions/readstringarrayidx.markdown index 48e829823..cbf2b3a2f 100644 --- a/content/reference/functions/readstringarrayidx.markdown +++ b/content/reference/functions/readstringarrayidx.markdown @@ -3,7 +3,7 @@ layout: default title: readstringarrayidx --- -[%CFEngine_function_prototype(array, filename, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_prototype(array, filename, comment, split, maxentries, maxbytes) >}} **Description:** Populates the two-dimensional array `array` with up to `maxentries` fields from the first `maxbytes` bytes of file `filename`. @@ -22,7 +22,7 @@ matched). If you only want the fields in the first matching line (e.g., to mimic the behavior of the *getpwnam(3)* on the file `/etc/passwd`), use `getfields()`, instead. -[%CFEngine_function_attributes(array, filename, comment, split, maxentries, maxbytes)%] +{{< CFEngine_function_attributes(array, filename, comment, split, maxentries, maxbytes) >}} **Example:** diff --git a/content/reference/functions/readstringlist.markdown b/content/reference/functions/readstringlist.markdown index 4380da8b1..bd6634d9f 100644 --- a/content/reference/functions/readstringlist.markdown +++ b/content/reference/functions/readstringlist.markdown @@ -27,14 +27,14 @@ split into fields. Using the empty string (`""`) indicates no comments. Prepare: -[%CFEngine_include_snippet(readstringlist.cf, #\+begin_src prep, .*end_src)%] +{{< CFEngine_include_snippet(readstringlist.cf, #\+begin_src prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(readstringlist.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readstringlist.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(readstringlist.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(readstringlist.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [`readintlist()`][readintlist], [`readreallist()`][readreallist] diff --git a/content/reference/functions/readtcp.markdown b/content/reference/functions/readtcp.markdown index 29c40cd79..c55e0b0ef 100644 --- a/content/reference/functions/readtcp.markdown +++ b/content/reference/functions/readtcp.markdown @@ -3,7 +3,7 @@ layout: default title: readtcp --- -[%CFEngine_function_prototype(hostnameip, port, sendstring, maxbytes)%] +{{< CFEngine_function_prototype(hostnameip, port, sendstring, maxbytes) >}} **Description:** Connects to tcp ```port``` of `hostnameip`, sends `sendstring`, reads at most `maxbytes` from the response and returns those. @@ -16,11 +16,11 @@ Not all Unix TCP read operations respond to signals for interruption, so poorly formed requests can block the `cf-agent` process. Always test TCP connections fully before deploying. -[%CFEngine_function_attributes(host, port, sendstring, maxbytes)%] +{{< CFEngine_function_attributes(host, port, sendstring, maxbytes) >}} **Example:** -[%CFEngine_include_snippet(readtcp.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(readtcp.cf, #\+begin_src cfengine3, .*end_src) >}} Output: diff --git a/content/reference/functions/readyaml.markdown b/content/reference/functions/readyaml.markdown index 58d4bb6b9..59a0b4c7e 100644 --- a/content/reference/functions/readyaml.markdown +++ b/content/reference/functions/readyaml.markdown @@ -3,13 +3,13 @@ layout: default title: readyaml --- -[%CFEngine_function_prototype(filename, optional_maxbytes)%] +{{< CFEngine_function_prototype(filename, optional_maxbytes) >}} **Description:** Parses YAML data from the file `filename` and returns the result as a `data` variable. `maxbytes` is optional, if specified, only the first `maxbytes` bytes are read from `filename`. -[%CFEngine_function_attributes(filename, optional_maxbytes)%] +{{< CFEngine_function_attributes(filename, optional_maxbytes) >}} **Example:** diff --git a/content/reference/functions/regarray.markdown b/content/reference/functions/regarray.markdown index 15cb36b46..7fbad0e38 100644 --- a/content/reference/functions/regarray.markdown +++ b/content/reference/functions/regarray.markdown @@ -3,17 +3,17 @@ layout: default title: regarray --- -[%CFEngine_function_prototype(array, regex)%] +{{< CFEngine_function_prototype(array, regex) >}} **Description:** Returns whether `array` contains elements matching the [anchored][anchored]regular expression `regex`. -[%CFEngine_function_attributes(array, regex)%] +{{< CFEngine_function_attributes(array, regex) >}} **Example:** -[%CFEngine_include_snippet(regarray.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(regarray.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(regarray.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(regarray.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/regcmp.markdown b/content/reference/functions/regcmp.markdown index 0cacae98f..6d892b0d1 100644 --- a/content/reference/functions/regcmp.markdown +++ b/content/reference/functions/regcmp.markdown @@ -3,20 +3,20 @@ layout: default title: regcmp --- -[%CFEngine_function_prototype(regex, string)%] +{{< CFEngine_function_prototype(regex, string) >}} **Description:** Returns whether the [anchored][anchored] regular expression `regex` matches the `string.` -[%CFEngine_function_attributes(regex, string)%] +{{< CFEngine_function_attributes(regex, string) >}} **Example:** -[%CFEngine_include_snippet(regcmp.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(regcmp.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(regcmp.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(regcmp.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} If the string contains multiple lines, then it is necessary to code these explicitly, as regular expressions do not normally match the end of line diff --git a/content/reference/functions/regex_replace.markdown b/content/reference/functions/regex_replace.markdown index 8062eb34c..db6d2db12 100644 --- a/content/reference/functions/regex_replace.markdown +++ b/content/reference/functions/regex_replace.markdown @@ -3,11 +3,11 @@ layout: default title: regex_replace --- -[%CFEngine_function_prototype(string, regex, replacement, options)%] +{{< CFEngine_function_prototype(string, regex, replacement, options) >}} **Description:** In a given string, replaces a regular expression with something else. -[%CFEngine_function_attributes(string, regex, replacement, options)%] +{{< CFEngine_function_attributes(string, regex, replacement, options) >}} The supported options are single letters you place in the `options` string in any order. Consult http://pcre.org/pcre.txt for the exact @@ -33,11 +33,11 @@ regex match. `$&` holds the entire regex match. **Example:** -[%CFEngine_include_snippet(regex_replace.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(regex_replace.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(regex_replace.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(regex_replace.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in version 3.8.0 (2015) diff --git a/content/reference/functions/regextract.markdown b/content/reference/functions/regextract.markdown index f177a573b..9d1d2ce96 100644 --- a/content/reference/functions/regextract.markdown +++ b/content/reference/functions/regextract.markdown @@ -3,7 +3,7 @@ layout: default title: regextract --- -[%CFEngine_function_prototype(regex, string, backref)%] +{{< CFEngine_function_prototype(regex, string, backref) >}} **Description:** Returns whether the [anchored][anchored] `regex` matches the `string`, and fills the array `backref` with back-references. @@ -19,14 +19,14 @@ $(backref[0]) = entire string $(backref[1]) = back reference 1, etc ``` -[%CFEngine_function_attributes(regex, string, backref)%] +{{< CFEngine_function_attributes(regex, string, backref) >}} **Example:** -[%CFEngine_include_snippet(regextract.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(regextract.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(regextract.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(regextract.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `data_regextract()` `regex_replace()` diff --git a/content/reference/functions/registryvalue.markdown b/content/reference/functions/registryvalue.markdown index a0e8657c6..59235c25b 100644 --- a/content/reference/functions/registryvalue.markdown +++ b/content/reference/functions/registryvalue.markdown @@ -3,7 +3,7 @@ layout: default title: registryvalue --- -[%CFEngine_function_prototype(key, valueid)%] +{{< CFEngine_function_prototype(key, valueid) >}} **Description:** Returns the value of `valueid` in the Windows registry key `key`. @@ -11,15 +11,15 @@ title: registryvalue This function applies only to Windows-based systems. The value is parsed as a string. -[%CFEngine_function_attributes(key, valueid)%] +{{< CFEngine_function_attributes(key, valueid) >}} **Example:** -[%CFEngine_include_snippet(registryvalue.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(registryvalue.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(registryvalue.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(registryvalue.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** Currently values of type `REG_SZ` (string), `REG_EXPAND_SZ` (expandable string) and `REG_DWORD` (double word) are supported. diff --git a/content/reference/functions/regldap.markdown b/content/reference/functions/regldap.markdown index af3eb7147..39e0d3c8a 100644 --- a/content/reference/functions/regldap.markdown +++ b/content/reference/functions/regldap.markdown @@ -5,7 +5,7 @@ title: regldap **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(uri, dn, filter, record, scope, regex, security)%] +{{< CFEngine_function_prototype(uri, dn, filter, record, scope, regex, security) >}} **Description:** Returns whether the regular expression `regex` matches a value item in the LDAP search. @@ -14,7 +14,7 @@ This function retrieves a single field from all matching LDAP records identified by the search parameters and compares it to the regular expression `regex`. -[%CFEngine_function_attributes(uri, dn, filter, record, scope, regex, security)%] +{{< CFEngine_function_attributes(uri, dn, filter, record, scope, regex, security) >}} `dn` specifies the distinguished name, an ldap formatted name built from components, e.g. "dc=cfengine,dc=com". `filter` is an ldap search, e.g. diff --git a/content/reference/functions/regline.markdown b/content/reference/functions/regline.markdown index 586f4c0c1..ee8b13076 100644 --- a/content/reference/functions/regline.markdown +++ b/content/reference/functions/regline.markdown @@ -3,7 +3,7 @@ layout: default title: regline --- -[%CFEngine_function_prototype(regex, filename)%] +{{< CFEngine_function_prototype(regex, filename) >}} **Description:** Returns whether the [anchored][anchored] regular expression `regex` matches a line in file `filename`. @@ -11,15 +11,15 @@ title: regline Note that `regex` must match an entire line of the file in order to give a true result. -[%CFEngine_function_attributes(regex, filename)%] +{{< CFEngine_function_attributes(regex, filename) >}} **Examples:** This example shows a way to determine if IPV4 forwarding is enabled or not. -[%CFEngine_include_snippet(regline.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(regline.cf, #\+begin_src cfengine3, .*end_src) >}} -[%CFEngine_include_snippet(regline.cf, #\+begin_src\s+random_example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(regline.cf, #\+begin_src\s+random_example_output\s*, .*end_src) >}} For `edit_line` applications it may be useful to set a class for detecting the presence of a string that does not exactly match one being inserted. For diff --git a/content/reference/functions/reglist.markdown b/content/reference/functions/reglist.markdown index 3ec15bb65..9e00c42cb 100644 --- a/content/reference/functions/reglist.markdown +++ b/content/reference/functions/reglist.markdown @@ -3,22 +3,22 @@ layout: default title: reglist --- -[%CFEngine_function_prototype(list, regex)%] +{{< CFEngine_function_prototype(list, regex) >}} **Description:** Returns whether the [anchored][anchored] regular expression `regex` matches any item in `list`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list, regex)%] +{{< CFEngine_function_attributes(list, regex) >}} **Example:** -[%CFEngine_include_snippet(reglist.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(reglist.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(reglist.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(reglist.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} In the example above, the IP address in `$(sys.ipv4[eth0])` must be `escape`d, so that the (.) characters in the IP address are not interpreted as the diff --git a/content/reference/functions/remoteclassesmatching.markdown b/content/reference/functions/remoteclassesmatching.markdown index da4ba470d..acea7313e 100644 --- a/content/reference/functions/remoteclassesmatching.markdown +++ b/content/reference/functions/remoteclassesmatching.markdown @@ -5,7 +5,7 @@ title: remoteclassesmatching **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(regex, server, encrypt, prefix)%] +{{< CFEngine_function_prototype(regex, server, encrypt, prefix) >}} **Description:** Reads persistent classes matching regular expression `regex` from a remote CFEngine server `server` and adds them into local context with @@ -18,7 +18,7 @@ This function contacts a remote `cf-serverd` and requests access to defined *persistent classes* on that system. Access must be granted by making an `access` promise with `resource_type` set to `context`. -[%CFEngine_function_attributes(regex, server, encrypt, prefix)%] +{{< CFEngine_function_attributes(regex, server, encrypt, prefix) >}} **Example:** diff --git a/content/reference/functions/remotescalar.markdown b/content/reference/functions/remotescalar.markdown index c04da7523..02db0e987 100644 --- a/content/reference/functions/remotescalar.markdown +++ b/content/reference/functions/remotescalar.markdown @@ -5,7 +5,7 @@ title: remotescalar **This function is only available in CFEngine Enterprise.** -[%CFEngine_function_prototype(id, server, encrypt)%] +{{< CFEngine_function_prototype(id, server, encrypt) >}} **Description:** Returns a scalar value identified by `id` from a remote CFEngine `server`. Communication is encrytped depending on ```encrypt```. @@ -26,7 +26,7 @@ needed to resolve the absence of a value can lead to undesirable behavior. As a general rule, users are recommended to refrain from relying on the availability of network resources. -[%CFEngine_function_attributes(id, server, encrypt)%] +{{< CFEngine_function_attributes(id, server, encrypt) >}} **Example:** diff --git a/content/reference/functions/returnszero.markdown b/content/reference/functions/returnszero.markdown index 56b82049a..9a9cdf88f 100644 --- a/content/reference/functions/returnszero.markdown +++ b/content/reference/functions/returnszero.markdown @@ -3,7 +3,7 @@ layout: default title: returnszero --- -[%CFEngine_function_prototype(command, shell)%] +{{< CFEngine_function_prototype(command, shell) >}} **Description:** Runs `command` and returns whether it has returned with exit status zero. @@ -11,15 +11,15 @@ status zero. This is the complement of `execresult()`, but it returns a class result rather than the output of the command. -[%CFEngine_function_attributes(command, shell)%] +{{< CFEngine_function_attributes(command, shell) >}} **Example:** -[%CFEngine_include_snippet(returnszero.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(returnszero.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(returnszero.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(returnszero.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** you should never use this function to execute commands that make changes to the system, or perform lengthy computations. Such an diff --git a/content/reference/functions/reverse.markdown b/content/reference/functions/reverse.markdown index 1c789c926..a8705f73f 100644 --- a/content/reference/functions/reverse.markdown +++ b/content/reference/functions/reverse.markdown @@ -3,7 +3,7 @@ layout: default title: reverse --- -[%CFEngine_function_prototype(list)%] +{{< CFEngine_function_prototype(list) >}} **Description:** Reverses a list. @@ -18,11 +18,11 @@ This is a simple function to reverse a list. **Example:** -[%CFEngine_include_snippet(reverse.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(reverse.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(reverse.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(reverse.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/rrange.markdown b/content/reference/functions/rrange.markdown index 76ec6eae8..7d18158be 100644 --- a/content/reference/functions/rrange.markdown +++ b/content/reference/functions/rrange.markdown @@ -3,11 +3,11 @@ layout: default title: rrange --- -[%CFEngine_function_prototype(arg1, arg2)%] +{{< CFEngine_function_prototype(arg1, arg2) >}} **Description:** Define a range of real numbers for CFEngine internal use. -[%CFEngine_function_attributes(arg1, arg2)%] +{{< CFEngine_function_attributes(arg1, arg2) >}} **Notes:** This is not yet used. diff --git a/content/reference/functions/selectservers.markdown b/content/reference/functions/selectservers.markdown index e91292eb0..377459ee4 100644 --- a/content/reference/functions/selectservers.markdown +++ b/content/reference/functions/selectservers.markdown @@ -3,7 +3,7 @@ layout: default title: selectservers --- -[%CFEngine_function_prototype(hostlist, port, query, regex, maxbytes, array)%] +{{< CFEngine_function_prototype(hostlist, port, query, regex, maxbytes, array) >}} **Description:** Returns the number of tcp servers from `hostlist` which respond with a reply matching `regex` to a `query` send to ```port```, and @@ -17,7 +17,7 @@ This function allows discovery of all the TCP ports that are active and functioning from an ordered list, and builds an array of their names. This allows maintaining a list of pretested failover alternatives. -[%CFEngine_function_attributes(hostlist, port, query, regex, maxbyes, array)%] +{{< CFEngine_function_attributes(hostlist, port, query, regex, maxbyes, array) >}} **Example:** diff --git a/content/reference/functions/shuffle.markdown b/content/reference/functions/shuffle.markdown index f4796ae5c..076cb6a2f 100644 --- a/content/reference/functions/shuffle.markdown +++ b/content/reference/functions/shuffle.markdown @@ -3,7 +3,7 @@ layout: default title: shuffle --- -[%CFEngine_function_prototype(list, seed)%] +{{< CFEngine_function_prototype(list, seed) >}} **Description:** Return `list` shuffled with `seed`. @@ -12,15 +12,15 @@ title: shuffle The same seed will produce the same shuffle every time. For a random shuffle, provide a random seed with the `randomint` function. -[%CFEngine_function_attributes(list, seed)%] +{{< CFEngine_function_attributes(list, seed) >}} **Example:** -[%CFEngine_include_snippet(shuffle.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(shuffle.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(shuffle.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(shuffle.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/some.markdown b/content/reference/functions/some.markdown index 40140fbca..15e194e78 100644 --- a/content/reference/functions/some.markdown +++ b/content/reference/functions/some.markdown @@ -3,14 +3,14 @@ layout: default title: some --- -[%CFEngine_function_prototype(regex, list)%] +{{< CFEngine_function_prototype(regex, list) >}} **Description:** Return whether any element of `list` matches the [Unanchored][unanchored] regular expression `regex`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(regex, list)%] +{{< CFEngine_function_attributes(regex, list) >}} `some()` will return as soon as any element matches. @@ -21,11 +21,11 @@ possible, that is better than using `length()` or `every()` or **Example:** -[%CFEngine_include_snippet(some.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(some.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(some.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(some.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/sort.markdown b/content/reference/functions/sort.markdown index b5972467b..cfb0b5bc1 100644 --- a/content/reference/functions/sort.markdown +++ b/content/reference/functions/sort.markdown @@ -3,7 +3,7 @@ layout: default title: sort --- -[%CFEngine_function_prototype(list, mode)%] +{{< CFEngine_function_prototype(list, mode) >}} **Description:** Returns `list` sorted according to `mode`. @@ -16,11 +16,11 @@ action. `mode` is optional, and defaults to `lex`. Note IPv6 addresses can not use uppercase hexadecimal characters (`A-Z`) but must use lowercase (`a-z`) instead. -[%CFEngine_function_attributes(list, mode)%] +{{< CFEngine_function_attributes(list, mode) >}} **Example:** -[%CFEngine_include_snippet(sort.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(sort.cf, #\+begin_src cfengine3, .*end_src) >}} Output: diff --git a/content/reference/functions/splayclass.markdown b/content/reference/functions/splayclass.markdown index 715a0b4b8..f895df198 100644 --- a/content/reference/functions/splayclass.markdown +++ b/content/reference/functions/splayclass.markdown @@ -3,7 +3,7 @@ layout: default title: splayclass --- -[%CFEngine_function_prototype(input, policy)%] +{{< CFEngine_function_prototype(input, policy) >}} **Description:** Returns whether `input`'s time-slot has arrived, according to a ```policy```. @@ -17,7 +17,7 @@ This function may be used to distribute a task, typically on multiple hosts, in The function is similar to the `splaytime` feature in `cf-execd`, except that it allows you to base the decision on any string-criterion on a given host. -[%CFEngine_function_attributes(input, policy)%] +{{< CFEngine_function_attributes(input, policy) >}} The variation in `input` determines how effectively CFEngine will be able to distribute tasks. CFEngine instances with the same `input` will yield a true diff --git a/content/reference/functions/splitstring.markdown b/content/reference/functions/splitstring.markdown index 6d1f0a283..edbcd1c86 100644 --- a/content/reference/functions/splitstring.markdown +++ b/content/reference/functions/splitstring.markdown @@ -3,7 +3,7 @@ layout: default title: splitstring --- -[%CFEngine_function_prototype(string, regex, maxent)%] +{{< CFEngine_function_prototype(string, regex, maxent) >}} **Description:** Splits `string` into at most `maxent` substrings wherever `regex` occurs, and returns the list with those strings. @@ -13,15 +13,15 @@ The regular expression is [unanchored][unanchored]. If the maximum number of substrings is insufficient to accommodate all the entries, the rest of the un-split string is thrown away. -[%CFEngine_function_attributes(string, regex, maxent)%] +{{< CFEngine_function_attributes(string, regex, maxent) >}} **Example:** -[%CFEngine_include_snippet(splitstring.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(splitstring.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(splitstring.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(splitstring.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Deprecated in CFEngine 3.6 in favor of `string_split` diff --git a/content/reference/functions/storejson.markdown b/content/reference/functions/storejson.markdown index 10985ed74..e11f7029b 100644 --- a/content/reference/functions/storejson.markdown +++ b/content/reference/functions/storejson.markdown @@ -3,17 +3,17 @@ layout: default title: storejson --- -[%CFEngine_function_prototype(data_container)%] +{{< CFEngine_function_prototype(data_container) >}} **Description:** Converts a data container to a JSON string. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(data_container)%] +{{< CFEngine_function_attributes(data_container) >}} **Example:** -[%CFEngine_include_example(storejson.cf)%] +{{< CFEngine_include_example(storejson.cf) >}} **History:** diff --git a/content/reference/functions/strcmp.markdown b/content/reference/functions/strcmp.markdown index 285f4910d..2b663aa86 100644 --- a/content/reference/functions/strcmp.markdown +++ b/content/reference/functions/strcmp.markdown @@ -3,19 +3,19 @@ layout: default title: strcmp --- -[%CFEngine_function_prototype(string1, string2)%] +{{< CFEngine_function_prototype(string1, string2) >}} **Description:** Returns whether the two strings `string1` and `string2` match exactly. -[%CFEngine_function_attributes(string1, string2)%] +{{< CFEngine_function_attributes(string1, string2) >}} **Example:** -[%CFEngine_include_snippet(strcmp.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(strcmp.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(strcmp.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(strcmp.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `regcmp()`, `regline()` diff --git a/content/reference/functions/strftime.markdown b/content/reference/functions/strftime.markdown index f4cc7398c..6cd0d91a1 100644 --- a/content/reference/functions/strftime.markdown +++ b/content/reference/functions/strftime.markdown @@ -3,12 +3,12 @@ layout: default title: strftime --- -[%CFEngine_function_prototype(mode, template, time)%] +{{< CFEngine_function_prototype(mode, template, time) >}} **Description:** Interprets a time and date format string at a particular point in GMT or local time using Unix epoch time. -[%CFEngine_function_attributes(mode, template, time)%] +{{< CFEngine_function_attributes(mode, template, time) >}} The `mode` is either `gmtime` (to get GMT times and dates) or `localtime` (to get times and dates according to the local @@ -19,11 +19,11 @@ are specialized for printing components of the date and time according to the sy **Example:** -[%CFEngine_include_snippet(strftime.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(strftime.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(strftime.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(strftime.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** Note that `strftime` is a standard C function and you should consult its [reference](https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html) diff --git a/content/reference/functions/string.markdown b/content/reference/functions/string.markdown index be0f18589..c3aa3549e 100644 --- a/content/reference/functions/string.markdown +++ b/content/reference/functions/string.markdown @@ -3,11 +3,11 @@ layout: default title: string --- -[%CFEngine_function_prototype(arg)%] +{{< CFEngine_function_prototype(arg) >}} **Description:** Convert `arg` to string. -[%CFEngine_function_attributes(arg)%] +{{< CFEngine_function_attributes(arg) >}} If `arg` is a container reference it will be serialized to a string. The reference must be indicated with `@(some_container)`. @@ -15,7 +15,7 @@ Strings are *not* interpreted as references. **Example:** -[%CFEngine_include_example(string.cf)%] +{{< CFEngine_include_example(string.cf) >}} **See also:** [`int()`][int] diff --git a/content/reference/functions/string_downcase.markdown b/content/reference/functions/string_downcase.markdown index 6773c8150..0d5eca325 100644 --- a/content/reference/functions/string_downcase.markdown +++ b/content/reference/functions/string_downcase.markdown @@ -3,19 +3,19 @@ layout: default title: string_downcase --- -[%CFEngine_function_prototype(data)%] +{{< CFEngine_function_prototype(data) >}} **Description:** Returns `data` in lower case. -[%CFEngine_function_attributes(data)%] +{{< CFEngine_function_attributes(data) >}} **Example:** -[%CFEngine_include_snippet(string_downcase.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_downcase.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(string_downcase.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_downcase.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.6 diff --git a/content/reference/functions/string_head.markdown b/content/reference/functions/string_head.markdown index 140db25dd..7866f55c1 100644 --- a/content/reference/functions/string_head.markdown +++ b/content/reference/functions/string_head.markdown @@ -3,21 +3,21 @@ layout: default title: string_head --- -[%CFEngine_function_prototype(data, max)%] +{{< CFEngine_function_prototype(data, max) >}} **Description:** Returns the first `max` bytes of `data`. If `max` is negative, then everything but the last `max` bytes is returned. -[%CFEngine_function_attributes(data, max)%] +{{< CFEngine_function_attributes(data, max) >}} **Example:** -[%CFEngine_include_snippet(string_head.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_head.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(string_head.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_head.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.6 diff --git a/content/reference/functions/string_length.markdown b/content/reference/functions/string_length.markdown index 705cc1249..902ef9542 100644 --- a/content/reference/functions/string_length.markdown +++ b/content/reference/functions/string_length.markdown @@ -3,19 +3,19 @@ layout: default title: string_length --- -[%CFEngine_function_prototype(data)%] +{{< CFEngine_function_prototype(data) >}} **Description:** Returns the byte length of `data`. -[%CFEngine_function_attributes(data)%] +{{< CFEngine_function_attributes(data) >}} **Example:** -[%CFEngine_include_snippet(string_length.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_length.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(string_length.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_length.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.6 diff --git a/content/reference/functions/string_mustache.markdown b/content/reference/functions/string_mustache.markdown index 9d23176f9..a9d8fd098 100644 --- a/content/reference/functions/string_mustache.markdown +++ b/content/reference/functions/string_mustache.markdown @@ -3,21 +3,21 @@ layout: default title: string_mustache --- -[%CFEngine_function_prototype(template_string, optional_data_container)%] +{{< CFEngine_function_prototype(template_string, optional_data_container) >}} **Description:** Formats a Mustache string template into a string, using either the system `datastate()` or an explicitly provided data container. The usual Mustache facilities like conditional evaluation and loops are available, see the example below. -[%CFEngine_function_attributes(template_string, optional_data_container)%] +{{< CFEngine_function_attributes(template_string, optional_data_container) >}} **Example:** -[%CFEngine_include_snippet(string_mustache.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_mustache.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(string_mustache.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_mustache.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.7 diff --git a/content/reference/functions/string_replace.markdown b/content/reference/functions/string_replace.markdown index 451acf55d..433892772 100644 --- a/content/reference/functions/string_replace.markdown +++ b/content/reference/functions/string_replace.markdown @@ -3,11 +3,11 @@ layout: default title: string_replace --- -[%CFEngine_function_prototype(string, match, replacement)%] +{{< CFEngine_function_prototype(string, match, replacement) >}} **Description:** In a given string, replaces a substring with another string. -[%CFEngine_function_attributes(string, match, replacement)%] +{{< CFEngine_function_attributes(string, match, replacement) >}} Reads a string from left to right, replacing the occurences of the second argument with the third argument in order. @@ -19,11 +19,11 @@ advanced replace functionality, check out `regex_replace()`. **Example:** -[%CFEngine_include_snippet(string_replace.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_replace.cf, #\+begin_src cfengine3, .*end_src) >}} **Output:** -[%CFEngine_include_snippet(string_replace.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_replace.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in 3.12.1 (2018) as a simpler version of `regex_replace()` diff --git a/content/reference/functions/string_reverse.markdown b/content/reference/functions/string_reverse.markdown index df77974eb..fe6b97b29 100644 --- a/content/reference/functions/string_reverse.markdown +++ b/content/reference/functions/string_reverse.markdown @@ -3,19 +3,19 @@ layout: default title: string_reverse --- -[%CFEngine_function_prototype(data)%] +{{< CFEngine_function_prototype(data) >}} **Description:** Returns `data` reversed. -[%CFEngine_function_attributes(data)%] +{{< CFEngine_function_attributes(data) >}} **Example:** -[%CFEngine_include_snippet(string_reverse.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_reverse.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(string_reverse.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_reverse.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.6 diff --git a/content/reference/functions/string_split.markdown b/content/reference/functions/string_split.markdown index 044135c8a..367e9e659 100644 --- a/content/reference/functions/string_split.markdown +++ b/content/reference/functions/string_split.markdown @@ -3,7 +3,7 @@ layout: default title: string_split --- -[%CFEngine_function_prototype(string, regex, maxent)%] +{{< CFEngine_function_prototype(string, regex, maxent) >}} **Description:** Splits `string` into at most `maxent` substrings wherever `regex` occurs, and returns the list with those strings. @@ -16,15 +16,15 @@ last one will contain the rest of the string starting with the `maxent-1`-th delimiter. This is standard behavior in many languages like Perl or Ruby, and different from the `splitstring()` behavior. -[%CFEngine_function_attributes(string, regex, maxent)%] +{{< CFEngine_function_attributes(string, regex, maxent) >}} **Example:** -[%CFEngine_include_snippet(string_split.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_split.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(string_split.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_split.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.6; deprecates `splitstring()`. diff --git a/content/reference/functions/string_tail.markdown b/content/reference/functions/string_tail.markdown index a2b22361f..9a2b77bcb 100644 --- a/content/reference/functions/string_tail.markdown +++ b/content/reference/functions/string_tail.markdown @@ -3,21 +3,21 @@ layout: default title: string_tail --- -[%CFEngine_function_prototype(data, max)%] +{{< CFEngine_function_prototype(data, max) >}} **Description:** Returns the last `max` bytes of `data`. If `max` is negative, then everything but the first `max` bytes is returned. -[%CFEngine_function_attributes(data, max)%] +{{< CFEngine_function_attributes(data, max) >}} **Example:** -[%CFEngine_include_snippet(string_tail.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_tail.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(string_tail.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_tail.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.6 diff --git a/content/reference/functions/string_trim.markdown b/content/reference/functions/string_trim.markdown index 718405e11..0c15b162b 100644 --- a/content/reference/functions/string_trim.markdown +++ b/content/reference/functions/string_trim.markdown @@ -3,15 +3,15 @@ layout: default title: string_trim --- -[%CFEngine_function_prototype(string)%] +{{< CFEngine_function_prototype(string) >}} **Description:** Trim whitespace from beginning and end of `string`. -[%CFEngine_function_attributes(string)%] +{{< CFEngine_function_attributes(string) >}} **Example:** -[%CFEngine_include_example(string_trim.cf)%] +{{< CFEngine_include_example(string_trim.cf) >}} **History:** Introduced in CFEngine 3.16 diff --git a/content/reference/functions/string_upcase.markdown b/content/reference/functions/string_upcase.markdown index cff7659da..d69c043e1 100644 --- a/content/reference/functions/string_upcase.markdown +++ b/content/reference/functions/string_upcase.markdown @@ -3,19 +3,19 @@ layout: default title: string_upcase --- -[%CFEngine_function_prototype(data)%] +{{< CFEngine_function_prototype(data) >}} **Description:** Returns `data` in uppercase. -[%CFEngine_function_attributes(data)%] +{{< CFEngine_function_attributes(data) >}} **Example:** -[%CFEngine_include_snippet(string_upcase.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(string_upcase.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(string_upcase.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(string_upcase.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Introduced in CFEngine 3.6 diff --git a/content/reference/functions/sublist.markdown b/content/reference/functions/sublist.markdown index dbf53dbe0..1b0bffa9e 100644 --- a/content/reference/functions/sublist.markdown +++ b/content/reference/functions/sublist.markdown @@ -3,21 +3,21 @@ layout: default title: sublist --- -[%CFEngine_function_prototype(list, head_or_tail, max_elements)%] +{{< CFEngine_function_prototype(list, head_or_tail, max_elements) >}} **Description:** Returns list of up to `max_elements` of `list`, obtained from head or tail depending on `head_or_tail`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list, head_or_tail, max_elements)%] +{{< CFEngine_function_attributes(list, head_or_tail, max_elements) >}} **Example:** -[%CFEngine_include_snippet(sublist.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(sublist.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(sublist.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(sublist.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/sum.markdown b/content/reference/functions/sum.markdown index f36bd8061..10fabbf2c 100644 --- a/content/reference/functions/sum.markdown +++ b/content/reference/functions/sum.markdown @@ -3,7 +3,7 @@ layout: default title: sum --- -[%CFEngine_function_prototype(list)%] +{{< CFEngine_function_prototype(list) >}} **Description:** Return the sum of the reals in `list`. @@ -13,15 +13,15 @@ This function might be used for simple ring computation. Of course, you could easily combine `sum` with `readstringarray` or `readreallist` etc., to collect summary information from a source external to CFEngine. -[%CFEngine_function_attributes(list)%] +{{< CFEngine_function_attributes(list) >}} **Example:** -[%CFEngine_include_snippet(sum.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(sum.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(sum.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(sum.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} Because `$(six)` and `$(zero)` are both real numbers, the report that is generated will be: diff --git a/content/reference/functions/sysctlvalue.markdown b/content/reference/functions/sysctlvalue.markdown index 07536d5a2..415a93179 100644 --- a/content/reference/functions/sysctlvalue.markdown +++ b/content/reference/functions/sysctlvalue.markdown @@ -3,11 +3,11 @@ layout: default title: sysctlvalue --- -[%CFEngine_function_prototype(key)%] +{{< CFEngine_function_prototype(key) >}} **Description:** Returns the sysctl value of `key` using `/proc/sys`. -[%CFEngine_function_attributes(key)%] +{{< CFEngine_function_attributes(key) >}} **Example:** diff --git a/content/reference/functions/translatepath.markdown b/content/reference/functions/translatepath.markdown index 076010716..1449abf25 100644 --- a/content/reference/functions/translatepath.markdown +++ b/content/reference/functions/translatepath.markdown @@ -3,7 +3,7 @@ layout: default title: translatepath --- -[%CFEngine_function_prototype(path)%] +{{< CFEngine_function_prototype(path) >}} **Description:** Translate separators in `path` from Unix style to the host's native style and returns the result. @@ -13,15 +13,15 @@ these to the native format for path separators on the host. For example translatepath("a/b/c") would yield "a/b/c" on Unix platforms, but "a\\b\\c" on Windows. -[%CFEngine_function_attributes(path)%] +{{< CFEngine_function_attributes(path) >}} **Example:** -[%CFEngine_include_snippet(translatepath.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(translatepath.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(translatepath.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(translatepath.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** Be careful when using this function in combination with regular expressions, since backslash is also used as escape character in diff --git a/content/reference/functions/type.markdown b/content/reference/functions/type.markdown index a25eaa5ff..dbbc75455 100644 --- a/content/reference/functions/type.markdown +++ b/content/reference/functions/type.markdown @@ -3,11 +3,11 @@ layout: default title: type --- -[%CFEngine_function_prototype(var, detail)%] +{{< CFEngine_function_prototype(var, detail) >}} **Description:** Returns a variables type description. -[%CFEngine_function_attributes(var, detail)%] +{{< CFEngine_function_attributes(var, detail) >}} This function returns a variables type description as a string. The function expects a variable identifier as the first argument `var`. An optional second @@ -57,11 +57,11 @@ with different combinations of the arguments `type` and `detail`. **Example:** -[%CFEngine_include_snippet(type.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(type.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(type.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(type.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/unique.markdown b/content/reference/functions/unique.markdown index 341d38100..e3c1dcc7b 100644 --- a/content/reference/functions/unique.markdown +++ b/content/reference/functions/unique.markdown @@ -3,21 +3,21 @@ layout: default title: unique --- -[%CFEngine_function_prototype(list)%] +{{< CFEngine_function_prototype(list) >}} **Description:** Returns list of unique elements from `list`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list)%] +{{< CFEngine_function_attributes(list) >}} **Example:** -[%CFEngine_include_snippet(unique.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(unique.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(unique.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(unique.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** The [collecting function][Functions#collecting functions] behavior was added in 3.9. diff --git a/content/reference/functions/url_get.markdown b/content/reference/functions/url_get.markdown index e1c1aa634..066e70ea1 100644 --- a/content/reference/functions/url_get.markdown +++ b/content/reference/functions/url_get.markdown @@ -3,7 +3,7 @@ layout: default title: url_get --- -[%CFEngine_function_prototype(url, options_container)%] +{{< CFEngine_function_prototype(url, options_container) >}} **Description:** Retrieves the contents of a `url` using options from a data container. The data is returned in a @@ -46,7 +46,7 @@ The returned data container will have the following keys: * `content`: the response content as a string * `headers`: the response headers as a string -[%CFEngine_function_attributes(url, options_container)%] +{{< CFEngine_function_attributes(url, options_container) >}} **Example:** diff --git a/content/reference/functions/usemodule.markdown b/content/reference/functions/usemodule.markdown index ab750af2d..cd1502c95 100644 --- a/content/reference/functions/usemodule.markdown +++ b/content/reference/functions/usemodule.markdown @@ -3,7 +3,7 @@ layout: default title: usemodule --- -[%CFEngine_function_prototype(module, args)%] +{{< CFEngine_function_prototype(module, args) >}} **Description:** Execute CFEngine module script `module` with `args`, and return whether successful. @@ -11,7 +11,7 @@ return whether successful. The module script is expected to be located in the registered modules directory, `WORKDIR/modules`. -[%CFEngine_function_attributes(module, args)%] +{{< CFEngine_function_attributes(module, args) >}} **Example:** diff --git a/content/reference/functions/userexists.markdown b/content/reference/functions/userexists.markdown index 4424072b2..85df36557 100644 --- a/content/reference/functions/userexists.markdown +++ b/content/reference/functions/userexists.markdown @@ -3,7 +3,7 @@ layout: default title: userexists --- -[%CFEngine_function_prototype(user)%] +{{< CFEngine_function_prototype(user) >}} **Description:** Return whether `user` name or numerical id exists on this host. @@ -11,12 +11,12 @@ host. Checks whether the user is in the password database for the current host. The argument must be a user name or user id. -[%CFEngine_function_attributes(user)%] +{{< CFEngine_function_attributes(user) >}} **Example:** -[%CFEngine_include_snippet(userexists.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(userexists.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(userexists.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(userexists.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} diff --git a/content/reference/functions/useringroup.markdown b/content/reference/functions/useringroup.markdown index d7ef52cb0..128e126bb 100644 --- a/content/reference/functions/useringroup.markdown +++ b/content/reference/functions/useringroup.markdown @@ -3,21 +3,21 @@ layout: default title: useringroup --- -[%CFEngine_function_prototype(user)%] +{{< CFEngine_function_prototype(user) >}} **Description:** Return whether a `user` is a member of a given `group` Looks up the group `"group_name"` in the group database located in /etc/group and checks whether `"user_name"` is one of its members. This function is not available on Windows. -[%CFEngine_function_attributes(user_name, group_name)%] +{{< CFEngine_function_attributes(user_name, group_name) >}} **Example:** -[%CFEngine_include_snippet(useringroup.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(useringroup.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(useringroup.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(useringroup.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/validdata.markdown b/content/reference/functions/validdata.markdown index 59f799b50..abc27165d 100644 --- a/content/reference/functions/validdata.markdown +++ b/content/reference/functions/validdata.markdown @@ -3,7 +3,7 @@ layout: default title: validdata --- -[%CFEngine_function_prototype(data_container, type, strict)%] +{{< CFEngine_function_prototype(data_container, type, strict) >}} **Description:** Validates a JSON container from `data_container` and returns `"true"` if the contents are valid JSON. @@ -19,17 +19,17 @@ This function is intended to be expanded with functionality for validating CSV and YAML files eventually, mirroring `readdata()`. If `type` is `JSON`, it behaves the same as `validjson()`. -[%CFEngine_function_attributes(data_container, type, strict)%] +{{< CFEngine_function_attributes(data_container, type, strict) >}} **Example:** Run: -[%CFEngine_include_snippet(validdata.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(validdata.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(validdata.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(validdata.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `readdata()`, `validjson()` diff --git a/content/reference/functions/validjson.markdown b/content/reference/functions/validjson.markdown index 193347acf..a849d0287 100644 --- a/content/reference/functions/validjson.markdown +++ b/content/reference/functions/validjson.markdown @@ -3,7 +3,7 @@ layout: default title: validjson --- -[%CFEngine_function_prototype(string, strict)%] +{{< CFEngine_function_prototype(string, strict) >}} **Description:** Validates a JSON container from `string` and returns `"true"` if the contents are valid JSON. @@ -15,17 +15,17 @@ The strict behavior matches the expectations in other parts of policy language. Notably, `data` containers and functions like `readjson()` and `parsejson()` expect JSON containers (arrays and objects) not primitives. Thus, using `validjson()` with `strict` set to `"true"` is an effective way to check if something can be parsed by those functions. -[%CFEngine_function_attributes(string, strict)%] +{{< CFEngine_function_attributes(string, strict) >}} **Example:** Run: -[%CFEngine_include_snippet(validjson.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(validjson.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(validjson.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(validjson.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** `readjson()`, `validdata()` diff --git a/content/reference/functions/variablesmatching.markdown b/content/reference/functions/variablesmatching.markdown index b736d5dc4..a9927d645 100644 --- a/content/reference/functions/variablesmatching.markdown +++ b/content/reference/functions/variablesmatching.markdown @@ -3,7 +3,7 @@ layout: default title: variablesmatching --- -[%CFEngine_function_prototype(name, tag1, tag2, ...)%] +{{< CFEngine_function_prototype(name, tag1, tag2, ...) >}} **Description:** Return the list of variables matching `name` and any tags given. Both `name` and tags are regular expressions. @@ -25,15 +25,15 @@ This function behaves exactly like `variablesmatching_as_data()` but returns just the list of all the variables. If you want their contents as well, see that function. -[%CFEngine_function_attributes(regex, tag1, tag2, ...)%] +{{< CFEngine_function_attributes(regex, tag1, tag2, ...) >}} **Example:** -[%CFEngine_include_snippet(variablesmatching.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(variablesmatching.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(variablesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(variablesmatching.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [classesmatching()][classesmatching], [bundlesmatching()][bundlesmatching], [variablesmatching_as_data()][variablesmatching_as_data] diff --git a/content/reference/functions/variablesmatching_as_data.markdown b/content/reference/functions/variablesmatching_as_data.markdown index cd74fecc0..3b7458dff 100644 --- a/content/reference/functions/variablesmatching_as_data.markdown +++ b/content/reference/functions/variablesmatching_as_data.markdown @@ -3,7 +3,7 @@ layout: default title: variablesmatching_as_data --- -[%CFEngine_function_prototype(name, tag1, tag2, ...)%] +{{< CFEngine_function_prototype(name, tag1, tag2, ...) >}} **Description:** Return a data container with the map of variables matching `name` and any tags given to the variable contents. Both `name` and tags are @@ -26,15 +26,15 @@ This function behaves exactly like `variablesmatching()` but returns a data container with the full contents of all the variables instead of just their names. -[%CFEngine_function_attributes(regex, tag1, tag2, ...)%] +{{< CFEngine_function_attributes(regex, tag1, tag2, ...) >}} **Example:** -[%CFEngine_include_snippet(variablesmatching_as_data.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(variablesmatching_as_data.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(variablesmatching_as_data.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(variablesmatching_as_data.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [classesmatching()][classesmatching], [bundlesmatching()][bundlesmatching], [variablesmatching()][variablesmatching] diff --git a/content/reference/functions/variance.markdown b/content/reference/functions/variance.markdown index 847529e02..832a1006f 100644 --- a/content/reference/functions/variance.markdown +++ b/content/reference/functions/variance.markdown @@ -3,13 +3,13 @@ layout: default title: variance --- -[%CFEngine_function_prototype(list)%] +{{< CFEngine_function_prototype(list) >}} **Description:** Return the variance of the numbers in `list`. [This function can accept many types of data parameters.][Functions#collecting functions] -[%CFEngine_function_attributes(list)%] +{{< CFEngine_function_attributes(list) >}} Use the `eval()` function to easily get the standard deviation (square root of the variance). @@ -17,11 +17,11 @@ This is not part of a full statistical package but a convenience function. **Example:** -[%CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(max-min-mean-variance.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** diff --git a/content/reference/functions/version_compare.markdown b/content/reference/functions/version_compare.markdown index 286f92d94..85802017d 100644 --- a/content/reference/functions/version_compare.markdown +++ b/content/reference/functions/version_compare.markdown @@ -3,22 +3,22 @@ layout: default title: version_compare --- -[%CFEngine_function_prototype(version1, comparison, version2)%] +{{< CFEngine_function_prototype(version1, comparison, version2) >}} **Description:** Returns `true` if the specified version comparison expression is true. -[%CFEngine_function_attributes(version1, comparison, version2)%] +{{< CFEngine_function_attributes(version1, comparison, version2) >}} The `version_compare()` function can be used to compare 2 arbitrary semver version numbers. This can be useful if you have 2 versions of a package and you want to know if they are the same version, if one is newer than the other etc. **Example:** -[%CFEngine_include_snippet(version_compare.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(version_compare.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(version_compare.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(version_compare.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **Notes:** diff --git a/content/reference/language-concepts/bundles.markdown b/content/reference/language-concepts/bundles.markdown index cadd29d78..854b31c12 100644 --- a/content/reference/language-concepts/bundles.markdown +++ b/content/reference/language-concepts/bundles.markdown @@ -168,11 +168,11 @@ namespace). You just say `namespace:bundle_name` instead of When running `cf-agent`, the order of bundles to evaluate is determined by the `bundlesequence`. The default `bundlesequence` contains `main` for convenience, so this example works: -[%CFEngine_include_example(main.cf)%] +{{< CFEngine_include_example(main.cf) >}} #### Custom bundle sequences You can specify a custom `bundlesequence` from the command line using `--bundlesequence`, or in policy: -[%CFEngine_include_example(bundlesequence.cf)%] +{{< CFEngine_include_example(bundlesequence.cf) >}} In this example, cf-agent will not look for a `main` bundle, since it is not in the `bundlesequence`. @@ -188,9 +188,9 @@ Each file can include its own testsuite or some default behavior in a `__main__` All parts of the library will then be runnable directly, but also easy to include from other policy: `main_library.cf`: -[%CFEngine_include_example(main_library.cf)%] +{{< CFEngine_include_example(main_library.cf) >}} `main_entry_point.cf`: -[%CFEngine_include_example(main_entry_point.cf)%] +{{< CFEngine_include_example(main_entry_point.cf) >}} Both of these policy files can be run directly, the included library policy will not have a `main` bundle. diff --git a/content/reference/language-concepts/classes.markdown b/content/reference/language-concepts/classes.markdown index 57f0999af..adb469755 100644 --- a/content/reference/language-concepts/classes.markdown +++ b/content/reference/language-concepts/classes.markdown @@ -298,7 +298,7 @@ Class guards are the most common way to restrict a promise to a specific context This example illustrates how a class guard applies (to multiple promises) until a new context is specified. -[%CFEngine_include_example(classes_context_applies_multiple_promises.cf)%] +{{< CFEngine_include_example(classes_context_applies_multiple_promises.cf) >}} Another Example: @@ -462,7 +462,7 @@ are not automatically canonified when they are checked. This example shows how classes are automatically canonified when they are defined and that you must explicitly canonify when verifying classes. -[%CFEngine_include_example(class-automatic-canonificiation.cf)%] +{{< CFEngine_include_example(class-automatic-canonificiation.cf) >}} ## Operators and precedence diff --git a/content/reference/language-concepts/namespaces.markdown b/content/reference/language-concepts/namespaces.markdown index ad226da78..bdbe535c0 100644 --- a/content/reference/language-concepts/namespaces.markdown +++ b/content/reference/language-concepts/namespaces.markdown @@ -19,7 +19,7 @@ namespace applies within a single file to all subsequently defined bodies and bu following the namespace declaration until a different namespace has been declared or until the end of the file. -[%CFEngine_include_example(namespace_declaration.cf)%] +{{< CFEngine_include_example(namespace_declaration.cf) >}} **Notes:** @@ -34,7 +34,7 @@ the promiser. To refer to a bundle in another namespace you *must* specify the namespace by prefixing the bundle name with the namespace followed by a colon (`:`). -[%CFEngine_include_example(namespace_methods-usebundle.cf)%] +{{< CFEngine_include_example(namespace_methods-usebundle.cf) >}} ## Bodies @@ -42,19 +42,19 @@ Bodies are assumed to be within the same namespace as the promiser. To use a bod A common mistake is forgetting to specify `default:` when using bodies from the standard library which resides in the `default` namespace. -[%CFEngine_include_example(namespace_bodies.cf)%] +{{< CFEngine_include_example(namespace_bodies.cf) >}} ## Variables Variables (except for [Special variables][Special variables]) are assumed to be within the same scope as the promiser but can also be referenced fully qualified with the namespace. -[%CFEngine_include_example(namespace_variable_references.cf)%] +{{< CFEngine_include_example(namespace_variable_references.cf) >}} [Special variables][Special variables] are always accessible without a namespace prefix. For example, `this`, `mon`, `sys`, and `const` fall in this category. -[%CFEngine_include_example(namespace_special_var_exception.cf)%] +{{< CFEngine_include_example(namespace_special_var_exception.cf) >}} **Notes:** @@ -70,9 +70,9 @@ specified (except for Hard classes). To refer to a class in a different namespace prefix the class with the namespace suffixed by a colon (`:`). -[%CFEngine_include_example(namespace_classes.cf)%] +{{< CFEngine_include_example(namespace_classes.cf) >}} [Hard classes][Classes and decisions#Hard classes] exist in all namespaces and thus can be referred to from any namespace without qualification. -[%CFEngine_include_example(namespace_hard_classes.cf)%] +{{< CFEngine_include_example(namespace_hard_classes.cf) >}} diff --git a/content/reference/language-concepts/variables.markdown b/content/reference/language-concepts/variables.markdown index 4806cf658..7ab270d96 100644 --- a/content/reference/language-concepts/variables.markdown +++ b/content/reference/language-concepts/variables.markdown @@ -80,7 +80,7 @@ allows flexibilty when defining strings that contain quotes. Single or double quotes can be escaped with `\` however, please note that backticks (`` ` ``) can **not** be escaped. -[%CFEngine_include_example(quoting.cf)%] +{{< CFEngine_include_example(quoting.cf) >}} ### Scalar size limitations @@ -160,7 +160,7 @@ They can **NOT** be *modified*, once created, but they can be re-defined. Data containers do not have the size limitations of regular scalar variables. -[%CFEngine_include_example(reference_values_inside_data.cf)%] +{{< CFEngine_include_example(reference_values_inside_data.cf) >}} ## Associative arrays @@ -187,6 +187,6 @@ from array variables for iteration purposes. **Example:** -[%CFEngine_include_example(arrays.cf)%] +{{< CFEngine_include_example(arrays.cf) >}} **See also:** `getindices()`, `getvalues()` diff --git a/content/reference/masterfiles-policy-framework/_index.markdown b/content/reference/masterfiles-policy-framework/_index.markdown index 531858b93..79faac39d 100644 --- a/content/reference/masterfiles-policy-framework/_index.markdown +++ b/content/reference/masterfiles-policy-framework/_index.markdown @@ -7,4 +7,4 @@ sorting: 90 The Masterfiles Policy Framework or MPF also commonly referred to as simply masterfiles is the policy framework that ships with CFEngine. -[%CFEngine_include_markdown(../../masterfiles/MPF.md)%] +{{< CFEngine_include_markdown(../../masterfiles/MPF.md) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-CFE_cfengine.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-CFE_cfengine.markdown index a81bdaeac..2142b2875 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-CFE_cfengine.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-CFE_cfengine.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/CFE_cfengine.cf --- -[%CFEngine_library_include(cfe_internal/CFE_cfengine)%] +{{< CFEngine_library_include(cfe_internal/CFE_cfengine) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-core-watchdog-watchdog.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-core-watchdog-watchdog.markdown index a79f9f161..c3771d5a0 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-core-watchdog-watchdog.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-core-watchdog-watchdog.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/core/watchdog/watchdog.cf --- -[%CFEngine_library_include(cfe_internal/core/watchdog/watchdog)%] +{{< CFEngine_library_include(cfe_internal/core/watchdog/watchdog) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-core-watchdog.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-core-watchdog.markdown index f9011a9a0..79f48bbd0 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-core-watchdog.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-core-watchdog.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/core/watchdog --- -[%CFEngine_include_markdown(../../masterfiles/cfe_internal/core/watchdog/README.md)%] +{{< CFEngine_include_markdown(../../masterfiles/cfe_internal/core/watchdog/README.md) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-enterprise-federation-federation.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-enterprise-federation-federation.markdown index 60a8fe4ef..c712d8d4f 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-enterprise-federation-federation.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-enterprise-federation-federation.markdown @@ -5,4 +5,4 @@ title: cfe_internal/enterprise/federation/federation.cf This policy file handles Federated reporting setup and ongoing operations. -[%CFEngine_library_include(cfe_internal/enterprise/federation/federation)%] +{{< CFEngine_library_include(cfe_internal/enterprise/federation/federation) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-recommendations.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-recommendations.markdown index 20aca9737..9695a6d2b 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-recommendations.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-recommendations.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/recommendations.cf --- -[%CFEngine_library_include(cfe_internal/recommendations)%] +{{< CFEngine_library_include(cfe_internal/recommendations) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_dc_workflow.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_dc_workflow.markdown index 784dfe70b..077c594dd 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_dc_workflow.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_dc_workflow.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/update/cfe_internal_dc_workflow.cf --- -[%CFEngine_library_include(cfe_internal/update/cfe_internal_dc_workflow)%] +{{< CFEngine_library_include(cfe_internal/update/cfe_internal_dc_workflow) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_update_from_repository.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_update_from_repository.markdown index 8c5e6c212..a1947095f 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_update_from_repository.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_update_from_repository.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/update/cfe_internal_update_from_repository.cf --- -[%CFEngine_library_include(cfe_internal/update/cfe_internal_update_from_repository)%] +{{< CFEngine_library_include(cfe_internal/update/cfe_internal_update_from_repository) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-update-lib.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-update-lib.markdown index 19a6709b4..b9d7327ff 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-update-lib.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-update-lib.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/update/lib.cf --- -[%CFEngine_library_include(cfe_internal/update/lib)%] +{{< CFEngine_library_include(cfe_internal/update/lib) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-update-systemd_units.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-update-systemd_units.markdown index d06d5b5fb..4699778b6 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-update-systemd_units.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-update-systemd_units.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/update/systemd_units.cf --- -[%CFEngine_library_include(cfe_internal/update/systemd_units)%] +{{< CFEngine_library_include(cfe_internal/update/systemd_units) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-update-update_bins.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-update-update_bins.markdown index 53e70651d..15b8dc18e 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-update-update_bins.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-update-update_bins.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/update/update_bins.cf --- -[%CFEngine_library_include(cfe_internal/update/update_bins)%] +{{< CFEngine_library_include(cfe_internal/update/update_bins) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-update-update_policy.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-update-update_policy.markdown index 1c5fb7e33..ee5967ff8 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-update-update_policy.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-update-update_policy.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/update/update_policy.cf --- -[%CFEngine_library_include(cfe_internal/update/update_policy)%] +{{< CFEngine_library_include(cfe_internal/update/update_policy) >}} diff --git a/content/reference/masterfiles-policy-framework/cfe_internal-update-update_processes.markdown b/content/reference/masterfiles-policy-framework/cfe_internal-update-update_processes.markdown index 08a26b57d..c4a302dfa 100644 --- a/content/reference/masterfiles-policy-framework/cfe_internal-update-update_processes.markdown +++ b/content/reference/masterfiles-policy-framework/cfe_internal-update-update_processes.markdown @@ -3,4 +3,4 @@ layout: default title: cfe_internal/update/update_processes.cf --- -[%CFEngine_library_include(cfe_internal/update/update_processes)%] +{{< CFEngine_library_include(cfe_internal/update/update_processes) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-cf-hub.markdown b/content/reference/masterfiles-policy-framework/controls-cf-hub.markdown index dda9b61b4..e4940db60 100644 --- a/content/reference/masterfiles-policy-framework/controls-cf-hub.markdown +++ b/content/reference/masterfiles-policy-framework/controls-cf-hub.markdown @@ -8,4 +8,4 @@ various settings related to `cf-hub` can be tuned. Note: `cf-hub` is only available in CFEngine Enterprise. -[%CFEngine_library_include(controls/cf_hub)%] +{{< CFEngine_library_include(controls/cf_hub) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-cf_agent.markdown b/content/reference/masterfiles-policy-framework/controls-cf_agent.markdown index 1515cefba..0dc8d8e91 100644 --- a/content/reference/masterfiles-policy-framework/controls-cf_agent.markdown +++ b/content/reference/masterfiles-policy-framework/controls-cf_agent.markdown @@ -6,4 +6,4 @@ title: controls/cf_agent.cf This is where `body agent control` is defined. `body agent control` is where various settings related to `cf-agent` can be tuned. -[%CFEngine_library_include(controls/cf_agent)%] +{{< CFEngine_library_include(controls/cf_agent) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-cf_execd.markdown b/content/reference/masterfiles-policy-framework/controls-cf_execd.markdown index f001d4f76..3abe05bdd 100644 --- a/content/reference/masterfiles-policy-framework/controls-cf_execd.markdown +++ b/content/reference/masterfiles-policy-framework/controls-cf_execd.markdown @@ -6,4 +6,4 @@ title: controls/cf_execd.cf This is where `body executor control` is defined. `body executor control` is where various settings related to `cf-execd` can be tuned. -[%CFEngine_library_include(controls/cf_execd)%] +{{< CFEngine_library_include(controls/cf_execd) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-cf_monitord.markdown b/content/reference/masterfiles-policy-framework/controls-cf_monitord.markdown index 062ecde0f..8d60d03ba 100644 --- a/content/reference/masterfiles-policy-framework/controls-cf_monitord.markdown +++ b/content/reference/masterfiles-policy-framework/controls-cf_monitord.markdown @@ -6,4 +6,4 @@ title: controls/cf_monitord.cf This is where `body monitor control` is defined. `body monitor control` is where various settings related to `cf-monitord` can be tuned. -[%CFEngine_library_include(controls/cf_monitord)%] +{{< CFEngine_library_include(controls/cf_monitord) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-cf_runagent.markdown b/content/reference/masterfiles-policy-framework/controls-cf_runagent.markdown index f768e67b0..bd126d272 100644 --- a/content/reference/masterfiles-policy-framework/controls-cf_runagent.markdown +++ b/content/reference/masterfiles-policy-framework/controls-cf_runagent.markdown @@ -8,4 +8,4 @@ various settings related to `cf-runagent` can be tuned. **See also:** [Run agent on multiple hosts sharing a class][Manual Execution#Remote agent run for many hosts sharing a class] -[%CFEngine_library_include(controls/cf_runagent)%] +{{< CFEngine_library_include(controls/cf_runagent) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-cf_serverd.markdown b/content/reference/masterfiles-policy-framework/controls-cf_serverd.markdown index 40cef2f4a..10164af04 100644 --- a/content/reference/masterfiles-policy-framework/controls-cf_serverd.markdown +++ b/content/reference/masterfiles-policy-framework/controls-cf_serverd.markdown @@ -6,4 +6,4 @@ title: controls/cf_serverd.cf This is where `body server control` is defined. `body server control` is where various settings related to `cf-serverd` can be tuned. -[%CFEngine_library_include(controls/cf_serverd)%] +{{< CFEngine_library_include(controls/cf_serverd) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-def.markdown b/content/reference/masterfiles-policy-framework/controls-def.markdown index 322a00f2d..4ba6cab16 100644 --- a/content/reference/masterfiles-policy-framework/controls-def.markdown +++ b/content/reference/masterfiles-policy-framework/controls-def.markdown @@ -5,4 +5,4 @@ title: controls/def.cf This is where most common variables and classes are defined. Note its variable scope can be augmented with `def.json`. -[%CFEngine_library_include(controls/def)%] +{{< CFEngine_library_include(controls/def) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-def_inputs.markdown b/content/reference/masterfiles-policy-framework/controls-def_inputs.markdown index e36d55431..a16f7debe 100644 --- a/content/reference/masterfiles-policy-framework/controls-def_inputs.markdown +++ b/content/reference/masterfiles-policy-framework/controls-def_inputs.markdown @@ -6,4 +6,4 @@ title: controls/def_inputs.cf This is where the list of policy files to include as defined from the augments file is included. -[%CFEngine_library_include(controls/def_inputs)%] +{{< CFEngine_library_include(controls/def_inputs) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-reports.markdown b/content/reference/masterfiles-policy-framework/controls-reports.markdown index 5057236aa..dbd0434d2 100644 --- a/content/reference/masterfiles-policy-framework/controls-reports.markdown +++ b/content/reference/masterfiles-policy-framework/controls-reports.markdown @@ -8,4 +8,4 @@ variables and classes should be collected by central reporting based on tags that should be included or excluded. It also controls which measuremtnts taken by `cf-monitord` will be collected for central reporting. -[%CFEngine_library_include(controls/reports)%] +{{< CFEngine_library_include(controls/reports) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-update_def.markdown b/content/reference/masterfiles-policy-framework/controls-update_def.markdown index 6b7861032..92e600a86 100644 --- a/content/reference/masterfiles-policy-framework/controls-update_def.markdown +++ b/content/reference/masterfiles-policy-framework/controls-update_def.markdown @@ -6,4 +6,4 @@ title: controls/update_def.cf This is where most common variables and classes are defined for the update policy. Note its variable scope can be augmented with `def.json`. -[%CFEngine_library_include(controls/update_def)%] +{{< CFEngine_library_include(controls/update_def) >}} diff --git a/content/reference/masterfiles-policy-framework/controls-update_def_inputs.markdown b/content/reference/masterfiles-policy-framework/controls-update_def_inputs.markdown index 91b1a1b5e..4cb2a206c 100644 --- a/content/reference/masterfiles-policy-framework/controls-update_def_inputs.markdown +++ b/content/reference/masterfiles-policy-framework/controls-update_def_inputs.markdown @@ -6,4 +6,4 @@ title: controls/update_def_inputs.cf This is where the list of update related policy files to include as defined from the augments file is included. -[%CFEngine_library_include(controls/update_def_inputs)%] +{{< CFEngine_library_include(controls/update_def_inputs) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-any.markdown b/content/reference/masterfiles-policy-framework/inventory-any.markdown index c7e60e603..12471329a 100644 --- a/content/reference/masterfiles-policy-framework/inventory-any.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-any.markdown @@ -10,4 +10,4 @@ these inventoried variables and classes are automatically collected into a centralized reporting system. In the CFEngine Community Edition these variables are availbale from within policy, and may be reporting in numerous ways. -[%CFEngine_library_include(inventory/any)%] +{{< CFEngine_library_include(inventory/any) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-debian.markdown b/content/reference/masterfiles-policy-framework/inventory-debian.markdown index 18fc88cc8..e0d7ba261 100644 --- a/content/reference/masterfiles-policy-framework/inventory-debian.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-debian.markdown @@ -5,4 +5,4 @@ title: inventory/debian.cf This policy is inventory related to debian hosts. -[%CFEngine_library_include(inventory/debian)%] +{{< CFEngine_library_include(inventory/debian) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-freebsd.markdown b/content/reference/masterfiles-policy-framework/inventory-freebsd.markdown index e48b8ada1..7dab0455c 100644 --- a/content/reference/masterfiles-policy-framework/inventory-freebsd.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-freebsd.markdown @@ -5,4 +5,4 @@ title: inventory/freebsd.cf This policy is inventory related to freebsd hosts. -[%CFEngine_library_include(inventory/freebsd)%] +{{< CFEngine_library_include(inventory/freebsd) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-generic.markdown b/content/reference/masterfiles-policy-framework/inventory-generic.markdown index e478345e6..c312fc957 100644 --- a/content/reference/masterfiles-policy-framework/inventory-generic.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-generic.markdown @@ -5,4 +5,4 @@ title: inventory/generic.cf This policy is inventory related to generic hosts. -[%CFEngine_library_include(inventory/generic)%] +{{< CFEngine_library_include(inventory/generic) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-linux.markdown b/content/reference/masterfiles-policy-framework/inventory-linux.markdown index 2085aceb6..c6318f264 100644 --- a/content/reference/masterfiles-policy-framework/inventory-linux.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-linux.markdown @@ -5,4 +5,4 @@ title: inventory/linux.cf This policy is inventory related to linux hosts. -[%CFEngine_library_include(inventory/linux)%] +{{< CFEngine_library_include(inventory/linux) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-lsb.markdown b/content/reference/masterfiles-policy-framework/inventory-lsb.markdown index cbd7d30f6..533fe641d 100644 --- a/content/reference/masterfiles-policy-framework/inventory-lsb.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-lsb.markdown @@ -5,4 +5,4 @@ title: inventory/lsb.cf This policy is inventory related to lsb hosts. -[%CFEngine_library_include(inventory/lsb)%] +{{< CFEngine_library_include(inventory/lsb) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-macos.markdown b/content/reference/masterfiles-policy-framework/inventory-macos.markdown index b9e09ef5e..2e0290c07 100644 --- a/content/reference/masterfiles-policy-framework/inventory-macos.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-macos.markdown @@ -5,4 +5,4 @@ title: inventory/macos.cf This policy is inventory related to macos hosts. -[%CFEngine_library_include(inventory/macos)%] +{{< CFEngine_library_include(inventory/macos) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-os.markdown b/content/reference/masterfiles-policy-framework/inventory-os.markdown index cd2946f1d..01c4dbd07 100644 --- a/content/reference/masterfiles-policy-framework/inventory-os.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-os.markdown @@ -5,4 +5,4 @@ title: inventory/os.cf This policy is inventory related to os hosts. -[%CFEngine_library_include(inventory/os)%] +{{< CFEngine_library_include(inventory/os) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-redhat.markdown b/content/reference/masterfiles-policy-framework/inventory-redhat.markdown index b91ba010d..b64014743 100644 --- a/content/reference/masterfiles-policy-framework/inventory-redhat.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-redhat.markdown @@ -5,4 +5,4 @@ title: inventory/redhat.cf This policy is inventory related to redhat hosts. -[%CFEngine_library_include(inventory/redhat)%] +{{< CFEngine_library_include(inventory/redhat) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-suse.markdown b/content/reference/masterfiles-policy-framework/inventory-suse.markdown index e3f451b23..871e501c4 100644 --- a/content/reference/masterfiles-policy-framework/inventory-suse.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-suse.markdown @@ -5,4 +5,4 @@ title: inventory/suse.cf This policy is inventory related to suse hosts. -[%CFEngine_library_include(inventory/suse)%] +{{< CFEngine_library_include(inventory/suse) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory-windows.markdown b/content/reference/masterfiles-policy-framework/inventory-windows.markdown index 1f2833ac8..ee58438cc 100644 --- a/content/reference/masterfiles-policy-framework/inventory-windows.markdown +++ b/content/reference/masterfiles-policy-framework/inventory-windows.markdown @@ -5,4 +5,4 @@ title: inventory/windows.cf This policy is inventory related to windows hosts. -[%CFEngine_library_include(inventory/windows)%] +{{< CFEngine_library_include(inventory/windows) >}} diff --git a/content/reference/masterfiles-policy-framework/inventory.markdown b/content/reference/masterfiles-policy-framework/inventory.markdown index baa2f88ca..d63b02755 100644 --- a/content/reference/masterfiles-policy-framework/inventory.markdown +++ b/content/reference/masterfiles-policy-framework/inventory.markdown @@ -3,4 +3,4 @@ layout: default title: inventory/ --- -[%CFEngine_include_markdown(../../masterfiles/inventory/README.md)%] +{{< CFEngine_include_markdown(../../masterfiles/inventory/README.md) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-autorun.markdown b/content/reference/masterfiles-policy-framework/lib-autorun.markdown index 3b4734d5a..1b119b588 100644 --- a/content/reference/masterfiles-policy-framework/lib-autorun.markdown +++ b/content/reference/masterfiles-policy-framework/lib-autorun.markdown @@ -3,4 +3,4 @@ layout: default title: lib/autorun.cf --- -[%CFEngine_library_include(lib/autorun)%] +{{< CFEngine_library_include(lib/autorun) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-bundles.markdown b/content/reference/masterfiles-policy-framework/lib-bundles.markdown index ce1cb1771..1e2b3ad8d 100644 --- a/content/reference/masterfiles-policy-framework/lib-bundles.markdown +++ b/content/reference/masterfiles-policy-framework/lib-bundles.markdown @@ -3,4 +3,4 @@ layout: default title: lib/bundles.cf --- -[%CFEngine_library_include(lib/bundles)%] +{{< CFEngine_library_include(lib/bundles) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-cfe_internal.markdown b/content/reference/masterfiles-policy-framework/lib-cfe_internal.markdown index 96cb83423..749265c7a 100644 --- a/content/reference/masterfiles-policy-framework/lib-cfe_internal.markdown +++ b/content/reference/masterfiles-policy-framework/lib-cfe_internal.markdown @@ -3,4 +3,4 @@ layout: default title: lib/cfe_internal.cf --- -[%CFEngine_library_include(lib/cfe_internal)%] +{{< CFEngine_library_include(lib/cfe_internal) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-cfe_internal_hub.markdown b/content/reference/masterfiles-policy-framework/lib-cfe_internal_hub.markdown index ec0a41fd8..b99f50e6d 100644 --- a/content/reference/masterfiles-policy-framework/lib-cfe_internal_hub.markdown +++ b/content/reference/masterfiles-policy-framework/lib-cfe_internal_hub.markdown @@ -3,4 +3,4 @@ layout: default title: lib/cfe_internal_hub.cf --- -[%CFEngine_library_include(lib/cfe_internal_hub)%] +{{< CFEngine_library_include(lib/cfe_internal_hub) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-cfengine_enterprise_hub_ha.markdown b/content/reference/masterfiles-policy-framework/lib-cfengine_enterprise_hub_ha.markdown index 93a84e848..177a59f5c 100644 --- a/content/reference/masterfiles-policy-framework/lib-cfengine_enterprise_hub_ha.markdown +++ b/content/reference/masterfiles-policy-framework/lib-cfengine_enterprise_hub_ha.markdown @@ -3,4 +3,4 @@ layout: default title: lib/cfengine_enterprise_hub_ha.cf --- -[%CFEngine_library_include(lib/cfengine_enterprise_hub_ha)%] +{{< CFEngine_library_include(lib/cfengine_enterprise_hub_ha) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-commands.markdown b/content/reference/masterfiles-policy-framework/lib-commands.markdown index 8f472a976..26384cd83 100644 --- a/content/reference/masterfiles-policy-framework/lib-commands.markdown +++ b/content/reference/masterfiles-policy-framework/lib-commands.markdown @@ -6,4 +6,4 @@ title: lib/commands.cf See the [`commands` promises][commands] documentation for a comprehensive reference on the body types and attributes used here. -[%CFEngine_library_include(lib/commands)%] +{{< CFEngine_library_include(lib/commands) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-common.markdown b/content/reference/masterfiles-policy-framework/lib-common.markdown index 4405ed888..1fac2225c 100644 --- a/content/reference/masterfiles-policy-framework/lib-common.markdown +++ b/content/reference/masterfiles-policy-framework/lib-common.markdown @@ -8,4 +8,4 @@ the [common promise attributes][Promise types#Common promise attributes] documentation for a comprehensive reference on the body types and attributes used here. -[%CFEngine_library_include(lib/common)%] +{{< CFEngine_library_include(lib/common) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-databases.markdown b/content/reference/masterfiles-policy-framework/lib-databases.markdown index 808095500..8d4747db6 100644 --- a/content/reference/masterfiles-policy-framework/lib-databases.markdown +++ b/content/reference/masterfiles-policy-framework/lib-databases.markdown @@ -6,4 +6,4 @@ title: lib/databases.cf See the [`databases` promises][databases] documentation for a comprehensive reference on the body types and attributes used here. -[%CFEngine_library_include(lib/databases)%] +{{< CFEngine_library_include(lib/databases) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-edit_xml.markdown b/content/reference/masterfiles-policy-framework/lib-edit_xml.markdown index f544c2d97..ca349af66 100644 --- a/content/reference/masterfiles-policy-framework/lib-edit_xml.markdown +++ b/content/reference/masterfiles-policy-framework/lib-edit_xml.markdown @@ -3,4 +3,4 @@ layout: default title: lib/edit_xml.cf --- -[%CFEngine_library_include(lib/edit_xml)%] +{{< CFEngine_library_include(lib/edit_xml) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-event.markdown b/content/reference/masterfiles-policy-framework/lib-event.markdown index ff919b253..0e0852264 100644 --- a/content/reference/masterfiles-policy-framework/lib-event.markdown +++ b/content/reference/masterfiles-policy-framework/lib-event.markdown @@ -3,4 +3,4 @@ layout: default title: lib/event.cf --- -[%CFEngine_library_include(lib/event)%] +{{< CFEngine_library_include(lib/event) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-examples.markdown b/content/reference/masterfiles-policy-framework/lib-examples.markdown index d9cb82eba..273d8c254 100644 --- a/content/reference/masterfiles-policy-framework/lib-examples.markdown +++ b/content/reference/masterfiles-policy-framework/lib-examples.markdown @@ -3,4 +3,4 @@ layout: default title: lib/examples.cf --- -[%CFEngine_library_include(lib/examples)%] +{{< CFEngine_library_include(lib/examples) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-feature.markdown b/content/reference/masterfiles-policy-framework/lib-feature.markdown index a1e4f9cd2..4f05b3063 100644 --- a/content/reference/masterfiles-policy-framework/lib-feature.markdown +++ b/content/reference/masterfiles-policy-framework/lib-feature.markdown @@ -3,4 +3,4 @@ layout: default title: lib/feature.cf --- -[%CFEngine_library_include(lib/feature)%] +{{< CFEngine_library_include(lib/feature) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-files.markdown b/content/reference/masterfiles-policy-framework/lib-files.markdown index 3bd846dac..2773840ff 100644 --- a/content/reference/masterfiles-policy-framework/lib-files.markdown +++ b/content/reference/masterfiles-policy-framework/lib-files.markdown @@ -7,4 +7,4 @@ See the [`files` promises][files] and [`edit_line` bundles][edit_line] documentation for a comprehensive reference on the bundles, body types, and attributes used here. -[%CFEngine_library_include(lib/files)%] +{{< CFEngine_library_include(lib/files) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-guest_environments.markdown b/content/reference/masterfiles-policy-framework/lib-guest_environments.markdown index f00f3bdf2..dc15427bd 100644 --- a/content/reference/masterfiles-policy-framework/lib-guest_environments.markdown +++ b/content/reference/masterfiles-policy-framework/lib-guest_environments.markdown @@ -3,4 +3,4 @@ layout: default title: lib/guest_environments.cf --- -[%CFEngine_library_include(lib/guest_environments)%] +{{< CFEngine_library_include(lib/guest_environments) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-monitor.markdown b/content/reference/masterfiles-policy-framework/lib-monitor.markdown index 0fc0908d9..b7c6c3e9b 100644 --- a/content/reference/masterfiles-policy-framework/lib-monitor.markdown +++ b/content/reference/masterfiles-policy-framework/lib-monitor.markdown @@ -3,4 +3,4 @@ layout: default title: lib/monitor.cf --- -[%CFEngine_library_include(lib/monitor)%] +{{< CFEngine_library_include(lib/monitor) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-packages.markdown b/content/reference/masterfiles-policy-framework/lib-packages.markdown index 175480b9e..d7f6c5067 100644 --- a/content/reference/masterfiles-policy-framework/lib-packages.markdown +++ b/content/reference/masterfiles-policy-framework/lib-packages.markdown @@ -6,4 +6,4 @@ title: lib/packages.cf See the [`packages` promises][packages] documentation for a comprehensive reference on the body types and attributes used here. -[%CFEngine_library_include(lib/packages)%] +{{< CFEngine_library_include(lib/packages) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-paths.markdown b/content/reference/masterfiles-policy-framework/lib-paths.markdown index 2399f21fa..cd3c146fd 100644 --- a/content/reference/masterfiles-policy-framework/lib-paths.markdown +++ b/content/reference/masterfiles-policy-framework/lib-paths.markdown @@ -3,4 +3,4 @@ layout: default title: lib/paths.cf --- -[%CFEngine_library_include(lib/paths)%] +{{< CFEngine_library_include(lib/paths) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-processes.markdown b/content/reference/masterfiles-policy-framework/lib-processes.markdown index 2e03d83f5..a92d0cde4 100644 --- a/content/reference/masterfiles-policy-framework/lib-processes.markdown +++ b/content/reference/masterfiles-policy-framework/lib-processes.markdown @@ -6,4 +6,4 @@ title: lib/processes.cf See the [`processes` promises][processes] documentation for a comprehensive reference on the body types and attributes used here. -[%CFEngine_library_include(lib/processes)%] +{{< CFEngine_library_include(lib/processes) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-reports.markdown b/content/reference/masterfiles-policy-framework/lib-reports.markdown index 740b0795b..9bd939b11 100644 --- a/content/reference/masterfiles-policy-framework/lib-reports.markdown +++ b/content/reference/masterfiles-policy-framework/lib-reports.markdown @@ -3,4 +3,4 @@ layout: default title: lib/reports.cf --- -[%CFEngine_library_include(lib/reports)%] +{{< CFEngine_library_include(lib/reports) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-services.markdown b/content/reference/masterfiles-policy-framework/lib-services.markdown index df38393fb..d038a2552 100644 --- a/content/reference/masterfiles-policy-framework/lib-services.markdown +++ b/content/reference/masterfiles-policy-framework/lib-services.markdown @@ -6,4 +6,4 @@ title: lib/services.cf See the [`services` promises][services] documentation for a comprehensive reference on the body types and attributes used here. -[%CFEngine_library_include(lib/services)%] +{{< CFEngine_library_include(lib/services) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-stdlib.markdown b/content/reference/masterfiles-policy-framework/lib-stdlib.markdown index 8d69dc906..71778b398 100644 --- a/content/reference/masterfiles-policy-framework/lib-stdlib.markdown +++ b/content/reference/masterfiles-policy-framework/lib-stdlib.markdown @@ -3,4 +3,4 @@ layout: default title: lib/stdlib.cf --- -[%CFEngine_library_include(lib/stdlib)%] +{{< CFEngine_library_include(lib/stdlib) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-storage.markdown b/content/reference/masterfiles-policy-framework/lib-storage.markdown index d438c779a..27f10ff86 100644 --- a/content/reference/masterfiles-policy-framework/lib-storage.markdown +++ b/content/reference/masterfiles-policy-framework/lib-storage.markdown @@ -6,4 +6,4 @@ title: lib/storage.cf See the [`storage` promises][storage] documentation for a comprehensive reference on the body types and attributes used here. -[%CFEngine_library_include(lib/storage)%] +{{< CFEngine_library_include(lib/storage) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-testing.markdown b/content/reference/masterfiles-policy-framework/lib-testing.markdown index 96dc2f299..10f4c75a2 100644 --- a/content/reference/masterfiles-policy-framework/lib-testing.markdown +++ b/content/reference/masterfiles-policy-framework/lib-testing.markdown @@ -8,4 +8,4 @@ TAP and jUnit. These bodies are included in the stdlib by default. -[%CFEngine_library_include(lib/testing)%] +{{< CFEngine_library_include(lib/testing) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-users.markdown b/content/reference/masterfiles-policy-framework/lib-users.markdown index ee26609df..f113d9039 100644 --- a/content/reference/masterfiles-policy-framework/lib-users.markdown +++ b/content/reference/masterfiles-policy-framework/lib-users.markdown @@ -6,4 +6,4 @@ title: lib/users.cf See the [`users` promises][users] documentation for a comprehensive reference on the body types and attributes used here. -[%CFEngine_library_include(lib/users)%] +{{< CFEngine_library_include(lib/users) >}} diff --git a/content/reference/masterfiles-policy-framework/lib-vcs.markdown b/content/reference/masterfiles-policy-framework/lib-vcs.markdown index 4868ef8f4..dbf90a8a0 100644 --- a/content/reference/masterfiles-policy-framework/lib-vcs.markdown +++ b/content/reference/masterfiles-policy-framework/lib-vcs.markdown @@ -5,4 +5,4 @@ title: lib/vcs.cf The `vcs.cf` library provides bundles for working with version control tools. -[%CFEngine_library_include(lib/vcs)%] +{{< CFEngine_library_include(lib/vcs) >}} diff --git a/content/reference/masterfiles-policy-framework/modules-mustache.markdown b/content/reference/masterfiles-policy-framework/modules-mustache.markdown index 1d2cbb53b..19c51a339 100644 --- a/content/reference/masterfiles-policy-framework/modules-mustache.markdown +++ b/content/reference/masterfiles-policy-framework/modules-mustache.markdown @@ -3,4 +3,4 @@ layout: default title: modules/mustache/ --- -[%CFEngine_include_markdown(../../masterfiles/modules/mustache/README.md)%] +{{< CFEngine_include_markdown(../../masterfiles/modules/mustache/README.md) >}} diff --git a/content/reference/masterfiles-policy-framework/modules-promises-cfengine.py.markdown b/content/reference/masterfiles-policy-framework/modules-promises-cfengine.py.markdown index 27257e1d5..cce6145a2 100644 --- a/content/reference/masterfiles-policy-framework/modules-promises-cfengine.py.markdown +++ b/content/reference/masterfiles-policy-framework/modules-promises-cfengine.py.markdown @@ -4,5 +4,5 @@ title: modules/promises/cfengine.py --- ``` -[%CFEngine_include_markdown(../../masterfiles/modules/promises/cfengine.py)%] +{{< CFEngine_include_markdown(../../masterfiles/modules/promises/cfengine.py) >}} ``` diff --git a/content/reference/masterfiles-policy-framework/modules-promises-cfengine.sh.markdown b/content/reference/masterfiles-policy-framework/modules-promises-cfengine.sh.markdown index 64a92c284..59fe44fea 100644 --- a/content/reference/masterfiles-policy-framework/modules-promises-cfengine.sh.markdown +++ b/content/reference/masterfiles-policy-framework/modules-promises-cfengine.sh.markdown @@ -4,5 +4,5 @@ title: modules/promises/cfengine.sh --- ``` -[%CFEngine_include_markdown(../../masterfiles/modules/promises/cfengine.sh)%] +{{< CFEngine_include_markdown(../../masterfiles/modules/promises/cfengine.sh) >}} ``` diff --git a/content/reference/masterfiles-policy-framework/no-distrib.markdown b/content/reference/masterfiles-policy-framework/no-distrib.markdown index ff6379274..f3d3038e4 100644 --- a/content/reference/masterfiles-policy-framework/no-distrib.markdown +++ b/content/reference/masterfiles-policy-framework/no-distrib.markdown @@ -4,4 +4,4 @@ title: .no-distrib/ sorting: 20 --- -[%CFEngine_include_markdown(../../masterfiles/.no-distrib/README.md)%] +{{< CFEngine_include_markdown(../../masterfiles/.no-distrib/README.md) >}} diff --git a/content/reference/masterfiles-policy-framework/promises.markdown b/content/reference/masterfiles-policy-framework/promises.markdown index 444001775..ec1a86e18 100644 --- a/content/reference/masterfiles-policy-framework/promises.markdown +++ b/content/reference/masterfiles-policy-framework/promises.markdown @@ -10,4 +10,4 @@ part of the policy and the order in which to run bundles. ## Policy -[%CFEngine_library_include(promises)%] +{{< CFEngine_library_include(promises) >}} diff --git a/content/reference/masterfiles-policy-framework/services-autorun.markdown b/content/reference/masterfiles-policy-framework/services-autorun.markdown index 372765cc2..d4ba8576a 100644 --- a/content/reference/masterfiles-policy-framework/services-autorun.markdown +++ b/content/reference/masterfiles-policy-framework/services-autorun.markdown @@ -3,4 +3,4 @@ layout: default title: services/autorun/ --- -[%CFEngine_include_markdown(../../masterfiles/services/autorun/README.md)%] +{{< CFEngine_include_markdown(../../masterfiles/services/autorun/README.md) >}} diff --git a/content/reference/masterfiles-policy-framework/standalone_self_upgrade.markdown b/content/reference/masterfiles-policy-framework/standalone_self_upgrade.markdown index 8bc9de36e..85cb57a9f 100644 --- a/content/reference/masterfiles-policy-framework/standalone_self_upgrade.markdown +++ b/content/reference/masterfiles-policy-framework/standalone_self_upgrade.markdown @@ -13,4 +13,4 @@ for use with community packages. *** -[%CFEngine_library_include(standalone_self_upgrade)%] +{{< CFEngine_library_include(standalone_self_upgrade) >}} diff --git a/content/reference/masterfiles-policy-framework/update.markdown b/content/reference/masterfiles-policy-framework/update.markdown index d9f91ba09..0024788d5 100644 --- a/content/reference/masterfiles-policy-framework/update.markdown +++ b/content/reference/masterfiles-policy-framework/update.markdown @@ -8,4 +8,4 @@ sorting: 20 policy from the hub as well as ensuring various core cfenigne components are running. -[%CFEngine_library_include(update)%] +{{< CFEngine_library_include(update) >}} diff --git a/content/reference/promise-types/_index.markdown b/content/reference/promise-types/_index.markdown index 74361a84e..ac5ff2754 100644 --- a/content/reference/promise-types/_index.markdown +++ b/content/reference/promise-types/_index.markdown @@ -63,11 +63,11 @@ kept. Policy: -[%CFEngine_include_example(action_policy.cf, #\+begin_src\s+cfengine3, .*end_src)%] +{{< CFEngine_include_example(action_policy.cf, #\+begin_src\s+cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(action_policy.cf, #\+begin_src\s+mock_example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(action_policy.cf, #\+begin_src\s+mock_example_output\s*, .*end_src) >}} #### ifelapsed @@ -965,7 +965,7 @@ Handles in other namespaces may be referred to by namespace:handle. **Example:** -[%CFEngine_include_example(depends_on.cf)%] +{{< CFEngine_include_example(depends_on.cf) >}} ### handle @@ -1236,11 +1236,11 @@ you'd use `with => canonify("the value")` so you don't have to create a **Example:** -[%CFEngine_include_snippet(with.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(with.cf, #\+begin_src cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(with.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(with.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **History:** Was introduced in 3.11.0 @@ -1260,9 +1260,9 @@ type as a function call. For a detailed description, see **Examples:** -[%CFEngine_include_example(inherit_from.cf)%] +{{< CFEngine_include_example(inherit_from.cf) >}} -[%CFEngine_include_example(inherit_from_classes.cf)%] +{{< CFEngine_include_example(inherit_from_classes.cf) >}} **History:** Was introduced in 3.8.0. diff --git a/content/reference/promise-types/access.markdown b/content/reference/promise-types/access.markdown index d725c435c..bac9997cc 100644 --- a/content/reference/promise-types/access.markdown +++ b/content/reference/promise-types/access.markdown @@ -100,7 +100,7 @@ reporting and orchestration. Using the built-in `report_data_select` body `default_data_select_host`: -[%CFEngine_include_snippet(controls/reports.cf, .+default_data_select_host, \})%] +{{< CFEngine_include_snippet(controls/reports.cf, .+default_data_select_host, \}) >}} The access promise allows overlapping promises to be made, and these are kept on a first-come-first-served basis. Thus file objects (promisers) should be @@ -115,7 +115,7 @@ promises will override less specific ones. **Description:** A list of hostnames or domains that should have access to the object. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **Note:** The host trying to access the object is identified using a reverse DNS lookup on the connecting IP. This introduces latency for @@ -158,7 +158,7 @@ access: admit_ips => {"192.168.0.1", "192.168.0.0/24", "0.0.0.0/0"}; ``` -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `deny_ips`, `admit_hostnames`, `admit_keys` @@ -187,7 +187,7 @@ access: admit_keys => {"MD5=abcdef"}; ``` -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `deny_keys`, `admit_hostnames`, `admit_ips`, `copyfrom_restrict_keys` @@ -215,7 +215,7 @@ access: deny_hostnames => { ".cfengine.com", "www.cfengine3.com" }; ``` -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **Notes:** Failure to resolve a hostname or it's reverse results in a denial. Since this control is sensitive to temporary DNS failures, and cases, where @@ -245,7 +245,7 @@ access: }; ``` -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `admit_ips`, `deny_hostnames`, `deny_keys` @@ -257,7 +257,7 @@ access: This overrides the grants in `admit_hostnames`, `admit_ips` and `admit_keys`. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} For example, here we'll deny the fictitious SHA key `abcdef`: @@ -350,7 +350,7 @@ files owned by non-privileged users. If `maproot` is true then remote A typical case where mapping is important is in making backups of many user files. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **Example:** @@ -380,7 +380,7 @@ encryption is always enabled. If this flag is true a client cannot access the file object unless its connection is encrypted. -[%CFEngine_promise_attribute(false)%] +{{< CFEngine_promise_attribute(false) >}} **Example:** @@ -417,7 +417,7 @@ If more than one `report_data_select` body applies to the same host, all of them Usage of this body is only allowed in conjunction with using [`resource_type => "query"`][access#resource_type], as this is the resource type that is being affected. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **Example:** @@ -435,9 +435,9 @@ body report_data_select report_data Here are the built-in `report_data_select` bodies `default_data_select_host()` and `default_data_select_policy_hub()`: -[%CFEngine_include_snippet(controls/reports.cf, .+default_data_select_host, \})%] +{{< CFEngine_include_snippet(controls/reports.cf, .+default_data_select_host, \}) >}} -[%CFEngine_include_snippet(controls/reports.cf, .+default_data_select_policy_hub, \})%] +{{< CFEngine_include_snippet(controls/reports.cf, .+default_data_select_policy_hub, \}) >}} **See also:** [Common body attributes][Promise types#Common body attributes] @@ -464,7 +464,7 @@ reported to the CFEngine Enterprise server. When combined with `metatags_include`, this list is applied to the selected subset. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `metatags_include`, `promise_handle_exclude`, `monitoring_exclude` @@ -481,7 +481,7 @@ reported to the CFEngine Enterprise server. When combined with `metatags_exclude`, the exclude list is applied to the subset from this list. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `metatags_exclude`, `promise_handle_include`, `monitoring_include` @@ -498,7 +498,7 @@ not be reported to the CFEngine Enterprise server. When combined with `promise_handle_include`, this list is applied to the selected subset. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `promise_handle_include`, `metatags_exclude`, `monitoring_exclude` @@ -515,7 +515,7 @@ be reported to the CFEngine Enterprise server. When combined with `promise_handle_exclude`, the exclude list is applied to the subset from this list. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `promise_handle_exclude`, `metatags_include`, `monitoring_include` @@ -532,7 +532,7 @@ to the CFEngine Enterprise server. When combined with `monitoring_exclude`, the exclude list is applied to the subset from this list. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `monitoring_exclude`, `promise_handle_include`, `metatags_include` @@ -549,7 +549,7 @@ reported to the CFEngine Enterprise server. When combined with `monitoring_include`, this list is applied to the selected subset. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **See also:** `monitoring_include`, `promise_handle_exclude`, `metatags_exclude` @@ -568,7 +568,7 @@ hashed passwords). In the case of literal data, the promise handle serves as the reference identifier for queries. Queries are instigated by function calls by any agent. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} If the resource type is `literal`, CFEngine will grant access to a literal data string. This string is defined either by the promiser @@ -654,7 +654,7 @@ bundle server my_access_rules() **Description:** For file promisers, the server will give access to the file under its shortcut name. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **Example:** diff --git a/content/reference/promise-types/classes.markdown b/content/reference/promise-types/classes.markdown index 5f059fc61..0fa8a2188 100644 --- a/content/reference/promise-types/classes.markdown +++ b/content/reference/promise-types/classes.markdown @@ -24,7 +24,7 @@ classes: - The promiser is automatically canonified when classes are defined. - Classes are not automatically canonified when checked. -[%CFEngine_include_example(class-automatic-canonificiation.cf)%] +{{< CFEngine_include_example(class-automatic-canonificiation.cf) >}} - The term ```class``` and ```context``` are sometimes used interchangeably. - The following attributes to make a complete promise. diff --git a/content/reference/promise-types/commands.markdown b/content/reference/promise-types/commands.markdown index 8ce78f216..4b9db6759 100644 --- a/content/reference/promise-types/commands.markdown +++ b/content/reference/promise-types/commands.markdown @@ -90,7 +90,7 @@ continue. ## Attributes -[%CFEngine_include_markdown(common-attributes.include.markdown)%] +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### args @@ -435,7 +435,7 @@ be useful in all cases. **Example:** -[%CFEngine_include_example(inform.cf)%] +{{< CFEngine_include_example(inform.cf) >}} **History:** diff --git a/content/reference/promise-types/databases.markdown b/content/reference/promise-types/databases.markdown index 70f7fb08d..d9331938c 100644 --- a/content/reference/promise-types/databases.markdown +++ b/content/reference/promise-types/databases.markdown @@ -145,7 +145,7 @@ a hierarchy of depth 1. ## Attributes -[%CFEngine_include_markdown(common-attributes.include.markdown)%] +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### database_server diff --git a/content/reference/promise-types/defaults.markdown b/content/reference/promise-types/defaults.markdown index 544792a32..8b74c97c1 100644 --- a/content/reference/promise-types/defaults.markdown +++ b/content/reference/promise-types/defaults.markdown @@ -103,4 +103,4 @@ with the default value. **Example:** -[%CFEngine_include_example(defaults.cf)%] +{{< CFEngine_include_example(defaults.cf) >}} diff --git a/content/reference/promise-types/files/_index.markdown b/content/reference/promise-types/files/_index.markdown index f7290245e..7dc591e03 100644 --- a/content/reference/promise-types/files/_index.markdown +++ b/content/reference/promise-types/files/_index.markdown @@ -316,7 +316,7 @@ alter such a socket. This is a known issue, documented in ## Attributes -[%CFEngine_include_markdown(common-attributes.include.markdown)%] +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### acl @@ -538,7 +538,7 @@ acl_directory_inherit. **Description:** Defines whether the object inherits its ACL from its parent. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **Notes:** This attribute has an effect only on Windows. @@ -1116,11 +1116,11 @@ When set to `true` if the promise is a remote copy and there is a failure to connect the promise will not be considered kept. If the agent is able to request the file and the file is missing the promise will be kept. -[%CFEngine_promise_attribute(false)%] +{{< CFEngine_promise_attribute(false) >}} **Example:** -[%CFEngine_include_example(missing_ok.cf)%] +{{< CFEngine_include_example(missing_ok.cf) >}} **Notes:** @@ -1231,7 +1231,7 @@ preserve => "true"; **Description:** Defines the protocol to use for the outgoing connection in this copy operation. -[%CFEngine_promise_attribute(classic)%] +{{< CFEngine_promise_attribute(classic) >}} **Note:** The value here will override the setting from [`body common control`][body common]. @@ -1398,7 +1398,7 @@ verify => "true"; **Example:** -[%CFEngine_include_example(files_content.cf)%] +{{< CFEngine_include_example(files_content.cf) >}} **History:** Was introduced in 3.16.0 @@ -1587,7 +1587,7 @@ promise the same attributes as the files inside it. `rmdirs` in `delete` bodies **Example:** -[%CFEngine_include_example(files_depth_search_include_basedir.cf)%] +{{< CFEngine_include_example(files_depth_search_include_basedir.cf) >}} **See also:** `rm_rf`, `rm_rf_depth` from the standard library. @@ -2021,7 +2021,7 @@ bundle agent example -[%CFEngine_include_example(template_method-inline_mustache.cf)%] +{{< CFEngine_include_example(template_method-inline_mustache.cf) >}} **History:** Was introduced in 3.12.0 @@ -2452,7 +2452,7 @@ regular fifo ``` -[%CFEngine_promise_attribute(cfengine)%] +{{< CFEngine_promise_attribute(cfengine) >}} ### link_from @@ -2498,11 +2498,11 @@ them to the source. **Example implementation:** -[%CFEngine_include_snippet(masterfiles/lib/files.cf, ^body\slink_from\slinkchildren.*, ^##)%] +{{< CFEngine_include_snippet(masterfiles/lib/files.cf, ^body\slink_from\slinkchildren.*, ^##) >}} **Example usage:** -[%CFEngine_include_example(symlink_children.cf)%] +{{< CFEngine_include_example(symlink_children.cf) >}} #### link_type @@ -2535,7 +2535,7 @@ absolute **Example impelementation:** -[%CFEngine_include_snippet(masterfiles/lib/files.cf, ^body\slink_from\sln_s.*, ^##)%] +{{< CFEngine_include_snippet(masterfiles/lib/files.cf, ^body\slink_from\sln_s.*, ^##) >}} ```cf3 body link_from example { @@ -2546,7 +2546,7 @@ source => "/tmp/source"; **Example usage:** -[%CFEngine_include_example(symlink.cf)%] +{{< CFEngine_include_example(symlink.cf) >}} **Notes:** On Windows, hard links are the only supported type. @@ -2908,7 +2908,7 @@ specified in `mode`. **Example:** -[%CFEngine_include_example(rxdirs.cf)%] +{{< CFEngine_include_example(rxdirs.cf) >}} **See also:** `mode` @@ -3073,7 +3073,7 @@ files: **Description:** The data container to be passed to the template (Mustache or inline_mustache). It can come from a function call like `mergedata()` or from a data container reference like `@(mycontainer)`. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} **Example:** @@ -3115,7 +3115,7 @@ state in Mustache. By default `cfengine` requests the native CFEngine template implementation, but you can use `mustache` or `inline_mustache` as well. -[%CFEngine_promise_attribute(cfengine)%] +{{< CFEngine_promise_attribute(cfengine) >}} #### template_method cfengine @@ -3216,7 +3216,7 @@ for `inline_mustache` and `mustache`. For mustache explanation see -[%CFEngine_include_example(template_method-inline_mustache.cf)%] +{{< CFEngine_include_example(template_method-inline_mustache.cf) >}} **History:** Was introduced in 3.12.0 @@ -3258,7 +3258,7 @@ HTML, use the triple mustache: ```{{{name}}}``` or an ampersand A variable "miss" returns an empty string. -[%CFEngine_include_example(mustache_variables.cf)%] +{{< CFEngine_include_example(mustache_variables.cf) >}} ##### template_method mustache Sections @@ -3275,18 +3275,18 @@ The behavior of the section is determined by the value of the key. If the key exists and has a value of false or an empty list, the HTML between the pound and slash will not be displayed. -[%CFEngine_include_example(mustache_sections_empty_list.cf)%] +{{< CFEngine_include_example(mustache_sections_empty_list.cf) >}} **Non-Empty Lists:** -[%CFEngine_include_example(mustache_sections_non_empty_list.cf)%] +{{< CFEngine_include_example(mustache_sections_non_empty_list.cf) >}} **Non-False Values:** When the value is non-false but not a list, it will be used as the context for a single rendering of the block. -[%CFEngine_include_example(mustache_sections_non_false_value.cf)%] +{{< CFEngine_include_example(mustache_sections_non_false_value.cf) >}} ##### template_method mustache Inverted Sections @@ -3299,20 +3299,20 @@ of the key, inverted sections may render text once based on the inverse value of the key. That is, they will be rendered if the key doesn't exist, is false, or is an empty list. -[%CFEngine_include_example(mustache_sections_inverted.cf)%] +{{< CFEngine_include_example(mustache_sections_inverted.cf) >}} ##### template_method mustache Comments Comments begin with a bang and are ignored. Comments may contain newlines. -[%CFEngine_include_example(mustache_comments.cf)%] +{{< CFEngine_include_example(mustache_comments.cf) >}} ##### template_method mustache Set Delimiter Set Delimiter tags start with an equal sign and change the tag delimiters from ```{{``` and ```}}``` to custom strings. -[%CFEngine_include_example(mustache_set_delimiters.cf)%] +{{< CFEngine_include_example(mustache_set_delimiters.cf) >}} ##### template_method mustache extensions @@ -3322,22 +3322,22 @@ The following are **CFEngine-specific extensions**. over the top level of a container `{{#-top-}} ... {{/-top-}}` and rendering json representation of data given with `$` and `%`. -[%CFEngine_include_example(mustache_extension_top.cf)%] +{{< CFEngine_include_example(mustache_extension_top.cf) >}} `%` variable prefix causing data to be rendered as multi-line json representation. Like output from `storejson()`. -[%CFEngine_include_example(mustache_extension_multiline_json.cf)%] +{{< CFEngine_include_example(mustache_extension_multiline_json.cf) >}} `$` variable prefix causing data to be rendered as compact json representation. Like output from `format()` with the ```%S``` format string. -[%CFEngine_include_example(mustache_extension_compact_json.cf)%] +{{< CFEngine_include_example(mustache_extension_compact_json.cf) >}} `@` expands the current key being iterated to complement the value as accessed with `.`. -[%CFEngine_include_example(mustache_extension_expand_key.cf)%] +{{< CFEngine_include_example(mustache_extension_expand_key.cf) >}} **See also:** `edit_template`, `template_data`, `datastate()` @@ -3396,7 +3396,7 @@ something else. **Example:** -[%CFEngine_include_example(files_transformer.cf)%] +{{< CFEngine_include_example(files_transformer.cf) >}} In the example, the promise is made on the file that we wish to transform. If the promised file exists, the transformer will change the file to a compressed diff --git a/content/reference/promise-types/files/edit_line/_index.markdown b/content/reference/promise-types/files/edit_line/_index.markdown index b8e7b3f15..d1f640d6c 100644 --- a/content/reference/promise-types/files/edit_line/_index.markdown +++ b/content/reference/promise-types/files/edit_line/_index.markdown @@ -177,15 +177,15 @@ selected for editing. Prepare: -[%CFEngine_include_snippet(select_region.cf, #\+begin_src\s+prep, .*end_src)%] +{{< CFEngine_include_snippet(select_region.cf, #\+begin_src\s+prep, .*end_src) >}} Run: -[%CFEngine_include_snippet(select_region.cf, #\+begin_src\s+cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(select_region.cf, #\+begin_src\s+cfengine3, .*end_src) >}} Output: -[%CFEngine_include_snippet(select_region.cf, #\+begin_src\s+example_output\s*, .*end_src)%] +{{< CFEngine_include_snippet(select_region.cf, #\+begin_src\s+example_output\s*, .*end_src) >}} **See also:** [Common body attributes][Promise types#Common body attributes] diff --git a/content/reference/promise-types/files/edit_xml/_index.markdown b/content/reference/promise-types/files/edit_xml/_index.markdown index 2c1700482..adcec3770 100644 --- a/content/reference/promise-types/files/edit_xml/_index.markdown +++ b/content/reference/promise-types/files/edit_xml/_index.markdown @@ -37,7 +37,7 @@ will be verified and built BEFORE other `edit_xml` promises within same promise body. Therefore, the file will not be empty during the execution of such promises. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} ### select_xpath @@ -46,4 +46,4 @@ of such promises. Edits to the XML document take place within the selected node. This attribute is not used when inserting XML content into an empty file. -[%CFEngine_promise_attribute()%] +{{< CFEngine_promise_attribute() >}} diff --git a/content/reference/promise-types/guest_environments.markdown b/content/reference/promise-types/guest_environments.markdown index deafb8a9a..107597279 100644 --- a/content/reference/promise-types/guest_environments.markdown +++ b/content/reference/promise-types/guest_environments.markdown @@ -50,7 +50,7 @@ CFEngine currently provides a convergent interface to *libvirt*. ## Attributes -[%CFEngine_include_markdown(common-attributes.include.markdown)%] +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### environment_host diff --git a/content/reference/promise-types/methods.markdown b/content/reference/promise-types/methods.markdown index dfe58c59d..6f68bee6a 100644 --- a/content/reference/promise-types/methods.markdown +++ b/content/reference/promise-types/methods.markdown @@ -100,7 +100,7 @@ Here's a full example of how you might encode bundle names and parameters in a slist, if you need to pack and unpack method calls in a portable (e.g. written in a file) format. -[%CFEngine_include_snippet(unpack_method_calls.cf, #\+begin_src cfengine3, .*end_src)%] +{{< CFEngine_include_snippet(unpack_method_calls.cf, #\+begin_src cfengine3, .*end_src) >}} Output: @@ -114,7 +114,7 @@ Output: ## Attributes -[%CFEngine_include_markdown(common-attributes.include.markdown)%] +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### inherit diff --git a/content/reference/promise-types/packages-deprecated.markdown b/content/reference/promise-types/packages-deprecated.markdown index 7d696f57f..f5cbd4a1d 100644 --- a/content/reference/promise-types/packages-deprecated.markdown +++ b/content/reference/promise-types/packages-deprecated.markdown @@ -231,7 +231,7 @@ does not come with package bodies for that platform. ## Attributes -[%CFEngine_include_markdown(common-attributes.include.markdown)%] +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### package_architectures diff --git a/content/reference/promise-types/packages.markdown b/content/reference/promise-types/packages.markdown index eb085b288..81e72d21b 100644 --- a/content/reference/promise-types/packages.markdown +++ b/content/reference/promise-types/packages.markdown @@ -91,7 +91,7 @@ string needs to be a bare package name, you cannot use a file name for this. ## Attributes -[%CFEngine_include_markdown(common-attributes.include.markdown)%] +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### architecture diff --git a/content/reference/promise-types/processes.markdown b/content/reference/promise-types/processes.markdown index 5931bc89b..2e1d4caa7 100644 --- a/content/reference/promise-types/processes.markdown +++ b/content/reference/promise-types/processes.markdown @@ -53,7 +53,7 @@ bundle agent example This example shows using `process_select` and `process_count` to define a class when a process has been running for longer than a day. -[%CFEngine_include_example(processes_define_class_based_on_process_runtime.cf)%] +{{< CFEngine_include_example(processes_define_class_based_on_process_runtime.cf) >}} Take care to not oversimplify your patterns as it may match unexpected processes. For example, on many systems, the process pattern `"^cp"` @@ -90,7 +90,7 @@ commands: ## Attributes -[%CFEngine_include_markdown(common-attributes.include.markdown)%] +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### process_count @@ -291,7 +291,7 @@ regex is [anchored][anchored], meaning it must match the entire name. **Example:** -[%CFEngine_include_example(kill_process_running_wrong_user.cf)%] +{{< CFEngine_include_example(kill_process_running_wrong_user.cf) >}} #### process_result diff --git a/content/reference/promise-types/reports.markdown b/content/reference/promise-types/reports.markdown index e67e56e98..206c7143e 100644 --- a/content/reference/promise-types/reports.markdown +++ b/content/reference/promise-types/reports.markdown @@ -8,7 +8,7 @@ qualification can be a dangerous operation. In a large installation it could unleash an avalanche of messaging, so it is recommended that reports are guarded appropriately. -[%CFEngine_include_example(reports.cf)%] +{{< CFEngine_include_example(reports.cf) >}}