# CFEngine docs > CFEngine 3.27 documentation: installation, policy language reference, Masterfiles Policy Framework, Mission Portal and Enterprise API. ## Pages - [Home](/index.md) - [Search](/search/index.md) - [Versions](/versions/index.md): Following versions are available in CFEngine docs. master 3.28 (non-LTS) 3.27 (LTS) 3.26 (non-LTS) 3.25 (EOL non-LTS) … ## API - [API](/api/index.md) - [Actions API](/api/enterprise-api-ref/actions-api/index.md): Actions API enables you to perform specific actions such a requesting report collection. Report collection You can … - [AI chat API](/api/enterprise-api-ref/ai-chat/index.md): The AI chat API converts natural language questions into SQL queries for running custom reports. Send message to AI chat … - [AI settings API](/api/enterprise-api-ref/ai-settings/index.md): The AI settings API allows you to configure and manage LLM configurations for the AI chat. List AI settings URI: … - [Audit log API](/api/enterprise-api-ref/audit-logs-api/index.md): Audit log API provides access to system audit logs that track user actions across the platform made to critical parts … - [Autocomplete API](/api/enterprise-api-ref/autocomplete/index.md): The Autocomplete API provides search functionality for CFEngine classes and variables. Search classes Searches for … - [Browsing host information](/api/enterprise-api-examples/browsing-host-information/index.md): A resource /api/host is added as an alternative interface for browsing host information. For full flexibility we … - [Build API](/api/enterprise-api-ref/build-api/index.md): The Build API enables you to easily manage policy projects and their respective CFEngine Build modules. Projects API A … - [cfdb](/api/enterprise-api-ref/sql-schema/cfdb/index.md): CFEngine allows standardized SQL SELECT queries to be used with REST API. Queries can be used with following database … - [cfmp](/api/enterprise-api-ref/sql-schema/cfmp/index.md): This database contains Mission Portal related settings not processed by the API. Table: app Information about Mission … - [cfsettings](/api/enterprise-api-ref/sql-schema/cfsettings/index.md): Settings used by Mission Portal APIs, no reported data. Table: audit_log Stores system logs about actions performed by … - [Changes REST API](/api/enterprise-api-ref/changes/index.md): Changes API allows to track changes performed by CFEngine agent in the infrastructure. Count changes performed by agent … - [Checking status](/api/enterprise-api-examples/checking-status/index.md): You can get basic info about the API by issuing /api. This status information may also be useful if you contact support, … - [CMDB API](/api/enterprise-api-ref/cmdb-api/index.md): The configuration management database (CMDB) API v2 enables you to manage configuration entries for specific hosts. Get … - [Federated reporting configuration API](/api/enterprise-api-ref/federated-reporting-api/index.md): This API is used for configuring hubs so that a single hub can be used to report on any host connected to participating … - [File changes API](/api/enterprise-api-ref/file-changes/index.md): File changes statistics URI: https://hub.cfengine.com/api/file-changes/statistics?fromTime=:fromTime&toTime=:toTime … - [Fist time setup API](/api/enterprise-api-ref/first-time-setup/index.md): The First time setup API enables creation of the initial administrator user. This API is only accessible when the system … - [Health diagnostic API](/api/enterprise-api-ref/health-diagnostic/index.md): This API provides access to health diagnostic information. Get health diagnostic status URI: … - [Host REST API](/api/enterprise-api-ref/host/index.md): Host API allows to access host specific information. List hosts URI: https://hub.cfengine.com/api/host Method: GET … - [Import & export API](/api/enterprise-api-ref/export-import-api/index.md): Import & export API provides users the ability to transfer Mission Portal data between hubs. See also: Export/import … - [Import & export compliance report API](/api/enterprise-api-ref/export-import-compliance-report-api/index.md): This provides users the ability to transfer compliance reports between hubs or create reports from a JSON definition … - [Inventory API](/api/enterprise-api-ref/inventory/index.md): Inventory API allows to access inventory reports and attributes dictionary. Inventory reports URI: … - [LDAP authentication API](/api/enterprise-api-ref/ldap-api/index.md): LDAP authentication API allows to check ldap user credentials and change LDAP settings. Login URI: … - [Managing settings](/api/enterprise-api-examples/managing-settings/index.md): Settings support two operations, GET (view settings) and POST (update settings). When settings are updated, they are … - [Managing users and roles](/api/enterprise-api-examples/managing-users-and-roles/index.md): Users and Roles determine who has access to what data from the API. Roles are defined by regular expressions that … - [Personal groups API](/api/enterprise-api-ref/personal-groups/index.md): The personal groups API enables creating host groups based on host filters (the same ones used in inventory reports). … - [Query REST API](/api/enterprise-api-ref/query/index.md): In case of a need for full flexibility, Query API allow users to execute SQL queries on CFEngine Database. Database … - [Reset password API](/api/enterprise-api-ref/reset-password/index.md): Request reset password link and token This call initiates the password reset process by sending a reset password link … - [Shared groups API](/api/enterprise-api-ref/shared-groups/index.md): The shared groups API enables creating host groups based on host filters (the same ones used in inventory) and assigning … - [SQL query examples](/api/enterprise-api-examples/sql-queries/index.md): Synchronous Example: Listing hostname and IP for Ubuntu hosts Request: curl -k --user admin:admin … - [SSH keys API](/api/enterprise-api-ref/ssh-keys-api/index.md): The SSH keys API enables you to generate a key pair that can be used for authorization. SSH keys API Generate SSH key … - [Status and settings REST API](/api/enterprise-api-ref/status-settings/index.md): REST API for managing settings, checking hub status. Get server status URI: https://hub.cfengine.com/api Method: GET … - [Tracking changes](/api/enterprise-api-examples/changes-api-usage/index.md): Changes REST API allows to track the changes made by cf-agent in the infrastructure. Example: Count changes This … - [Two-factor authentication API](/api/enterprise-api-ref/two-factor-authentication/index.md): The Two-factor authentication API enables users to add an extra layer of security to their accounts by requiring a TOTP … - [Users and access-control REST API](/api/enterprise-api-ref/users-rbac/index.md): This REST API allows to manage users allowed to use Mission Portal as also Role Based Access Control settings. List … - [VCS settings API](/api/enterprise-api-ref/vcs-settings/index.md): VCS API for managing version control repository settings. Get VCS settings URI: … - [Web RBAC API](/api/enterprise-api-ref/web-rbac/index.md): Web RBAC API for managing role based access control settings. Get all permissions list URI: … ## Examples and tutorials - [Examples and tutorials](/examples/index.md) - [Aborting execution](/examples/example-snippets/promise-patterns/example_aborting_execution/index.md): Sometimes it is useful to abort a bundle execution if certain conditions are not met, for example when validating input … - [Administration examples](/examples/example-snippets/cfengine-administration/index.md): Ordering promises Aborting execution Ordering promises This counts to five by default. If we change ‘/bin/echo … - [Authoring policy tools & workflow](/examples/tutorials/policy-writing/authoring-policy-tools-and-workflow/index.md): There are several ways to approach authoring promises and ensuring they are copied into and then deployed properly from … - [Bundles best practices](/examples/tutorials/policy-writing/bundles-best-practices/index.md): The following contains practices to remember when creating bundles as you write policy. How to choose and name bundles … - [Change detection](/examples/example-snippets/promise-patterns/example_change_detection/index.md): This policy will look for changes recursively in a directory. body common control { bundlesequence => { … - [Check filesystem space](/examples/example-snippets/promise-patterns/example_diskfree/index.md): Check how much space (in KB) is available on a directory’s current partition. body common control { bundlesequence … - [Command-Line reports](/examples/tutorials/reporting/command-line-reports/index.md): Command-line reporting is available to Enterprise and Community users. Overview The following report topics are … - [Commands, scripts, and execution examples](/examples/example-snippets/commands-scripts-execution/index.md): Command or script execution Change directory for command Commands example Execresult example Methods Method validation … - [Controlling frequency](/examples/tutorials/policy-writing/controlling-frequency/index.md): By default CFEngine runs relatively frequently (every 5 minutes) but you may not want every promise to be evaluated each … - [Copy single files](/examples/example-snippets/promise-patterns/example_copy_single_files/index.md): This is a standalone policy example that will copy single files, locally (local_cp) and from a remote site (secure_cp). … - [Create files and directories](/examples/example-snippets/promise-patterns/example_create_filedir/index.md): The following is a standalone policy that will create the file /home/mark/tmp/test_plain and the directory … - [Custom inventory](/examples/tutorials/custom_inventory/index.md): This tutorial will show you how to add custom inventory attributes that can be leveraged in policy and reported on in … - [Customize message of the day](/examples/example-snippets/promise-patterns/example_edit_motd/index.md): The Message of the Day is displayed when you log in or connect to a server. It typically shows information about the … - [Dashboard alerts](/examples/tutorials/dashboard-alerts/index.md): At 5 minutes intervals, the CFEngine hub gathers information from all of its connected agents about the current state of … - [Database examples](/examples/example-snippets/database/index.md): Database creation Database creation body common control { bundlesequence => { "dummy" }; } body knowledge … - [Distribute ssh keys](/examples/example-snippets/promise-patterns/example_ssh_keys/index.md): This example shows a simple ssh key distribution implementation. The policy was designed to work with the … - [Distributing files from a central location](/examples/tutorials/distribute-files-from-a-central-location/index.md): CFEngine can manage many machines simply by distributing policy files to all its hosts. This tutorial describes how to … - [Editors](/examples/tutorials/policy-writing/editors/index.md): Using an editor that provides syntax highlighting and other features can significantly enhance prodcutivity and quality … - [Ensure a process is not running](/examples/example-snippets/promise-patterns/example_process_kill/index.md): This is a standalone policy that will kill the sleep process. You can adapt it to make sure that any undesired process … - [Ensure a service is enabled and running](/examples/example-snippets/promise-patterns/example_enable_service/index.md): This example shows how to ensure services are started or stopped appropriately. body file control { inputs => { … - [External data](/examples/tutorials/policy-writing/external_data/index.md): It is common to integrate CFEngine with external data sources. External data sources could be hand edited data files, … - [File and directory examples](/examples/example-snippets/basic-file-directory/index.md): Create files and directories Copy single files Copy directory trees Disabling and rotating files Add lines to a file … - [File comparison](/examples/tutorials/file_comparison/index.md): Add the policy contents (also can be downloaded from file_compare_test.cf) to a new file, such as … - [File editing](/examples/tutorials/files-tutorial/index.md): Prerequisites Read the tutorial Tutorial for running examples Ensure you have read and understand the section on how to … - [File permissions](/examples/example-snippets/file_permissions/index.md): ACL file example body common control { bundlesequence => { "acls" }; } bundle agent acls { files: … - [Find the MAC address](/examples/example-snippets/promise-patterns/example_find_mac_addr/index.md): Finding the ethernet address can vary between operating systems. We will use CFEngine’s built in function … - [General examples](/examples/example-snippets/general/index.md): Basic example Hello world Array example Basic example To get started with CFEngine, you can imagine the following … - [Install packages](/examples/example-snippets/promise-patterns/example_install_package/index.md): Install desired packages. body common control { bundlesequence => { "install_packages" }; inputs => { … - [Installation guide](/examples/tutorials/high-availability/installation-guide/index.md): Overview This tutorial is describing the installation steps of the CFEngine High availability feature. It is suitable … - [Installing CFEngine Enterprise agent](/examples/tutorials/installing-cfengine-enterprise-agent/index.md): This is the full version of CFEngine Enterprise host, but the number of hosts is limited to 25. NOTE: Please make sure … - [Integrating alerts with PagerDuty](/examples/tutorials/integrating-alerts-with-pager-duty/index.md): In this How To tutorial we will show you can integrate with PagerDuty using the CFEngine notification dashboard. We will … - [Integrating alerts with ticketing systems](/examples/tutorials/integrating-alerts-with-ticketing-systems/index.md): Custom actions can be used to integrate with external 3rd party systems. This tutorial shows how to use a custom action … - [Integrating with Sumo Logic](/examples/tutorials/integrating-with-sumo-logic/index.md): In this How To we will show a simple integrate with Sumo Logic. Whenever there is a CFEngine policy update, that event … - [Interacting with directory services](/examples/example-snippets/active_directory/index.md): Active directory example bundle agent active_directory { vars: # NOTE: Edit this to your domain, e.g. "corp", … - [Introduction to policy writing](/examples/tutorials/policy-writing/introduction-to-policy-writing/index.md): To define new Desired States in CFEngine, you need to write policy files. These are plain text-files, traditionally with … - [JSON and YAML support in CFEngine](/examples/tutorials/json-yaml-support-in-cfengine/index.md): Introduction JSON is a well-known data language. It even has a specification (See http://json.org). YAML is another … - [Layers of abstraction in policy](/examples/tutorials/policy-writing/policy-layers-abstraction/index.md): CFEngine offers a number of layers of abstraction. The most fundamental atom in CFEngine is the promise. Promises can be … - [Managing local users](/examples/tutorials/manage-local-users/index.md): In this tutorial we will show how to use CFEngine to manage users, add them to groups, setup their home directory and … - [Managing network time protocol](/examples/tutorials/manage-ntp/index.md): In this tutorial we will write a simple policy to ensure that the latest version of the NTP service is installed on your … - [Managing processes and services](/examples/tutorials/manage-processes-and-services/index.md): Ensuring a particular process is running on a system is a common task for a system administrator, as processes are what … - [Masterfiles Policy Framework upgrade](/examples/tutorials/masterfiles_policy_framework_upgrade/index.md): Upgrading the Masterfiles Policy Framework (MPF) is the first step in upgrading CFEngine from one version to another. … - [Measuring examples](/examples/example-snippets/timing-counting-measuring/index.md): Measurements Measurements body common control { bundlesequence => { "report" }; } body monitor control { … - [Monitoring and reporting](/examples/tutorials/reporting/monitoring-reporting/index.md): What are monitoring and reporting? Monitoring is the sampling of system variables at regular intervals in order to … - [Mount NFS filesystem](/examples/example-snippets/promise-patterns/example_mount_nfs/index.md): Mounting an NFS filesystem is straightforward using CFEngine’s storage promises. The following bundle specifies … - [Network examples](/examples/example-snippets/network/index.md): Find MAC address Client-server example Read from a TCP socket Set up a PXE boot server Resolver management Mount NFS … - [Package management](/examples/tutorials/manage-packages/index.md): Package management is a critical task for any system administrator. In this tutorial we will show you how easy it is to … - [Policy style guide](/examples/tutorials/policy-writing/policy-style/index.md): Style is a very personal choice and the contents of this guide should only be considered suggestions. We invite you to … - [Policy writing with cfbs](/examples/tutorials/policy-writing/policy-writing-with-cfbs/index.md): In this tutorial we will show how to write and run CFEngine policy for someone already using cfbs and cf-remote. To … - [Promise type module development](/examples/tutorials/promise-type-module-development/index.md): Promise type modules are easy to write. In this tutorial, we will focus on implementing a new promise type in Python, … - [Promises available in CFEngine](/examples/tutorials/policy-writing/promises-available-in-cfengine/index.md): meta - information about promise bundles Meta-data promises have no internal function. They are intended to be used to … - [Rendering files with Mustache templates](/examples/tutorials/render-files-with-mustache-templates/index.md): In this tutorial we will show how to use CFEngine to manage file configurations using mustache templating. How it works … - [Reporting and remediation of security vulnerabilities](/examples/tutorials/report_inventory_remediate_sec_vulnerabilities/index.md): Prerequisites CFEngine 3.6 Enterprise Hub At least one client vulnerable to CVE-2014-6271 Overview Remediating security … - [Restart a process](/examples/example-snippets/promise-patterns/example_process_restart/index.md): This is a standalone policy that will restart three CFEngine processes if they are not running. body common control { … - [Set up name resolution with DNS](/examples/example-snippets/promise-patterns/example_edit_name_resolution/index.md): There are many ways to configure name resolution. A simple and straightforward approach is to implement this as a simple … - [Set up sudo](/examples/example-snippets/promise-patterns/example_sudoers/index.md): Setting up sudo is straightforward, we recommend managing it by copying trusted files from a repository. The following … - [Set up time management through NTP](/examples/example-snippets/promise-patterns/example_ntp/index.md): The following sets up a local NTP server that synchronizes with pool.ntp.org and clients that synchronize with your … - [Software administration examples](/examples/example-snippets/software-adminstration/index.md): Software and patch installation Postfix mail configuration Set up a web server Add software packages to the system … - [System administration examples](/examples/example-snippets/system-administration/index.md): Centralized management These examples show a simple setup for starting with a central approach to management of servers. … - [System file examples](/examples/example-snippets/system-file/index.md): Editing password or group files To change the password of a system, we need to edit a file. A file is a complex object - … - [System information examples](/examples/example-snippets/system-information/index.md): Change detection Hashing for change detection (tripwire) Check filesystem space Class match example Global classes … - [System security examples](/examples/example-snippets/system-security/index.md): Distribute root passwords Distribute ssh keys Distribute ssh keys Distribute root passwords body common control { … - [Tags for variables, classes, and bundles](/examples/tutorials/tags/index.md): Introduction meta tags can be attached to any promise type using the meta attribute. These tags are useful for … - [Testing policy](/examples/tutorials/policy-writing/testing-policy/index.md): One of the practical advantages of CFEngine is that you can test it without the need for root or administrator … - [Updating from a central policy server](/examples/example-snippets/promise-patterns/example_updating_from_central_hub/index.md): This is a conceptual example without any test policy associated with it. The default policy shipped with CFEngine … - [User management examples](/examples/example-snippets/user-management/index.md): Local user management There are many approaches to managing users. You can edit system files like /etc/passwd directly, … - [Using CFEngine Build command line tools - cfbs](/examples/tutorials/cfbs/index.md): In this tutorial, we’ll take a look at how to work with CFEngine Build projects from the command line. We assume … - [Windows registry examples](/examples/example-snippets/windows-registry/index.md): Windows registry unit_registry_cache.cf unit_registry.cf Windows registry body common control { bundlesequence => { … ## Getting started - [Getting started](/getting-started/index.md) - [Adding modules](/getting-started/03-adding-modules/index.md): Now that you’ve installed CFEngine, and used the Web UI a bit, let’s take a look at extending it with … - [Installation overview](/getting-started/01-installing-cfengine/installation-overview/index.md): Installation There are several steps to bring up a CFEngine installation within an organization: Prepare all appropriate … - [Installing Community](/getting-started/01-installing-cfengine/general-installation/installation-community/index.md): These instructions describe how to download and install the latest version of CFEngine Community using pre-compiled rpm … - [Installing Community Using Containers](/getting-started/01-installing-cfengine/general-installation/installation-community-containerized/index.md): The instructions in this guide describe how to download and install the latest version of CFEngine Community in a Docker … - [Installing Enterprise 25 Free](/getting-started/01-installing-cfengine/general-installation/installation-enterprise-free/index.md): These instructions describe how to install the latest version of CFEngine Enterprise 25 Free. This is the full version … - [Installing Enterprise for production](/getting-started/01-installing-cfengine/general-installation/installation-enterprise/index.md): These instructions describe how to install the latest version of CFEngine Enterprise in a production environment using … - [Installing Enterprise on CoreOS](/getting-started/01-installing-cfengine/general-installation/installation-coreos/index.md): These instructions describe how to install the latest version of CFEngine Enterprise on CoreOS. The CoreOS package uses … - [Installing from binary tarball](/getting-started/01-installing-cfengine/general-installation/installation-enterprise-generic-tarball/index.md): Not all systems come with a package manager. For these systems you can install CFEngine by means of a generic binary … - [Local virtual machine](/getting-started/01-installing-cfengine/local-virtual-machine/index.md): This short tutorial shows you how to set up a Linux Virtual Machine locally, if you prefer this over creating an account … - [Quick-Start guide to using PuTTY](/getting-started/01-installing-cfengine/pre-installation-checklist/putty-quick-start-guide/index.md): Using PuTTY in simple steps Accessing AWS virtual machines via SSH on Windows using PuTTY and PuTTYgen Using PuTTY in … - [Quick-Start guide to using vi](/getting-started/01-installing-cfengine/pre-installation-checklist/vi-quick-start-guide/index.md): This guide is designed for the novice user of CFEngine tutorials-and will introduce the basic use of a powerful tool … - [Secure bootstrap](/getting-started/01-installing-cfengine/secure-bootstrap/index.md): This guide assumes you already have a working CFEngine hub (installed and bootstrapped), and you have installed CFEngine … - [Upgrading](/getting-started/01-installing-cfengine/upgrading/index.md): This guide documents our recommendation on how to upgrade an existing installation of CFEngine Enterprise to 3.27. … - [Using Amazon Web Services](/getting-started/01-installing-cfengine/general-installation/installation-enterprise-free-aws-rhel/index.md): This guide describes how to install CFEngine on two Red Hat® Enterprise Linux® (RHEL) virtual machines using Amazon Web … - [Using the Web UI](/getting-started/02-using-the-web-ui/index.md): After setting up your CFEngine Hub, adding modules and deploying your first policy set, it’s appropriate to get … - [Using Vagrant](/getting-started/01-installing-cfengine/general-installation/installation-enterprise-vagrant/index.md): The CFEngine Enterprise Vagrant Environment provides an easy way to test and explore CFEngine Enterprise. This guide … - [Verifying package signatures](/getting-started/01-installing-cfengine/pre-installation-checklist/verify-signatures/index.md): On the Download CFEngine, you will find sha256 checksums of all downloadable files which you can verify by using the … - [Version control](/getting-started/01-installing-cfengine/version-control/index.md): By default, CFEngine policy is published from /var/cfengine/masterfiles on the policy server. It is recommended that … ## Overview - [Overview](/overview/index.md) - [CFEngine directory structure](/overview/directory-structure/index.md): The CFEngine application is fully contained within the /var/cfengine directory tree. Here is a quick breakdown of the … - [Client server communication](/overview/client-server-communication/index.md): Starting cf-serverd sets up a line of communication between hosts. This daemon authenticates requests from the network … - [Glossary](/overview/glossary/index.md): Agent A piece of software that runs independently and automatically to carry out a task (think software robot). In … - [How CFEngine works](/overview/how-cfengine-works/index.md): CFEngine is a fully distributed system that allows you to define desired states of everything from very large-scale … - [What is CFEngine and why?](/overview/what-is-cfengine-and-why/index.md): What is CFEngine? CFEngine is a software solution that helps system administrators and other stakeholders in the IT … ## Reference - [Reference](/reference/index.md) - [.no-distrib/](/reference/masterfiles-policy-framework/no-distrib/index.md): This directory is excluded from policy updates. Place things here that are primarily useful on your policy distribution … - [access](/reference/promise-types/access/index.md): Access promises are conditional promises made by resources living on the server. The promiser is the name of the … - [accessedbefore](/reference/functions/accessedbefore/index.md): Prototype: accessedbefore(newer, older) Return type: boolean Description: Compares the atime fields of two files. Return … - [accumulated](/reference/functions/accumulated/index.md): Prototype: accumulated(years, months, days, hours, minutes, seconds) Return type: int Description: Convert an … - [ago](/reference/functions/ago/index.md): Prototype: ago(years, months, days, hours, minutes, seconds) Return type: int Description: Convert a time relative to … - [All promise and body types](/reference/all-types/index.md): All promise types All body Types All promise types Common attributes action: body action classes: body classes comment: … - [and](/reference/functions/and/index.md): Prototype: and(...) Return type: boolean Description: Returns any if all arguments evaluate to true and !any if any … - [Augments](/reference/language-concepts/augments/index.md): Augments files can be used to define variables and classes for use by all CFEngine components before any parsing or … - [basename](/reference/functions/basename/index.md): Prototype: basename(filename, optional_extension) Return type: string Description: Retrieves the basename of a filename. … - [Bodies](/reference/language-concepts/bodies/index.md): While the idea of a promise is very simple, the definition of a promise can grow complicated. Complex promises are best … - [build_xpath](/reference/promise-types/files/edit_xml/build_xpath/index.md): This promise type assures that a balanced XML tree, described by the given XPath, will be present within the XML file. … - [Bundles](/reference/language-concepts/bundles/index.md): A bundle is a collection of promises. They group related promises together into named, optionally parameterized building … - [bundlesmatching](/reference/functions/bundlesmatching/index.md): Prototype: bundlesmatching(name, tag1, tag2, ...) Return type: slist Description: Return the list of defined bundles … - [bundlestate](/reference/functions/bundlestate/index.md): Prototype: bundlestate(bundlename) Return type: data Description: Returns the current evaluation data state for bundle … - [callstack_callers](/reference/functions/callstack_callers/index.md): Prototype: callstack_callers() Return type: data Description: Return the call stack for the current promise. This is a … - [callstack_promisers](/reference/functions/callstack_promisers/index.md): Prototype: callstack_promisers() Return type: slist Description: Return the promisers along the call stack for the … - [canonify](/reference/functions/canonify/index.md): Prototype: canonify(text) Return type: string Description: Convert an arbitrary string text into a legal class name. … - [canonifyuniquely](/reference/functions/canonifyuniquely/index.md): Prototype: canonifyuniquely(text) Return type: string Description: Convert an arbitrary string text into a unique legal … - [cf_version_after](/reference/functions/cf_version_after/index.md): Prototype: cf_version_after(string) Return type: boolean Description: Returns true if local CFEngine version is newer … - [cf_version_at](/reference/functions/cf_version_at/index.md): Prototype: cf_version_at(string) Return type: boolean Description: Returns true if local CFEngine version is the same as … - [cf_version_before](/reference/functions/cf_version_before/index.md): Prototype: cf_version_before(string) Return type: boolean Description: Returns true if local CFEngine version is older … - [cf_version_between](/reference/functions/cf_version_between/index.md): Prototype: cf_version_between(string, string) Return type: boolean Description: Returns true if local CFEngine version … - [cf_version_maximum](/reference/functions/cf_version_maximum/index.md): Prototype: cf_version_maximum(string) Return type: boolean Description: Returns true if local CFEngine version is the … - [cf_version_minimum](/reference/functions/cf_version_minimum/index.md): Prototype: cf_version_minimum(string) Return type: boolean Description: Returns true if local CFEngine version is newer … - [cf-agent](/reference/components/cf-agent/index.md): cf-agent evaluates policy code and makes changes to the system. Policy bundles are evaluated in the order of the … - [cf-check](/reference/components/cf-check/index.md): The cf-check binary can be used to inspect, dump, diagnose, and repair LMDB databases used by CFEngine. The diagnosis … - [cf-execd](/reference/components/cf-execd/index.md): cf-execd is the scheduling daemon for cf-agent. It runs cf-agent locally according to a schedule specified in policy … - [cf-hub](/reference/components/cf-hub/index.md): cf-hub connects to cf-serverd instances to collect data about a host managed by CFEngine. cf-agent and cf-monitord both … - [cf-key](/reference/components/cf-key/index.md): The CFEngine key generator makes key pairs for remote authentication. Notes: cf-key always considers the class … - [cf-monitord](/reference/components/cf-monitord/index.md): cf-monitord is the monitoring daemon for CFEngine. It samples probes defined in policy using measurements type promises … - [cf-net](/reference/components/cf-net/index.md): cf-net can be used to send simple protocol commands to a policy server. It is a Command-Line-Interface (CLI) to the … - [cf-promises](/reference/components/cf-promises/index.md): cf-promises is a tool for checking CFEngine policy code. It operates by first parsing policy code checking for syntax … - [cf-reactor](/reference/components/cf-reactor/index.md): cf-reactor is the CFEngine event reaction daemon, it lists to NOTIFY events on the cmdb_refresha PostgreSQL channel and … - [cf-runagent](/reference/components/cf-runagent/index.md): cf-runagent connects to a list of running instances of cf-serverd. It allows foregoing the usual cf-execd schedule to … - [cf-secret](/reference/components/cf-secret/index.md): cf-secret encrypts and decrypts files using CFEngine keys. Files can be encrypted for one or more public keys. A … - [cf-serverd](/reference/components/cf-serverd/index.md): cf-serverd is a socket listening daemon providing two services: it acts as a file server for remote file copying and it … - [cf-support](/reference/components/cf-support/index.md): cf-support gathers various details about the system and creates a tarball in the current directory to submit to support. … - [cfe_internal/](/reference/masterfiles-policy-framework/cfe_internal/index.md): This directory contains policy related to the internal control and functioning of CFEngine and its various components. … - [cfe_internal/CFE_cfengine.cf](/reference/masterfiles-policy-framework/cfe_internal-cfe_cfengine/index.md): file bodies control Prototype: control Description: Include policy input dependancies Implementation: body file control … - [cfe_internal/core/](/reference/masterfiles-policy-framework/cfe_internal-core/index.md): This directory contains internal management polcies related to CFEngine Core/Community functionality like log rotation. - [cfe_internal/core/watchdog](/reference/masterfiles-policy-framework/cfe_internal-core-watchdog/index.md): The watchdog implements a process external to CFEngine which is responsible for identifying symptoms of pathology that … - [cfe_internal/core/watchdog/watchdog.cf](/reference/masterfiles-policy-framework/cfe_internal-core-watchdog-watchdog/index.md): agent bundles cfe_internal_core_watchdog Prototype: cfe_internal_core_watchdog(state) Description: Configure external … - [cfe_internal/enterprise/](/reference/masterfiles-policy-framework/cfe_internal-enterprise/index.md): This directory contains internal management polcies related to CFEngine Enterprise functionality like Mission Portal. - [cfe_internal/enterprise/federation/](/reference/masterfiles-policy-framework/cfe_internal-enterprise-federation/index.md): This directory contains assets related to the function and configuration of CFEngine Enterprise Federated reporting. - [cfe_internal/enterprise/federation/federation.cf](/reference/masterfiles-policy-framework/cfe_internal-enterprise-federation-federation/index.md): This policy file handles Federated reporting setup and ongoing operations. file bodies control Prototype: control … - [cfe_internal/recommendations.cf](/reference/masterfiles-policy-framework/cfe_internal-recommendations/index.md): agent bundles mpf_class_recommendations Prototype: mpf_class_recommendations Implementation: bundle agent … - [cfe_internal/update/](/reference/masterfiles-policy-framework/cfe_internal-update/index.md): This directory contains internal management polcies related to the default update policy like ensuring inputs is a copy … - [cfe_internal/update/cfe_internal_dc_workflow.cf](/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_dc_workflow/index.md): agent bundles cfe_internal_dc_workflow Prototype: cfe_internal_dc_workflow Description: Update default policy … - [cfe_internal/update/cfe_internal_update_from_repository.cf](/reference/masterfiles-policy-framework/cfe_internal-update-cfe_internal_update_from_repository/index.md): file bodies control Prototype: control Description: Include policy needed for updating masterfiles, the default policy … - [cfe_internal/update/lib.cf](/reference/masterfiles-policy-framework/cfe_internal-update-lib/index.md): classes bodies u_results Prototype: u_results(scope, class_prefix) Description: Define classes prefixed with … - [cfe_internal/update/systemd_units.cf](/reference/masterfiles-policy-framework/cfe_internal-update-systemd_units/index.md): agent bundles cfe_internal_systemd_unit_files Prototype: cfe_internal_systemd_unit_files Description: This bundle is … - [cfe_internal/update/update_bins.cf](/reference/masterfiles-policy-framework/cfe_internal-update-update_bins/index.md): edit_defaults bodies u_empty_no_backup Prototype: u_empty_no_backup Description: Empty file before editing and create no … - [cfe_internal/update/update_policy.cf](/reference/masterfiles-policy-framework/cfe_internal-update-update_policy/index.md): copy_from bodies u_cmdb_data Prototype: u_cmdb_data Description: Sync CMDB data from policy server Note: Not all hosts … - [cfe_internal/update/update_processes.cf](/reference/masterfiles-policy-framework/cfe_internal-update-update_processes/index.md): classes bodies u_clear_always Prototype: u_clear_always(theclass) Description: Undefine, theclass for as a result of the … - [changedbefore](/reference/functions/changedbefore/index.md): Prototype: changedbefore(newer, older) Return type: boolean Description: Compares the ctime fields of two files. Returns … - [classes](/reference/promise-types/classes/index.md): Classes promises may be made in any bundle. Classes defined by classes type promises in common bundles are namespace … - [Classes and decisions](/reference/language-concepts/classes/index.md): Classes are used to apply promises only to particular environments, depending on context. A promise might only apply to … - [classesmatching](/reference/functions/classesmatching/index.md): Prototype: classesmatching(name, tag1, tag2, ...) Return type: slist Description: Return the list of set classes … - [classfiltercsv](/reference/functions/classfiltercsv/index.md): Prototype: classfiltercsv(filename, has_header, class_column, optional_sort_column) Return type: data Description: … - [classfilterdata](/reference/functions/classfilterdata/index.md): Prototype: classfilterdata(data_container, data_structure, key_or_index) Return type: data Description: This function … - [classify](/reference/functions/classify/index.md): Prototype: classify(text) Return type: boolean Description: Returns whether the canonicalization of text is a currently … - [classmatch](/reference/functions/classmatch/index.md): Prototype: classmatch(regex, tag1, tag2, ...) Return type: boolean Description: Tests whether regex matches any … - [commands](/reference/promise-types/commands/index.md): Commands and processes are separated cleanly. Restarting of processes must be coded as a separate command. This stricter … - [concat](/reference/functions/concat/index.md): Prototype: concat(...) Return type: string Description: Concatenates all arguments into a string. Example: commands: … - [connection](/reference/special-variables/connection/index.md): The context connection is used by the shortcut attribute in access promises to access information about the remote agent … - [const](/reference/special-variables/const/index.md): CFEngine defines a number of variables for embedding unprintable values or values with special meanings in strings. … - [control_agent](/reference/special-variables/control_agent/index.md): Variables in the default:control_agent context are automatically created from attributes defined in body agent control … - [control_common](/reference/special-variables/control_common/index.md): Variables in the default:control_common context are automatically created from attributes defined in body common control … - [control_executor](/reference/special-variables/control_executor/index.md): Variables in the default:control_executor context are automatically created from attributes defined in body executor … - [control_hub](/reference/special-variables/control_hub/index.md): Variables in the default:control_hub context are automatically created from attributes defined in body hub control … - [control_monitor](/reference/special-variables/control_monitor/index.md): Variables in the default:control_monitor context are automatically created from attributes defined in body monitor … - [control_runagent](/reference/special-variables/control_runagent/index.md): Variables in the default:control_runagent context are automatically created from attributes defined in body runagent … - [control_server](/reference/special-variables/control_server/index.md): Variables in the default:control_server context are automatically created from attributes defined in body server control … - [controls/](/reference/masterfiles-policy-framework/controls/index.md): This directory contains policy related to the internal control and functioning of the various CFEngine components. Note: … - [controls/cf_agent.cf](/reference/masterfiles-policy-framework/controls-cf_agent/index.md): This is where body agent control is defined. body agent control is where various settings related to cf-agent can be … - [controls/cf_execd.cf](/reference/masterfiles-policy-framework/controls-cf_execd/index.md): This is where body executor control is defined. body executor control is where various settings related to cf-execd can … - [controls/cf_hub.cf](/reference/masterfiles-policy-framework/controls-cf-hub/index.md): This is where body hub control is defined. body hub control is where various settings related to cf-hub can be tuned. … - [controls/cf_monitord.cf](/reference/masterfiles-policy-framework/controls-cf_monitord/index.md): This is where body monitor control is defined. body monitor control is where various settings related to cf-monitord can … - [controls/cf_runagent.cf](/reference/masterfiles-policy-framework/controls-cf_runagent/index.md): This is where body runagent control is defined. body runagent control is where various settings related to cf-runagent … - [controls/cf_serverd.cf](/reference/masterfiles-policy-framework/controls-cf_serverd/index.md): This is where body server control is defined. body server control is where various settings related to cf-serverd can be … - [controls/def_inputs.cf](/reference/masterfiles-policy-framework/controls-def_inputs/index.md): This is where the list of policy files to include as defined from the augments file is included. file bodies control … - [controls/def.cf](/reference/masterfiles-policy-framework/controls-def/index.md): This is where most common variables and classes are defined. Note its variable scope can be augmented with def.json. … - [controls/reports.cf](/reference/masterfiles-policy-framework/controls-reports/index.md): This is where report settings for CFEngine Enterprise are found. Control which variables and classes should be collected … - [controls/update_def_inputs.cf](/reference/masterfiles-policy-framework/controls-update_def_inputs/index.md): This is where the list of update related policy files to include as defined from the augments file is included. file … - [controls/update_def.cf](/reference/masterfiles-policy-framework/controls-update_def/index.md): This is where most common variables and classes are defined for the update policy. Note its variable scope can be … - [countclassesmatching](/reference/functions/countclassesmatching/index.md): Prototype: countclassesmatching(regex, tag1, tag2, ...) Return type: int Description: Count the number of defined … - [countlinesmatching](/reference/functions/countlinesmatching/index.md): Prototype: countlinesmatching(regex, filename) Return type: int Description: Count the number of lines in file filename … - [custom](/reference/promise-types/custom/index.md): Custom promise types can be added as Promise modules. These enable users to implement their own promise types for … - [data_expand](/reference/functions/data_expand/index.md): Prototype: data_expand(data_container) Return type: data Description: Transforms a data container to expand all variable … - [data_readstringarray](/reference/functions/data_readstringarray/index.md): Prototype: data_readstringarray(filename, comment, split, maxentries, maxbytes) Return type: data Description: Returns a … - [data_readstringarrayidx](/reference/functions/data_readstringarrayidx/index.md): Prototype: data_readstringarrayidx(filename, comment, split, maxentries, maxbytes) Return type: data Description: … - [data_regextract](/reference/functions/data_regextract/index.md): Prototype: data_regextract(regex, string) Return type: data Description: Returns a data container filled with … - [data_sysctlvalues](/reference/functions/data_sysctlvalues/index.md): Prototype: data_sysctlvalues() Return type: data Description: Returns all sysctl values using /proc/sys. Example: … - [databases](/reference/promise-types/databases/index.md): CFEngine can interact with commonly used database servers to keep promises about the structure and content of data … - [datastate](/reference/functions/datastate/index.md): Prototype: datastate() Return type: data Description: Returns the current evaluation data state. The returned data … - [def](/reference/special-variables/def/index.md): The context def is populated by the Masterfiles Policy Framework and can also be populated by the augments file. Note: … - [defaults (deprecated)](/reference/promise-types/defaults/index.md): Defaults promises are related to variables. If a variable or parameter in a promise bundle is undefined, or its value is … - [delete_attribute](/reference/promise-types/files/edit_xml/delete_attribute/index.md): This promise type assures that an attribute, with the given name, will not be present in the specified node within the … - [delete_lines](/reference/promise-types/files/edit_line/delete_lines/index.md): This promise assures that certain lines exactly matching regular expression patterns will not be present in a text file. … - [delete_text](/reference/promise-types/files/edit_xml/delete_text/index.md): This promise type assures that a value string, containing the matching substring, will not be present in the specified … - [delete_tree](/reference/promise-types/files/edit_xml/delete_tree/index.md): This promise type assures that a balanced XML tree, containing the matching subtree, will not be present in the … - [difference](/reference/functions/difference/index.md): Prototype: difference(list1, list2) Return type: slist Description: Returns the unique elements in list1 that are not in … - [dirname](/reference/functions/dirname/index.md): Prototype: dirname(path) Return type: string Description: Return the parent directory name for given path. This function … - [diskfree](/reference/functions/diskfree/index.md): Prototype: diskfree(path) Return type: int Descriptions: Return the free space (in KB) available on the current … - [edit](/reference/special-variables/edit/index.md): This context is used to access information about editing promises during their execution. It is context dependent and … - [escape](/reference/functions/escape/index.md): Prototype: escape(text) Return type: string Description: Escape regular expression characters in text. This function is … - [eval](/reference/functions/eval/index.md): Prototype: eval(expression, mode, options) Return type: string Description: Returns expression evaluated according to … - [every](/reference/functions/every/index.md): Prototype: every(regex, list) Return type: boolean Description: Returns whether every element in the variable list … - [execresult](/reference/functions/execresult/index.md): Prototype: execresult(command, shell, output) Return type: string The return value is cached. Description: Execute … - [execresult_as_data](/reference/functions/execresult_as_data/index.md): Prototype: execresult_as_data(command, shell, output) Return type: data The return value is cached. Description: Execute … - [expandrange](/reference/functions/expandrange/index.md): Prototype: expandrange(string_template, stepsize) Return type: slist Description: Generates a list based on an ordered … - [field_edits](/reference/promise-types/files/edit_line/field_edits/index.md): Certain types of text files are tabular in nature, with field separators (e.g. : or ,). The passwd and group files are … - [file control](/reference/components/file_control_promises/index.md): body file control { namespace => "name1"; } bundle agent private { #... } History: Was introduced in 3.4.0, … - [file_hash](/reference/functions/file_hash/index.md): Prototype: file_hash(file, algorithm) Return type: string Description: Return the hash of file using the hash algorithm. … - [fileexists](/reference/functions/fileexists/index.md): Prototype: fileexists(filename) Return type: boolean Description: Returns whether the file filename can be accessed. The … - [filesexist](/reference/functions/filesexist/index.md): Prototype: filesexist(list) Return type: boolean Description: Returns whether all the files in list can be accessed. All … - [filesize](/reference/functions/filesize/index.md): Prototype: filesize(filename) Return type: int Description: Returns the size of the file filename in bytes. If the file … - [filestat](/reference/functions/filestat/index.md): Prototype: filestat(filename, field) Return type: string Description: Returns the requested file field field for the … - [filter](/reference/functions/filter/index.md): Prototype: filter(filter, list, is_regex, invert, max_return) Return type: slist Description: Transforms a list or data … - [findfiles](/reference/functions/findfiles/index.md): Prototype: findfiles(glob1, glob2, ...) Return type: slist Description: Return the list of files that match any of the … - [findfiles_up](/reference/functions/findfiles_up/index.md): Prototype: findfiles_up(path, glob, level) Return type: data Description: Return a data array of files that match a … - [findlocalgroups](/reference/functions/findlocalgroups/index.md): Prototype: findlocalgroups(filter) Return type: data Description: Returns a data container of all local groups with … - [findlocalusers](/reference/functions/findlocalusers/index.md): Prototype: findlocalusers(filter) Return type: data Description: Returns a data container of all local users with their … - [findprocesses](/reference/functions/findprocesses/index.md): Prototype: findprocesses(regex) Return type: data The return value is cached. Description: Return the list of processes … - [format](/reference/functions/format/index.md): Prototype: format(string, ...) Return type: string Description: Applies sprintf-style formatting to a given string. This … - [getacls](/reference/functions/getacls/index.md): Prototype: getacls(path, type) Return type: slist Description: Return the Access Control List (ACL) for a given file- or … - [getbundlemetatags](/reference/functions/getbundlemetatags/index.md): Prototype: getbundlemetatags(bundlename, optional_tag) Return type: slist Description: Returns the list of meta tags for … - [getclassmetatags](/reference/functions/getclassmetatags/index.md): Prototype: getclassmetatags(classname, optional_tag) Return type: slist Description: Returns the list of meta tags for … - [getenv](/reference/functions/getenv/index.md): Prototype: getenv(variable, maxlength) Return type: string Description: Return the environment variable variable, … - [getfields](/reference/functions/getfields/index.md): Prototype: getfields(regex, filename, split, array_lval) Return type: int Description: Fill array_lval with fields in … - [getgid](/reference/functions/getgid/index.md): Prototype: getgid(groupname) Return type: int Description: Return the integer group id of the group groupname on this … - [getgroupinfo](/reference/functions/getgroupinfo/index.md): Prototype: getgroupinfo(optional_gidorname) Return type: data Description: Return information about the current group or … - [getgroups](/reference/functions/getgroups/index.md): Prototype: getgroups(exclude_names, exclude_ids) Return type: slist Description: Returns a list of all groups defined, … - [getindices](/reference/functions/getindices/index.md): Prototype: getindices(varref) Return type: slist Description: Returns the list of keys in varref which can be the name … - [getuid](/reference/functions/getuid/index.md): Prototype: getuid(username) Return type: int Description: Return the integer user id of the named user on this host If … - [getuserinfo](/reference/functions/getuserinfo/index.md): Prototype: getuserinfo(optional_uidorname) Return type: data Description: Return information about the current user or … - [getusers](/reference/functions/getusers/index.md): Prototype: getusers(exclude_names, exclude_ids) Return type: slist Description: Returns a list of all users defined, … - [getvalues](/reference/functions/getvalues/index.md): Prototype: getvalues(varref) Return type: slist Description: Returns the list of values in varref which can be the name … - [getvariablemetatags](/reference/functions/getvariablemetatags/index.md): Prototype: getvariablemetatags(varname, optional_tag) Return type: slist Description: Returns the list of meta tags for … - [grep](/reference/functions/grep/index.md): Prototype: grep(regex, list) Return type: slist Description: Returns the sub-list if items in list matching the anchored … - [groupexists](/reference/functions/groupexists/index.md): Prototype: groupexists(group) Return type: boolean Description: Returns whether a group group exists on this host. The … - [guest_environments (deprecated)](/reference/promise-types/guest_environments/index.md): WARNING: Due to lack of use this promise type has been removed from the default binaries beginning with version 3.11.0. … - [hash](/reference/functions/hash/index.md): Prototype: hash(input, algorithm) Return type: string Description: Return the hash of input using the hash algorithm. … - [hash_to_int](/reference/functions/hash_to_int/index.md): Prototype: hash_to_int(lower, upper, string) Return type: int Description: Generates an integer between lower and upper … - [hashmatch](/reference/functions/hashmatch/index.md): Prototype: hashmatch(filename, algorithm, hash) Return type: boolean Description: Compute the hash of file filename … - [host2ip](/reference/functions/host2ip/index.md): Prototype: host2ip(hostname) Return type: string The return value is cached. Description: Returns the primary … - [hostinnetgroup](/reference/functions/hostinnetgroup/index.md): Prototype: hostinnetgroup(netgroup) Return type: boolean Description: True if the current host is in the named netgroup. … - [hostrange](/reference/functions/hostrange/index.md): Prototype: hostrange(prefix, range) Return type: boolean Description: Returns whether the unqualified name of the … - [hostsseen](/reference/functions/hostsseen/index.md): Prototype: hostsseen(horizon, seen, field) Return type: slist Description: Returns a list with the information field of … - [hostswithclass](/reference/functions/hostswithclass/index.md): This function is only available in CFEngine Enterprise. Prototype: hostswithclass(class, field) Return type: slist … - [hostswithgroup](/reference/functions/hostswithgroup/index.md): This function is only available in CFEngine Enterprise. Prototype: hostswithgroup(group_name, field) Return type: slist … - [hubknowledge](/reference/functions/hubknowledge/index.md): This function is only available in CFEngine Enterprise. Prototype: hubknowledge(id) Return type: string The return value … - [ifelse](/reference/functions/ifelse/index.md): Prototype: ifelse(...) Return type: string Description: Evaluate each pair of arguments up to the last one as a (class, … - [insert_lines](/reference/promise-types/files/edit_line/insert_lines/index.md): This promise type is part of the line-editing model. It inserts lines into the file at a specified location. The … - [insert_text](/reference/promise-types/files/edit_xml/insert_text/index.md): This proimse type assures that a value string, containing the matching substring, will be present in the specified node … - [insert_tree](/reference/promise-types/files/edit_xml/insert_tree/index.md): This promise type assures that a balanced XML tree, containing the matching subtree, will be present in the specified … - [int](/reference/functions/int/index.md): Prototype: int(string) Return type: int Description: Convert numeric string to int. Arguments: string: string - Numeric … - [intersection](/reference/functions/intersection/index.md): Prototype: intersection(list1, list2) Return type: slist Description: Returns the unique elements in list1 that are also … - [inventory/](/reference/masterfiles-policy-framework/inventory/index.md): The CFEngine 3 inventory modules are pieces of CFEngine policy that are loaded and used by promises.cf in order to … - [inventory/any.cf](/reference/masterfiles-policy-framework/inventory-any/index.md): This policy is inventory related policy that can be run on any OS. This inventory processes is done by populating … - [inventory/debian.cf](/reference/masterfiles-policy-framework/inventory-debian/index.md): This policy is inventory related to debian hosts. common bodies inventory_debian Prototype: inventory_debian … - [inventory/freebsd.cf](/reference/masterfiles-policy-framework/inventory-freebsd/index.md): This policy is inventory related to freebsd hosts. common bodies inventory_freebsd Prototype: inventory_freebsd … - [inventory/generic.cf](/reference/masterfiles-policy-framework/inventory-generic/index.md): This policy is inventory related to generic hosts. common bodies inventory_generic Prototype: inventory_generic … - [inventory/linux.cf](/reference/masterfiles-policy-framework/inventory-linux/index.md): This policy is inventory related to linux hosts. common bodies inventory_linux Prototype: inventory_linux Description: … - [inventory/lsb.cf](/reference/masterfiles-policy-framework/inventory-lsb/index.md): This policy is inventory related to lsb hosts. agent bundles inventory_lsb Prototype: inventory_lsb Description: LSB … - [inventory/macos.cf](/reference/masterfiles-policy-framework/inventory-macos/index.md): This policy is inventory related to macos hosts. common bodies inventory_macos Prototype: inventory_macos Description: … - [inventory/os.cf](/reference/masterfiles-policy-framework/inventory-os/index.md): This policy is inventory related to os hosts. common bodies inventory_os Prototype: inventory_os Implementation: bundle … - [inventory/redhat.cf](/reference/masterfiles-policy-framework/inventory-redhat/index.md): This policy is inventory related to redhat hosts. common bodies inventory_redhat Prototype: inventory_redhat … - [inventory/suse.cf](/reference/masterfiles-policy-framework/inventory-suse/index.md): This policy is inventory related to suse hosts. common bodies inventory_suse Prototype: inventory_suse Description: SUSE … - [inventory/windows.cf](/reference/masterfiles-policy-framework/inventory-windows/index.md): This policy is inventory related to windows hosts. common bodies inventory_windows Prototype: inventory_windows … - [ip2host](/reference/functions/ip2host/index.md): Prototype: ip2host(ip) Return type: string The return value is cached. Description: Returns the primary name-service … - [iprange](/reference/functions/iprange/index.md): Prototype: iprange(range, optional_interface) Return type: boolean Description: Returns whether the current host lies in … - [irange](/reference/functions/irange/index.md): Prototype: irange(arg1, arg2) Return type: irange Description: Define a range of integer values for CFEngine internal … - [is_type](/reference/functions/is_type/index.md): Prototype: is_type(var, type) Return type: string Description: Returns whether a variable var is of type type Arguments: … - [isconnectable](/reference/functions/isconnectable/index.md): Prototype: isconnectable(hostname, port, timeout) Return type: boolean Description: Checks whether a port is connectable … - [isdir](/reference/functions/isdir/index.md): Prototype: isdir(filename) Return type: boolean Description: Returns whether the named object filename is a directory. … - [isexecutable](/reference/functions/isexecutable/index.md): Prototype: isexecutable(filename) Return type: boolean Description: Returns whether the named object filename has … - [isgreaterthan](/reference/functions/isgreaterthan/index.md): Prototype: isgreaterthan(value1, value2) Return type: boolean Description: Returns whether value1 is greater than … - [isipinsubnet](/reference/functions/isipinsubnet/index.md): Prototype: isipinsubnet(range, ip_address1, ip_address2, ...) Return type: boolean Description: Returns whether the … - [islessthan](/reference/functions/islessthan/index.md): Prototype: islessthan(value1, value2) Return type: boolean Description: Returns whether value1 is less than value2. The … - [islink](/reference/functions/islink/index.md): Prototype: islink(filename) Return type: boolean Description: Returns whether the named object filename is a symbolic … - [isnewerthan](/reference/functions/isnewerthan/index.md): Prototype: isnewerthan(newer, older) Return type: boolean Description: Returns whether the file newer is newer (modified … - [isnewerthantime](/reference/functions/isnewerthantime/index.md): Prototype: isnewerthantime(file, time) Return type: boolean Description: Returns whether the file file is newer … - [isplain](/reference/functions/isplain/index.md): Prototype: isplain(filename) Return type: boolean Description: Returns whether the named object filename is a … - [isreadable](/reference/functions/isreadable/index.md): Prototype: isreadable(path, timeout) Return type: boolean Description: Check if a file is readable. This function checks … - [isvariable](/reference/functions/isvariable/index.md): Prototype: isvariable(var) Return type: boolean Description: Returns whether a variable named var is defined. The … - [join](/reference/functions/join/index.md): Prototype: join(glue, list) Return type: string Description: Join the items of list into a string, using the conjunction … - [lastnode](/reference/functions/lastnode/index.md): Prototype: lastnode(string, separator) Return type: string Description: Returns the part of string after the last … - [laterthan](/reference/functions/laterthan/index.md): Prototype: laterthan(year, month, day, hour, minute, second) Return type: boolean Description: Returns whether the … - [ldaparray](/reference/functions/ldaparray/index.md): This function is only available in CFEngine Enterprise. Prototype: ldaparray(array, uri, dn, filter, scope, security) … - [ldaplist](/reference/functions/ldaplist/index.md): This function is only available in CFEngine Enterprise. Prototype: ldaplist(uri, dn, filter, record, scope, security) … - [ldapvalue](/reference/functions/ldapvalue/index.md): This function is only available in CFEngine Enterprise. Prototype: ldapvalue(uri, dn, filter, record, scope, security) … - [length](/reference/functions/length/index.md): Prototype: length(list) Return type: int Description: Returns the length of list. This function can accept many types of … - [lib/](/reference/masterfiles-policy-framework/lib/index.md): This directory contains the standard library aka COPBL or the Community Open Promise Body Library. The bodies and … - [lib/autorun.cf](/reference/masterfiles-policy-framework/lib-autorun/index.md): file bodies control Prototype: control Implementation: body file control { services_autorun|services_autorun_inputs:: … - [lib/bundles.cf](/reference/masterfiles-policy-framework/lib-bundles/index.md): file bodies control Prototype: control Description: Include policy files used by this policy file as part of inputs … - [lib/cfe_internal_hub.cf](/reference/masterfiles-policy-framework/lib-cfe_internal_hub/index.md): file bodies control Prototype: control Description: Include policy files used by this policy file as part of inputs … - [lib/cfe_internal.cf](/reference/masterfiles-policy-framework/lib-cfe_internal/index.md): file bodies control Prototype: control Description: Include necessary parts of stdlib Implementation: body file control … - [lib/cfengine_enterprise_hub_ha.cf](/reference/masterfiles-policy-framework/lib-cfengine_enterprise_hub_ha/index.md): file bodies control Prototype: control Description: Include policy specific to CFEngine Enterprise High Availability … - [lib/commands.cf](/reference/masterfiles-policy-framework/lib-commands/index.md): See the commands promises documentation for a comprehensive reference on the body types and attributes used here. … - [lib/common.cf](/reference/masterfiles-policy-framework/lib-common/index.md): See the common promise attributes documentation for a comprehensive reference on the body types and attributes used … - [lib/databases.cf](/reference/masterfiles-policy-framework/lib-databases/index.md): See the databases promises documentation for a comprehensive reference on the body types and attributes used here. … - [lib/edit_xml.cf](/reference/masterfiles-policy-framework/lib-edit_xml/index.md): edit_xml bundles xml_insert_tree_nopath Prototype: xml_insert_tree_nopath(treestring) Description: Insert XML tree with … - [lib/event.cf](/reference/masterfiles-policy-framework/lib-event/index.md): classes bodies event_cancel_events Prototype: event_cancel_events(events) Description: Cancel any events Arguments: … - [lib/examples.cf](/reference/masterfiles-policy-framework/lib-examples/index.md): agent bundles probabilistic_usebundle Prototype: probabilistic_usebundle(probability, bundlename) Description: activate … - [lib/feature.cf](/reference/masterfiles-policy-framework/lib-feature/index.md): classes bodies feature_cancel Prototype: feature_cancel(x) Description: Undefine class x when promise is kept or … - [lib/files.cf](/reference/masterfiles-policy-framework/lib-files/index.md): See the files promises and edit_line bundles documentation for a comprehensive reference on the bundles, body types, and … - [lib/guest_environments.cf](/reference/masterfiles-policy-framework/lib-guest_environments/index.md): environment_resources bodies kvm Prototype: kvm(name, arch, cpu_count, mem_kb, disk_file) Description: An … - [lib/monitor.cf](/reference/masterfiles-policy-framework/lib-monitor/index.md): match_value bodies scan_log Prototype: scan_log(line) Description: Selects lines matching line in a growing file … - [lib/packages.cf](/reference/masterfiles-policy-framework/lib-packages/index.md): See the packages promises documentation for a comprehensive reference on the body types and attributes used here. … - [lib/paths.cf](/reference/masterfiles-policy-framework/lib-paths/index.md): common bodies paths Prototype: paths Description: Defines an array path with common paths to standard binaries and … - [lib/processes.cf](/reference/masterfiles-policy-framework/lib-processes/index.md): See the processes promises documentation for a comprehensive reference on the body types and attributes used here. … - [lib/reports.cf](/reference/masterfiles-policy-framework/lib-reports/index.md): printfile bodies cat Prototype: cat(file) Description: Report the contents of a file Arguments: file: The full path of … - [lib/services.cf](/reference/masterfiles-policy-framework/lib-services/index.md): See the services promises documentation for a comprehensive reference on the body types and attributes used here. file … - [lib/stdlib.cf](/reference/masterfiles-policy-framework/lib-stdlib/index.md): file bodies control Prototype: control Description: Include the standard library files selected to inputs … - [lib/storage.cf](/reference/masterfiles-policy-framework/lib-storage/index.md): See the storage promises documentation for a comprehensive reference on the body types and attributes used here. volume … - [lib/testing.cf](/reference/masterfiles-policy-framework/lib-testing/index.md): The testing.cf library provides bundles for working testing frameworks like TAP and jUnit. These bodies are included in … - [lib/users.cf](/reference/masterfiles-policy-framework/lib-users/index.md): See the users promises documentation for a comprehensive reference on the body types and attributes used here. password … - [lib/vcs.cf](/reference/masterfiles-policy-framework/lib-vcs/index.md): The vcs.cf library provides bundles for working with version control tools. file bodies control Prototype: control … - [Limits](/reference/limits/index.md): There are various limits enforced in CFEngine, for names and values in both policy, web UI, and other places. It can … - [Loops](/reference/language-concepts/loops/index.md): There are no explicit loops in CFEngine, instead there are lists. To make a loop, you simply refer to a list as a scalar … - [lsdir](/reference/functions/lsdir/index.md): Prototype: lsdir(path, regex, include_base) Return type: slist Description: Returns a list of files in the directory … - [Macros](/reference/macros/index.md): Macros allow you to target different versions of the CFEngine binaries / parser. They can be used to conditionally … - [makerule](/reference/functions/makerule/index.md): Prototype: makerule(target, sources) Return type: string Description: Evaluates whether a target file needs to be built … - [maparray](/reference/functions/maparray/index.md): Prototype: maparray(pattern, array_or_container) Return type: slist Description: Returns a list with each … - [mapdata](/reference/functions/mapdata/index.md): Prototype: mapdata(interpretation, pattern, array_or_container) Return type: data Description: Returns a data container … - [maplist](/reference/functions/maplist/index.md): Prototype: maplist(pattern, list) Return type: slist Description: Return a list with each element in list modified by a … - [match](/reference/special-variables/match/index.md): Each time CFEngine matches a string, these values are assigned to a special variable context $(match.n). The fragments … - [max](/reference/functions/max/index.md): Prototype: max(list, sortmode) Return type: string Description: Return the maximum of the items in list according to … - [mean](/reference/functions/mean/index.md): Prototype: mean(list) Return type: real Description: Return the mean of the numbers in list. This function can accept … - [measurements](/reference/promise-types/measurements/index.md): By default, CFEngine’s monitoring component cf-monitord records performance data about the system. These include … - [mergedata](/reference/functions/mergedata/index.md): Prototype: mergedata(one, two, etc) Return type: data Description: Returns the merger of any named data containers or … - [meta](/reference/promise-types/meta/index.md): Meta-data promises have no internal function. They are intended to be used to represent arbitrary information about … - [methods](/reference/promise-types/methods/index.md): Methods are compound promises that refer to whole bundles of promises. Methods may be parameterized. methods: … - [min](/reference/functions/min/index.md): Prototype: min(list, sortmode) Return type: string Description: Return the minimum of the items in list according to … - [modules/](/reference/masterfiles-policy-framework/modules/index.md): This directory tree is used for distributing Modules. The packages subtree is used for vendoring packages modules and … - [modules/mustache/](/reference/masterfiles-policy-framework/modules-mustache/index.md): Files in this directory ending in .mustache are rendered to $(sys.moduledir) (typically /var/cfengine/modules) using … - [modules/packages/](/reference/masterfiles-policy-framework/modules-packages/index.md): This directory tree is used for distributing package modules. Files in this directory have an executable copy in … - [modules/packages/vendored/](/reference/masterfiles-policy-framework/modules-packages-vendored/index.md): This directory tree is used for distributing package modules that are rendered into place with mustache. The modules … - [modules/promises/](/reference/masterfiles-policy-framework/modules-promises/index.md): This directory tree is used for distributing promise modules and supporting libraries. Files in this directory have an … - [modules/promises/cfengine.py](/reference/masterfiles-policy-framework/modules-promises-cfengine.py/index.md): import sys import json import traceback from copy import copy from collections import OrderedDict _LOG_LEVELS = { … - [modules/promises/cfengine.sh](/reference/masterfiles-policy-framework/modules-promises-cfengine.sh/index.md): #!/bin/false # # This file should be sourced, not run log() { if [ "$#" != 2 ] ; then echo … - [mon](/reference/special-variables/mon/index.md): The variables discovered by cf-monitord are placed in this monitoring context. Monitoring variables are expected to be … - [Namespaces](/reference/language-concepts/namespaces/index.md): By default all promises are made in the default namespace. Specifying a namespace places the bundle or body in a … - [network_connections](/reference/functions/network_connections/index.md): Prototype: network_connections() Return type: data Description: Return the list of current network connections. The … - [none](/reference/functions/none/index.md): Prototype: none(regex, list) Return type: boolean Description: Returns whether no element in list matches the regular … - [not](/reference/functions/not/index.md): Prototype: not(expression) Return type: boolean Description: Returns any if all arguments evaluate to false and !any if … - [now](/reference/functions/now/index.md): Prototype: now() Return type: int Description: Return the time at which this agent run started in system representation. … - [nth](/reference/functions/nth/index.md): Prototype: nth(list_or_container, position_or_key) Return type: string Description: Returns the element of … - [on](/reference/functions/on/index.md): Prototype: on(year, month, day, hour, minute, second) Return type: int Description: Returns the specified date/time in … - [or](/reference/functions/or/index.md): Prototype: or(...) Return type: boolean Description: Returns any if any argument evaluates to true and !any if any … - [Package modules](/reference/language-concepts/modules/package-module-api/index.md): Package modules are back-ends that enable the package promise to work with different types of platform package managers. … - [packages](/reference/promise-types/packages/index.md): CFEngine 3.7 and later supports package management through a simple promise interface. Using a small set of attributes … - [packages (deprecated)](/reference/promise-types/packages-deprecated/index.md): NOTE: This package promise is deprecated and has been superseded by the new package promise. It is recommended to use … - [packagesmatching](/reference/functions/packagesmatching/index.md): Prototype: packagesmatching(package_regex, version_regex, arch_regex, method_regex) Return type: data Description: … - [packageupdatesmatching](/reference/functions/packageupdatesmatching/index.md): Prototype: packageupdatesmatching(package_regex, version_regex, arch_regex, method_regex) Return type: data Description: … - [parseintarray](/reference/functions/parseintarray/index.md): Prototype: parseintarray(array, input, comment, split, maxentries, maxbytes) Return type: int Description: Parses up to … - [parsejson](/reference/functions/parsejson/index.md): Prototype: parsejson(json_data) Return type: data Description: Parses JSON data directly from an inlined string and … - [parserealarray](/reference/functions/parserealarray/index.md): Prototype: parserealarray(array, input, comment, split, maxentries, maxbytes) Return type: int Description: Parses up to … - [parsestringarray](/reference/functions/parsestringarray/index.md): Prototype: parsestringarray(array, input, comment, split, maxentries, maxbytes) Return type: int Description: Parses up … - [parsestringarrayidx](/reference/functions/parsestringarrayidx/index.md): Prototype: parsestringarrayidx(array, input, comment, split, maxentries, maxbytes) Return type: int Description: … - [parseyaml](/reference/functions/parseyaml/index.md): Prototype: parseyaml(yaml_data) Return type: data Description: Parses YAML data directly from an inlined string and … - [Pattern matching and referencing](/reference/language-concepts/pattern-matching-and-referencing/index.md): One of the strengths of CFEngine 3 is the ability to recognize and exploit patterns. All string patterns in CFEngine 3 … - [peerleader](/reference/functions/peerleader/index.md): Prototype: peerleader(filename, regex, groupsize) Return type: string Description: Returns the current host’s … - [peerleaders](/reference/functions/peerleaders/index.md): Prototype: peerleaders(filename, regex, groupsize) Return type: slist Description: Returns a list of partition peer … - [peers](/reference/functions/peers/index.md): Prototype: peers(filename, regex, groupsize) Return type: slist Description: Returns the current host’s partition … - [Policy evaluation](/reference/language-concepts/policy-evaluation/index.md): CFEngine takes a pragmatic point of view to ordering. When promising scalar attributes and properties, ordering is … - [processes](/reference/promise-types/processes/index.md): Process promises refer to items in the system process table, i.e., a command in some state of execution (with a Process … - [processexists](/reference/functions/processexists/index.md): Prototype: processexists(regex) Return type: boolean The return value is cached. Description: Return whether a process … - [product](/reference/functions/product/index.md): Prototype: product(list) Return type: real Description: Returns the product of the reals in list. This function might be … - [Promises](/reference/language-concepts/promises/index.md): One concept in CFEngine should stand out from the rest as being the most important: promises. Everything else is just an … - [promises.cf](/reference/masterfiles-policy-framework/promises/index.md): $(sys.inputdir)/promises.cf is the default policy run by the agent. It is responsible for specifying additional policy … - [randomint](/reference/functions/randomint/index.md): Prototype: randomint(lower, upper) Return type: int Description: Returns a random integer between lower and up to but … - [read_module_protocol](/reference/functions/read_module_protocol/index.md): Prototype: read_module_protocol(file_path) Return type: boolean Description: Interprets file_path as module protocol … - [readcsv](/reference/functions/readcsv/index.md): Prototype: readcsv(filename, optional_maxbytes) Return type: data Description: Parses CSV data from the file filename … - [readdata](/reference/functions/readdata/index.md): Prototype: readdata(filename, filetype) Return type: data Description: Parses CSV, JSON, or YAML data from file filename … - [readenvfile](/reference/functions/readenvfile/index.md): Prototype: readenvfile(filename, optional_maxbytes) Return type: data Description: Parses key-value pairs from the file … - [readfile](/reference/functions/readfile/index.md): Prototype: readfile(filename, optional_maxbytes) Return type: string Description: Returns the first maxbytes bytes from … - [readintarray](/reference/functions/readintarray/index.md): Prototype: readintarray(array, filename, comment, split, maxentries, maxbytes) Return type: int Description: Populates … - [readintlist](/reference/functions/readintlist/index.md): Prototype: readintlist(filename, comment, split, maxentries, maxbytes) Return type: ilist Description: Splits the file … - [readjson](/reference/functions/readjson/index.md): Prototype: readjson(filename, optional_maxbytes) Return type: data Description: Parses JSON data from the file filename … - [readrealarray](/reference/functions/readrealarray/index.md): Prototype: readrealarray(array, filename, comment, split, maxentries, maxbytes) Return type: int Description: Populates … - [readreallist](/reference/functions/readreallist/index.md): Prototype: readreallist(filename, comment, split, maxentries, maxbytes) Return type: rlist Description: Splits the file … - [readstringarray](/reference/functions/readstringarray/index.md): Prototype: readstringarray(array, filename, comment, split, maxentries, maxbytes) Return type: int Description: … - [readstringarrayidx](/reference/functions/readstringarrayidx/index.md): Prototype: readstringarrayidx(array, filename, comment, split, maxentries, maxbytes) Return type: int Description: … - [readstringlist](/reference/functions/readstringlist/index.md): Prototype: readstringlist(filename, comment, split, maxentries, maxbytes) Return type: slist Description: Splits the … - [readtcp](/reference/functions/readtcp/index.md): Prototype: readtcp(hostnameip, port, sendstring, maxbytes) Return type: string The return value is cached. Description: … - [readyaml](/reference/functions/readyaml/index.md): Prototype: readyaml(filename, optional_maxbytes) Return type: data Description: Parses YAML data from the file filename … - [regarray](/reference/functions/regarray/index.md): Prototype: regarray(array, regex) Return type: boolean Description: Returns whether array contains elements matching the … - [regcmp](/reference/functions/regcmp/index.md): Prototype: regcmp(regex, string) Return type: boolean Description: Returns whether the anchored regular expression regex … - [regex_replace](/reference/functions/regex_replace/index.md): Prototype: regex_replace(string, regex, replacement, options) Return type: string Description: In a given string, … - [regextract](/reference/functions/regextract/index.md): Prototype: regextract(regex, string, backref) Return type: boolean Description: Returns whether the anchored regex … - [registryvalue](/reference/functions/registryvalue/index.md): Prototype: registryvalue(key, valueid) Return type: string Description: Returns the value of valueid in the Windows … - [regldap](/reference/functions/regldap/index.md): This function is only available in CFEngine Enterprise. Prototype: regldap(uri, dn, filter, record, scope, regex, … - [regline](/reference/functions/regline/index.md): Prototype: regline(regex, filename) Return type: boolean Description: Returns whether the anchored regular expression … - [reglist](/reference/functions/reglist/index.md): Prototype: reglist(list, regex) Return type: boolean Description: Returns whether the anchored regular expression regex … - [remoteclassesmatching](/reference/functions/remoteclassesmatching/index.md): This function is only available in CFEngine Enterprise. Prototype: remoteclassesmatching(regex, server, encrypt, prefix) … - [remotescalar](/reference/functions/remotescalar/index.md): This function is only available in CFEngine Enterprise. Prototype: remotescalar(id, server, encrypt) Return type: string … - [replace_patterns](/reference/promise-types/files/edit_line/replace_patterns/index.md): This promise refers to arbitrary text patterns in a file. The pattern is expressed as a PCRE regular expression. … - [reports](/reference/promise-types/reports/index.md): Reports promises simply print messages. Outputting a message without qualification can be a dangerous operation. In a … - [returnszero](/reference/functions/returnszero/index.md): Prototype: returnszero(command, shell) Return type: boolean The return value is cached. Description: Runs command and … - [reverse](/reference/functions/reverse/index.md): Prototype: reverse(list) Return type: slist Description: Reverses a list. This is a simple function to reverse a list. … - [roles](/reference/promise-types/roles/index.md): Roles promises are server-side decisions about which users are allowed to define soft-classes on the server’s … - [rrange](/reference/functions/rrange/index.md): Prototype: rrange(arg1, arg2) Return type: rrange Description: Define a range of real numbers for CFEngine internal use. … - [selectservers](/reference/functions/selectservers/index.md): Prototype: selectservers(hostlist, port, query, regex, maxbytes, array) Return type: int Description: Returns the number … - [services](/reference/promise-types/services/index.md): services type promises in their simplest generic form are an abstraction on bundles. services type promises are … - [services/](/reference/masterfiles-policy-framework/services/index.md): This directory is the suggested place to add your custom policy files. - [services/autorun/](/reference/masterfiles-policy-framework/services-autorun/index.md): When the services_autorun class is defined .cf files located in services/autorun/ are automatically included in inputs … - [services/main.cf](/reference/masterfiles-policy-framework/services-main/index.md): This directory is the suggested place to add your custom policy files. - [set_attribute](/reference/promise-types/files/edit_xml/set_attribute/index.md): This promise type assures that an attribute, with the given name and value, will be present in the specified node within … - [set_text](/reference/promise-types/files/edit_xml/set_text/index.md): This promise type assures that a matching value string will be present in the specified node within the XML file. If the … - [shuffle](/reference/functions/shuffle/index.md): Prototype: shuffle(list, seed) Return type: slist Description: Return list shuffled with seed. This function can accept … - [some](/reference/functions/some/index.md): Prototype: some(regex, list) Return type: boolean Description: Return whether any element of list matches the Unanchored … - [sort](/reference/functions/sort/index.md): Prototype: sort(list, mode) Return type: slist Description: Returns list sorted according to mode. This function can … - [splayclass](/reference/functions/splayclass/index.md): Prototype: splayclass(input, policy) Return type: boolean Description: Returns whether input’s time-slot has … - [splitstring](/reference/functions/splitstring/index.md): Prototype: splitstring(string, regex, maxent) Return type: slist Description: Splits string into at most maxent … - [standalone_self_upgrade.cf](/reference/masterfiles-policy-framework/standalone_self_upgrade/index.md): $(sys.inputdir)/standalone_self_upgrade.cf is an independent policy set entry like promises.cf and update.cf. The policy … - [storage](/reference/promise-types/storage/index.md): Storage promises refer to disks and filesystem properties. storage: "/disk volume or mountpoint" volume => … - [storejson](/reference/functions/storejson/index.md): Prototype: storejson(data_container) Return type: string Description: Converts a data container to a JSON string. This … - [strcmp](/reference/functions/strcmp/index.md): Prototype: strcmp(string1, string2) Return type: boolean Description: Returns whether the two strings string1 and … - [strftime](/reference/functions/strftime/index.md): Prototype: strftime(mode, template, time) Return type: string Description: Interprets a time and date format string at a … - [string](/reference/functions/string/index.md): Prototype: string(arg) Return type: string Description: Convert arg to string. Arguments: arg: string - Convert argument … - [string_downcase](/reference/functions/string_downcase/index.md): Prototype: string_downcase(data) Return type: string Description: Returns data in lower case. Arguments: data: string - … - [string_head](/reference/functions/string_head/index.md): Prototype: string_head(data, max) Return type: string Description: Returns the first max bytes of data. If max is … - [string_length](/reference/functions/string_length/index.md): Prototype: string_length(data) Return type: int Description: Returns the byte length of data. Arguments: data: string - … - [string_mustache](/reference/functions/string_mustache/index.md): Prototype: string_mustache(template_string, optional_data_container) Return type: string Description: Formats a Mustache … - [string_replace](/reference/functions/string_replace/index.md): Prototype: string_replace(string, match, replacement) Return type: string Description: In a given string, replaces a … - [string_reverse](/reference/functions/string_reverse/index.md): Prototype: string_reverse(data) Return type: string Description: Returns data reversed. Arguments: data: string - Input … - [string_split](/reference/functions/string_split/index.md): Prototype: string_split(string, regex, maxent) Return type: slist Description: Splits string into at most maxent … - [string_tail](/reference/functions/string_tail/index.md): Prototype: string_tail(data, max) Return type: string Description: Returns the last max bytes of data. If max is … - [string_trim](/reference/functions/string_trim/index.md): Prototype: string_trim(string) Return type: string Description: Trim whitespace from beginning and end of string. … - [string_upcase](/reference/functions/string_upcase/index.md): Prototype: string_upcase(data) Return type: string Description: Returns data in uppercase. Arguments: data: string - … - [sublist](/reference/functions/sublist/index.md): Prototype: sublist(list, head_or_tail, max_elements) Return type: slist Description: Returns list of up to max_elements … - [sum](/reference/functions/sum/index.md): Prototype: sum(list) Return type: real Description: Return the sum of the reals in list. This function can accept many … - [sys](/reference/special-variables/sys/index.md): System variables are derived from CFEngine’s automated discovery of system values. They are provided as variables … - [sysctlvalue](/reference/functions/sysctlvalue/index.md): Prototype: sysctlvalue(key) Return type: string Description: Returns the sysctl value of key using /proc/sys. Arguments: … - [this](/reference/special-variables/this/index.md): The context this is used to access information about promises during their execution. It is context dependent and not … - [translatepath](/reference/functions/translatepath/index.md): Prototype: translatepath(path) Return type: string Description: Translate separators in path from Unix style to the … - [type](/reference/functions/type/index.md): Prototype: type(var, detail) Return type: string Description: Returns a variables type description. Arguments: var: … - [unique](/reference/functions/unique/index.md): Prototype: unique(list) Return type: slist Description: Returns list of unique elements from list. This function can … - [update.cf](/reference/masterfiles-policy-framework/update/index.md): $(sys.inputdir)/update.cf is responsible for updating policy from the hub as well as ensuring various core cfenigne … - [url_get](/reference/functions/url_get/index.md): Prototype: url_get(url, options_container) Return type: data Description: Retrieves the contents of a url using options … - [usemodule](/reference/functions/usemodule/index.md): Prototype: usemodule(module, args) Return type: boolean Description: Execute CFEngine module script module with args, … - [userexists](/reference/functions/userexists/index.md): Prototype: userexists(user) Return type: boolean Description: Return whether user name or numerical id exists on this … - [useringroup](/reference/functions/useringroup/index.md): Prototype: useringroup(user) Return type: boolean Description: Return whether a user is a member of a given group Looks … - [users](/reference/promise-types/users/index.md): User promises are promises made about local users on a host. They express which users should be present on a system, and … - [validdata](/reference/functions/validdata/index.md): Prototype: validdata(data_container, type, strict) Return type: boolean Description: Validates a JSON container from … - [validjson](/reference/functions/validjson/index.md): Prototype: validjson(string, strict) Return type: boolean Description: Validates a JSON container from string and … - [Variables](/reference/language-concepts/variables/index.md): Just like classes are defined as promises, variables (or “variable definitions”) are also promises. … - [variablesmatching](/reference/functions/variablesmatching/index.md): Prototype: variablesmatching(name, tag1, tag2, ...) Return type: slist Description: Return the list of variables … - [variablesmatching_as_data](/reference/functions/variablesmatching_as_data/index.md): Prototype: variablesmatching_as_data(name, tag1, tag2, ...) Return type: data Description: Return a data container with … - [variance](/reference/functions/variance/index.md): Prototype: variance(list) Return type: real Description: Return the variance of the numbers in list. This function can … - [vars](/reference/promise-types/vars/index.md): Variables in CFEngine are defined as promises that an identifier of a certain type represents a particular value. … - [version_compare](/reference/functions/version_compare/index.md): Prototype: version_compare(version1, comparison, version2) Return type: boolean Description: Returns true if the … ## Release notes - [Release notes](/release-notes/index.md) - [Changelog](/release-notes/whatsnew/changelog-core/index.md): See also: Enterprise changelog, Masterfiles changelog 3.27.2 Added 2 most recent self upgrade log files to cf-support … - [Enterprise changelog](/release-notes/whatsnew/changelog-enterprise/index.md): See also: Core changelog, Masterfiles changelog 3.27.2 Added possibility to apply filters to the Build projects list API … - [Known issues](/release-notes/known-issues/index.md): CFEngine defects are managed in our bug tracker. Please report bugs or unexpected behavior there, following the … - [Legal and licenses](/release-notes/legal-and-licenses/index.md): General legal disclaimer Please note that unless otherwise noted (through a customer agreement or similar) CFEngine is … - [Masterfiles changelog](/release-notes/whatsnew/changelog-masterfiles-policy-framework/index.md): See also: Core changelog, Enterprise changelog 3.27.2 Fixed issues during hub upgrade by checking systemctl cat instead … - [Supported platforms and versions](/release-notes/supported-platforms/index.md): CFEngine works on a wide range of platforms, and the CFEngine team strives to provide support for the platforms most … ## Resources - [Resources](/resources/index.md) - [Agent output email](/resources/faq/output-email/index.md): How do I set the email where agent reports are sent? The agent report email functionality is configured in body executor … - [Agility](/resources/additional-topics/agility/index.md): Understanding agility We intuitively recognize agility as the capability to respond rapidly enough and flexibly enough … - [Application management](/resources/additional-topics/application-management/index.md): What is application management? Application management concerns the deployment and updating of software, as well as … - [Best practices](/resources/best-practices/index.md): Policy style guide When writing CFEngine policy using our Policy style guide helps make your policy easily understood, … - [Bootstrapping](/resources/faq/bootstrap-failed/index.md): Frequently asked questions around bootstrapping, the process of starting CFEngine for the first time, and connecting the … - [Build Deploy Manage Audit](/resources/additional-topics/build-deploy-manage-audit/index.md): What is BDMA? The four mission phases are sometimes referred to as Build A mission is based on decisions and resources … - [Change management](/resources/additional-topics/change-management/index.md): What is change management? Change Management is about the planning and implementation of intended changes to an IT … - [Cloud computing](/resources/additional-topics/cloud-computing/index.md): What is cloud computing? Cloud Computing refers to the commoditization of computing, i.e. a world in which computers may … - [Content driven policy](/resources/additional-topics/content-driven-policy/index.md): What is a content-driven policy? A Content-Driven Policy is a text file with lines containing semi-colon separated … - [Debugging slow queries](/resources/faq/debugging-slow-queries/index.md): If Mission Portal seems to take too much time to generate pages or reports or if API calls seem to be taking too long. … - [DevOps](/resources/additional-topics/devops/index.md): What is DevOps? DevOps is a term coined by Patrick Debois in 2009, from an amalgamation of Development and Operations. … - [Distributed scheduling](/resources/additional-topics/distributed-scheduling/index.md): What is distributed scheduling? Scheduling refers to the execution of non-interactive processes or tasks (usually called … - [Enterprise report collection](/resources/faq/enterprise-report-collection/index.md): Frequently asked questions on Enterprise report collection. What are reports? Reports are the records that the … - [Enterprise Report Filtering](/resources/faq/enterprise-report-filtering/index.md): Filtering inventoried lists When filtering an inventoried list item filtering can be based on one or more elements of … - [Enterprise reporting database](/resources/faq/enterprise/index.md): Frequently asked questions on the Enterprise reporting database. Can I use an existing PostgreSQL installation? No. … - [External resources](/resources/external-resources/index.md): Use the following links to learn more about CFEngine: Reading Learn by reading information brought to you by CFEngine … - [File content](/resources/additional-topics/file-content/index.md): From boiler-plates to convergent file editing Many configuration management systems allow you to determine configuration … - [Hierarchies](/resources/additional-topics/hierarchies/index.md): Authority, Structure and Inheritance What is a hierarchy? A hierarchy is an organizational structure with tree-like … - [How can I tell what classes and variables are defined?](/resources/faq/show-classes-and-vars/index.md): You can see a high level overview of the first order classes and variables using cf-promises --show-classes and … - [How do I find the public key for a given host](/resources/faq/find-public-key-for-host-sha/index.md): Trying to locate the public key for a host on your hub in order to validate trust? Use this snippet to figure out which … - [How do I fix trust after an IP change?](/resources/faq/fix-trust-after-ip-change/index.md): Symptom: After the policy server was restarted with the new IP address, clients would not connect: error: Not authorized … - [How do I fix undefined body errors?](/resources/faq/fix-undefined-body-error/index.md): When running policy you see error: Undefined body. For example: cf-promises -f ./large-files.cf: ./large-files.cf:14:0: … - [How do I integrate custom policy?](/resources/faq/integrate-custom-policy/index.md): There are many different ways that custom polices can be organized. CFEngine does not prescribe any specific … - [How do I pass a data type variable?](/resources/faq/variables/index.md): Data type variables also known as “data containers” are passed using the same syntax as passing a list. … - [Iteration (Loops)](/resources/additional-topics/iteration/index.md): What is iteration? Iteration is about repeating operations in a list. In CFEngine, iteration is used to make a number of … - [ITIL](/resources/additional-topics/itil/index.md): What it ITIL? The IT Infrastructure Library (ITIL) is a set of human management practices surrounding IT infrastructure … - [Manual execution](/resources/faq/manual-execution/index.md): Frequently asked questions on manual execution. How do I run a standalone policy file? The --file or -f option to … - [Modularity and orchestrating system policy](/resources/additional-topics/modularity/index.md): What is modularity? Modularity is the ability to separate concerns within a total process, and hide the details of the … - [Mustache templating](/resources/faq/mustache-templating/index.md): CFEngine specific extensions CFEngine has several extensions to the mustache standard. -top- special key representing … - [Orchestration](/resources/additional-topics/orchestration/index.md): What is organizational complexity? Complexity is a measure of the amount of information needed to explain something. It … - [Requesting a CFEngine Enterprise License](/resources/faq/enterprise-license/index.md): To get a license please open a support request including the number of hosts you would like each hub to be licensed for … - [Security](/resources/additional-topics/security/index.md): Diego Zamboni, discusses why CFEngine is a critical component of maintaining IT system security. Many vulnerabilities … - [STIGs](/resources/additional-topics/stigs/index.md): CFEngine STIGs compliance example The Security Technical Implementation Guides (STIGs) are a method for standardized … - [Teamwork](/resources/additional-topics/teamwork/index.md): What is team-work? Team work is a collaboration between individuals with different skills. It is key element in … - [Tuning PostgreSQL](/resources/faq/tuning-postgresql/index.md): During install the CFEngine Enterprise Hub Package pre-configures PostgreSQL with a configuration for low (<3GB), … - [Unable to log into Mission Portal](/resources/faq/unable-to-log-in-mission-portal/index.md): Mismatched names in SSL certificate If your ssl certificate does not match the name used to access Mission Portal the … - [Uninstalling / reinstalling](/resources/faq/uninstall-reinstall/index.md): What is left behind after uninstalling? Uninstalling a CFEngine package does not remove any user data. Most data … - [Users](/resources/faq/users/index.md): Frequently asked questions about managing users from policy. How do I ensure that a local user is locked? To ensure that … - [Using CFEngine with Open Nebula](/resources/additional-topics/open-nebula/index.md): What is Open Nebula? Open Nebula is an Open Source framework for Cloud Computing that aims to become an industry … - [What did CFEngine do?](/resources/faq/what-did-cfengine-change/index.md): This page presents a few ways of understanding what CFEngine has done to your machine. CFEngine Core/Community The … - [What is promise locking?](/resources/faq/what-is-promise-locking/index.md): By default when the agent runs each promise that has an outcome of kept or repaired is locked for one minute. So if the … - [Why are remote agents not updating?](/resources/faq/why-are-remote-agents-not-updating/index.md): The masterfiles policy framework defaults to using cf_promises_validated as a simple gating mechanism for policy … - [Why are some files inside masterfiles not being updated/distributed?](/resources/faq/why-are-files-not-being-distributed/index.md): During agent bootstrap all files found in masterfiles are copied to $(sys.inputdir) (commonly /var/cfengine/inputs). … - [Why does CFEngine install into /var/cfengine instead of following the FHS?](/resources/faq/fhs/index.md): The Unix Filesystem Hierarchy Standard is a specification for standardizing where files and directories get installed on … - [Why knowledge management?](/resources/faq/why-knowledge-management/index.md): The real IT management is all about the knowledge. At CFEngine we focus on knowledge right from the beginning - from … ## Web UI - [Web UI](/web-ui/index.md) - [Adjusting schedules](/web-ui/hub_administration/adjusting-schedules/index.md): Set cf-execd agent execution schedule By default cf-execd is configured to run cf-agent every 5 minutes. This can be … - [AI agent](/web-ui/ai-agent/index.md): The AI agent in Mission Portal allows you to explore your infrastructure using natural language queries. Integrates with … - [Alerts and notifications](/web-ui/alerts-and-notifications/index.md): Create a new alert From the Dashboard, locate the rectangle with the dotted border. When the cursor is hovering over … - [Audit log retention](/web-ui/hub_administration/audit-log-retention/index.md): The Mission Portal Audit log API records administrative actions (user, role, settings, host, group, Build project, and … - [Backup and restore](/web-ui/hub_administration/backup-and-restore/index.md): With policy stored in version control there are few things that should be preserved in your backup and restore plan. Hub … - [Client initiated reporting / call collect](/web-ui/enterprise-reporting/client-initiated-reporting/index.md): Pull collect is the default mode of reporting. In this mode, the reporting hub connects out to hosts to pull reporting … - [Configure a custom LDAP port](/web-ui/hub_administration/custom-ldap-port/index.md): Mission Portals User settings and preferences provides a radio button encryption. This controls the encryption and the … - [Custom actions for alerts](/web-ui/custom-actions-for-alerts/index.md): Once you have become familiar with the Alerts widgets, you might see the need to integrate the alerts with an existing … - [Custom LDAPs certificate](/web-ui/hub_administration/custom-ldaps-certificate/index.md): To use a custom LDAPs certificate install it into your hubs operating system. Note you can use the LDAPTLS_CACERT … - [Custom SSL certificate](/web-ui/hub_administration/custom-https-certificate/index.md): When first installed a self-signed ssl certificate is automatically generated and used to secure Mission Portal and API … - [Debugging Mission Portal](/web-ui/debugging-mission-portal/index.md): Set the API log level to DEBUG in Mission Portal settings. Edit /var/cfengine/share/GUI/index.php and set ENVIRONMENT … - [Decommissioning hosts](/web-ui/hub_administration/decommissioning-hosts/index.md): Once a host is shut off, or CFEngine is uninstalled, you should remove it from Mission Portal. This has 2 benefits: … - [Enable plain http](/web-ui/hub_administration/enable-plain-http/index.md): By default HTTPS is enforced by redirecting any non secure connection requests. If you would like to enable plain HTTP … - [Extending Mission Portal](/web-ui/hub_administration/extending-mission-portal/index.md): Custom pages requiring authenticated users Mission Portal can render static text files (html, sql, txt, etc …) … - [Extending query builder in Mission Portal](/web-ui/hub_administration/extending-query-builder/index.md): This instruction is created to explain how to extend the Query builder in the case where the enterprise hub database has … - [Federated reporting](/web-ui/federated-reporting/index.md): Overview Federated reporting enables the collection of data from multiple Hubs to provide a view in Mission Portal which … - [Health](/web-ui/health/index.md): You can get quick access to the health of hosts, including direct links to reports, from the Health drop down at the … - [Hosts](/web-ui/hosts/index.md): The Hosts app provides a customizable global overview of promise compliance. A summary of compliant vs non-compliant … - [License](/web-ui/license/index.md): License information License information can be obtained from the About page under the user menu. License status report … - [Lookup license info](/web-ui/hub_administration/lookup-license-info/index.md): Information about the currently issued license can be obtained from the About section in Mission Portal web interface or … - [Measurements app](/web-ui/measurements/index.md): Measurements allows you to get an overview of specific metrics on your hosts over time. If multiple hosts are selected … - [Policy deployment](/web-ui/hub_administration/policy-deployment/index.md): By default CFEngine policy is distributed from /var/cfengine/masterfiles on the policy server. It is common (and … - [Public key distribution](/web-ui/hub_administration/public-key-distribution/index.md): How can I arrange for the hosts in my infrastructure to trust a new key? If you are deploying a new hub, or authorizing … - [Re-installing Enterprise hub](/web-ui/hub_administration/reinstall/index.md): Sometimes it is useful to re-install the hub while still preserving existing trust and licensing. To preserve trust the … - [Regenerate self signed SSL certificate](/web-ui/hub_administration/regenerate-self-signed-cert/index.md): When first installed a self-signed ssl certificate is automatically generated and used to secure Mission Portal and API … - [Reporting architecture](/web-ui/enterprise-reporting/reporting-architecture/index.md): The reporting architecture of CFEngine Enterprise uses two software components from the CFEngine Enterprise hub package. … - [Reporting UI](/web-ui/enterprise-reporting/reporting_ui/index.md): CFEngine collects a large amount of data. To inspect it, you can run and schedule pre-defined reports or use the query … - [Reset administrative credentials](/web-ui/hub_administration/reset-admin-creds/index.md): The default admin user can be reset to defaults using the following SQL. cfsettings-setadminpassword.sql INSERT INTO … - [Settings](/web-ui/settings/index.md): A variety of CFEngine and system properties can be changed in the settings view. Opening settings Settings are … - [SQL queries using the Enterprise API](/web-ui/enterprise-reporting/sql-queries-enterprise-api/index.md): The CFEngine Enterprise Hub collects information about the environment in a centralized database. Data is collected …