A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.cfengine.com/latest/reference-functions-getindices.html below:

getindices - CFEngine 3.26 Docs

Prototype: getindices(varref)

Return type: slist

Description: Returns the list of keys in varref which can be the name of an array or container.

This function can accept many types of data parameters.

Make sure you specify the correct scope when supplying the name of the variable.

Note:

Arguments:

Example:

code

body common control
{
      bundlesequence => { "example" };
}

bundle agent example
{
  vars:

      "ps[relayhost]"                  string => "[mymailrelay]:587";
      "ps[mydomain]"                   string => "iu.hio.no";
      "ps[smtp_sasl_auth_enable]"      string => "yes";
      "ps[smtp_sasl_password_maps]"    string => "hash:/etc/postfix/sasl-passwd";
      "ps[smtp_sasl_security_options]" string => "";
      "ps[smtp_use_tls]"               string => "yes";
      "ps[default_privs]"              string => "mailman";
      "ps[inet_protocols]"             string => "all";
      "ps[inet_interfaces]"            string => "127.0.0.1";

      "parameter_name"        slist => getindices("ps");
      "parameter_name_sorted" slist => sort(parameter_name, lex);

  reports:

      "Found key $(parameter_name_sorted)";
}

Output:

code

R: Found key default_privs
R: Found key inet_interfaces
R: Found key inet_protocols
R: Found key mydomain
R: Found key relayhost
R: Found key smtp_sasl_auth_enable
R: Found key smtp_sasl_password_maps
R: Found key smtp_sasl_security_options
R: Found key smtp_use_tls

History:

See also: getvalues(), about collecting functions, and data documentation.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4