Reference ========= Variable, path and type reference for cdist Explorers --------- The following global explorers are available: - cpu_cores - cpu_sockets - disks - hostname - init - interfaces - is-freebsd-jail - kernel_name - lsb_codename - lsb_description - lsb_id - lsb_release - machine - machine_type - memory - os - os_release - os_version - runlevel Paths ----- $HOME/.cdist The standard cdist configuration directory relative to your home directory. This is usually the place you want to store your site specific configuration. cdist/conf/ The distribution configuration directory. This contains types and explorers to be used. cdist/inventory/ The distribution inventory directory. This path is relative to cdist installation directory. cdist/preos/ The distribution PreOS plugins directory. confdir Cdist will use all available configuration directories and create a temporary confdir containing links to the real configuration directories. This way it is possible to merge configuration directories. By default it consists of everything in $HOME/.cdist and cdist/conf/. For more details see cdist(1). confdir/files/ Cdist does not care about this directory besides providing access to it. It is thought to be a general file storage area. confdir/manifest/init This is the central entry point. It is an executable (+x bit set) shell script that can use values from the explorers to decide which configuration to create for the specified target host. Its intent is to used to define mapping from configurations to hosts. confdir/manifest/* All other files in this directory are not directly used by cdist, but you can separate configuration mappings, if you have a lot of code in the conf/manifest/init file. This may also be helpful to have different admins maintain different groups of hosts. confdir/explorer/ Contains explorers to be run on the target hosts, see `cdist explorer `_. confdir/type/ Contains all available types, which are used to provide some kind of functionality. See `cdist type `_. confdir/type// Home of the type . This directory is referenced by the variable __type (see below). confdir/type//man.rst Manpage in reStructuredText format (required for inclusion into upstream). confdir/type//manifest Used to generate additional objects from a type. confdir/type//gencode-local Used to generate code to be executed on the source host. confdir/type//gencode-remote Used to generate code to be executed on the target host. confdir/type//parameter/required Parameters required by type, \n separated list. confdir/type//parameter/optional Parameters optionally accepted by type, \n separated list. confdir/type//parameter/default/* Default values for optional parameters. Assuming an optional parameter name of 'foo', it's default value would be read from the file confdir/type//parameter/default/foo. confdir/type//parameter/boolean Boolean parameters accepted by type, \n separated list. confdir/type//explorer Location of the type specific explorers. This directory is referenced by the variable __type_explorer (see below). See `cdist explorer `_. confdir/type//files This directory is reserved for user data and will not be used by cdist at any time. It can be used for storing supplementary files (like scripts to act as a template or configuration files). out/ This directory contains output of cdist and is usually located in a temporary directory and thus will be removed after the run. This directory is referenced by the variable __global (see below). out/explorer Output of general explorers. out/object Objects created for the host. out/object/ Contains all object specific information. This directory is referenced by the variable __object (see below). out/object//explorers Output of type specific explorers, per object. Types ----- The following types are available: - __acl (`cdist-type__acl(7) `_) - __apt_backports (`cdist-type__apt_backports(7) `_) - __apt_default_release (`cdist-type__apt_default_release(7) `_) - __apt_key (`cdist-type__apt_key(7) `_) - __apt_key_uri (`cdist-type__apt_key_uri(7) `_) - __apt_mark (`cdist-type__apt_mark(7) `_) - __apt_norecommends (`cdist-type__apt_norecommends(7) `_) - __apt_pin (`cdist-type__apt_pin(7) `_) - __apt_ppa (`cdist-type__apt_ppa(7) `_) - __apt_source (`cdist-type__apt_source(7) `_) - __apt_unattended_upgrades (`cdist-type__apt_unattended_upgrades(7) `_) - __apt_update_index (`cdist-type__apt_update_index(7) `_) - __block (`cdist-type__block(7) `_) - __ccollect_source (`cdist-type__ccollect_source(7) `_) - __cdist (`cdist-type__cdist(7) `_) - __cdist_preos_trigger (`cdist-type__cdist_preos_trigger(7) `_) - __cdistmarker (`cdist-type__cdistmarker(7) `_) - __check_messages (`cdist-type__check_messages(7) `_) - __chroot_mount (`cdist-type__chroot_mount(7) `_) - __chroot_umount (`cdist-type__chroot_umount(7) `_) - __clean_path (`cdist-type__clean_path(7) `_) - __config_file (`cdist-type__config_file(7) `_) - __consul (`cdist-type__consul(7) `_) - __consul_agent (`cdist-type__consul_agent(7) `_) - __consul_check (`cdist-type__consul_check(7) `_) - __consul_reload (`cdist-type__consul_reload(7) `_) - __consul_service (`cdist-type__consul_service(7) `_) - __consul_template (`cdist-type__consul_template(7) `_) - __consul_template_template (`cdist-type__consul_template_template(7) `_) - __consul_watch_checks (`cdist-type__consul_watch_checks(7) `_) - __consul_watch_event (`cdist-type__consul_watch_event(7) `_) - __consul_watch_key (`cdist-type__consul_watch_key(7) `_) - __consul_watch_keyprefix (`cdist-type__consul_watch_keyprefix(7) `_) - __consul_watch_nodes (`cdist-type__consul_watch_nodes(7) `_) - __consul_watch_service (`cdist-type__consul_watch_service(7) `_) - __consul_watch_services (`cdist-type__consul_watch_services(7) `_) - __cron (`cdist-type__cron(7) `_) - __daemontools (`cdist-type__daemontools(7) `_) - __daemontools_service (`cdist-type__daemontools_service(7) `_) - __debconf_set_selections (`cdist-type__debconf_set_selections(7) `_) - __directory (`cdist-type__directory(7) `_) - __docker (`cdist-type__docker(7) `_) - __docker_compose (`cdist-type__docker_compose(7) `_) - __docker_config (`cdist-type__docker_config(7) `_) - __docker_secret (`cdist-type__docker_secret(7) `_) - __docker_stack (`cdist-type__docker_stack(7) `_) - __docker_swarm (`cdist-type__docker_swarm(7) `_) - __dog_vdi (`cdist-type__dog_vdi(7) `_) - __dot_file (`cdist-type__dot_file(7) `_) - __download (`cdist-type__download(7) `_) - __dpkg_architecture (`cdist-type__dpkg_architecture(7) `_) - __file_old (`cdist-type__file_old(7) `_) - __filesystem (`cdist-type__filesystem(7) `_) - __firewalld_rule (`cdist-type__firewalld_rule(7) `_) - __firewalld_start (`cdist-type__firewalld_start(7) `_) - __git (`cdist-type__git(7) `_) - __go_get (`cdist-type__go_get(7) `_) - __golang_from_vendor (`cdist-type__golang_from_vendor(7) `_) - __grafana_dashboard (`cdist-type__grafana_dashboard(7) `_) - __group (`cdist-type__group(7) `_) - __hostname (`cdist-type__hostname(7) `_) - __hosts (`cdist-type__hosts(7) `_) - __hwclock (`cdist-type__hwclock(7) `_) - __install_bootloader_grub (`cdist-type__install_bootloader_grub(7) `_) - __install_chroot_mount (`cdist-type__install_chroot_mount(7) `_) - __install_chroot_umount (`cdist-type__install_chroot_umount(7) `_) - __install_config (`cdist-type__install_config(7) `_) - __install_coreos (`cdist-type__install_coreos(7) `_) - __install_directory (`cdist-type__install_directory(7) `_) - __install_file (`cdist-type__install_file(7) `_) - __install_fstab (`cdist-type__install_fstab(7) `_) - __install_generate_fstab (`cdist-type__install_generate_fstab(7) `_) - __install_mkfs (`cdist-type__install_mkfs(7) `_) - __install_mount (`cdist-type__install_mount(7) `_) - __install_partition_msdos (`cdist-type__install_partition_msdos(7) `_) - __install_partition_msdos_apply (`cdist-type__install_partition_msdos_apply(7) `_) - __install_reboot (`cdist-type__install_reboot(7) `_) - __install_reset_disk (`cdist-type__install_reset_disk(7) `_) - __install_stage (`cdist-type__install_stage(7) `_) - __install_umount (`cdist-type__install_umount(7) `_) - __iptables_apply (`cdist-type__iptables_apply(7) `_) - __iptables_rule (`cdist-type__iptables_rule(7) `_) - __issue (`cdist-type__issue(7) `_) - __jail (`cdist-type__jail(7) `_) - __jail_freebsd10 (`cdist-type__jail_freebsd10(7) `_) - __jail_freebsd9 (`cdist-type__jail_freebsd9(7) `_) - __key_value (`cdist-type__key_value(7) `_) - __keyboard (`cdist-type__keyboard(7) `_) - __letsencrypt_cert (`cdist-type__letsencrypt_cert(7) `_) - __line (`cdist-type__line(7) `_) - __link (`cdist-type__link(7) `_) - __locale (`cdist-type__locale(7) `_) - __locale_system (`cdist-type__locale_system(7) `_) - __localedef (`cdist-type__localedef(7) `_) - __motd (`cdist-type__motd(7) `_) - __mount (`cdist-type__mount(7) `_) - __mysql_database (`cdist-type__mysql_database(7) `_) - __mysql_privileges (`cdist-type__mysql_privileges(7) `_) - __mysql_user (`cdist-type__mysql_user(7) `_) - __openldap_server (`cdist-type__openldap_server(7) `_) - __package (`cdist-type__package(7) `_) - __package_apk (`cdist-type__package_apk(7) `_) - __package_apt (`cdist-type__package_apt(7) `_) - __package_dpkg (`cdist-type__package_dpkg(7) `_) - __package_emerge (`cdist-type__package_emerge(7) `_) - __package_emerge_dependencies (`cdist-type__package_emerge_dependencies(7) `_) - __package_luarocks (`cdist-type__package_luarocks(7) `_) - __package_opkg (`cdist-type__package_opkg(7) `_) - __package_pacman (`cdist-type__package_pacman(7) `_) - __package_pip (`cdist-type__package_pip(7) `_) - __package_pkg_freebsd (`cdist-type__package_pkg_freebsd(7) `_) - __package_pkg_openbsd (`cdist-type__package_pkg_openbsd(7) `_) - __package_pkgng_freebsd (`cdist-type__package_pkgng_freebsd(7) `_) - __package_rubygem (`cdist-type__package_rubygem(7) `_) - __package_update_index (`cdist-type__package_update_index(7) `_) - __package_upgrade_all (`cdist-type__package_upgrade_all(7) `_) - __package_yum (`cdist-type__package_yum(7) `_) - __package_zypper (`cdist-type__package_zypper(7) `_) - __pacman_conf (`cdist-type__pacman_conf(7) `_) - __pacman_conf_integrate (`cdist-type__pacman_conf_integrate(7) `_) - __pf_apply_anchor (`cdist-type__pf_apply_anchor(7) `_) - __pf_ruleset (`cdist-type__pf_ruleset(7) `_) - __ping (`cdist-type__ping(7) `_) - __postfix (`cdist-type__postfix(7) `_) - __postfix_master (`cdist-type__postfix_master(7) `_) - __postfix_postconf (`cdist-type__postfix_postconf(7) `_) - __postfix_postmap (`cdist-type__postfix_postmap(7) `_) - __postfix_reload (`cdist-type__postfix_reload(7) `_) - __postgres_conf (`cdist-type__postgres_conf(7) `_) - __postgres_database (`cdist-type__postgres_database(7) `_) - __postgres_extension (`cdist-type__postgres_extension(7) `_) - __postgres_role (`cdist-type__postgres_role(7) `_) - __process (`cdist-type__process(7) `_) - __prometheus_alertmanager (`cdist-type__prometheus_alertmanager(7) `_) - __prometheus_exporter (`cdist-type__prometheus_exporter(7) `_) - __prometheus_server (`cdist-type__prometheus_server(7) `_) - __pyvenv (`cdist-type__pyvenv(7) `_) - __qemu_img (`cdist-type__qemu_img(7) `_) - __rbenv (`cdist-type__rbenv(7) `_) - __rsync (`cdist-type__rsync(7) `_) - __rvm (`cdist-type__rvm(7) `_) - __rvm_gem (`cdist-type__rvm_gem(7) `_) - __rvm_gemset (`cdist-type__rvm_gemset(7) `_) - __rvm_ruby (`cdist-type__rvm_ruby(7) `_) - __sensible_editor (`cdist-type__sensible_editor(7) `_) - __service (`cdist-type__service(7) `_) - __snakeoil_cert (`cdist-type__snakeoil_cert(7) `_) - __ssh_authorized_key (`cdist-type__ssh_authorized_key(7) `_) - __ssh_authorized_keys (`cdist-type__ssh_authorized_keys(7) `_) - __ssh_dot_ssh (`cdist-type__ssh_dot_ssh(7) `_) - __sshd_config (`cdist-type__sshd_config(7) `_) - __staged_file (`cdist-type__staged_file(7) `_) - __start_on_boot (`cdist-type__start_on_boot(7) `_) - __sysctl (`cdist-type__sysctl(7) `_) - __systemd_service (`cdist-type__systemd_service(7) `_) - __systemd_unit (`cdist-type__systemd_unit(7) `_) - __timezone (`cdist-type__timezone(7) `_) - __uci (`cdist-type__uci(7) `_) - __uci_section (`cdist-type__uci_section(7) `_) - __ufw (`cdist-type__ufw(7) `_) - __ufw_rule (`cdist-type__ufw_rule(7) `_) - __unpack (`cdist-type__unpack(7) `_) - __update_alternatives (`cdist-type__update_alternatives(7) `_) - __user (`cdist-type__user(7) `_) - __user_groups (`cdist-type__user_groups(7) `_) - __xymon_apache (`cdist-type__xymon_apache(7) `_) - __xymon_client (`cdist-type__xymon_client(7) `_) - __xymon_config (`cdist-type__xymon_config(7) `_) - __xymon_server (`cdist-type__xymon_server(7) `_) - __yum_repo (`cdist-type__yum_repo(7) `_) - __zypper_repo (`cdist-type__zypper_repo(7) `_) - __zypper_service (`cdist-type__zypper_service(7) `_) Objects ------- For object to object communication and tests, the following paths are usable within a object directory: files This directory is reserved for user data and will not be used by cdist at any time. It can be used freely by the type (for instance to store template results). changed This empty file exists in an object directory, if the object has code to be executed (either remote or local). stdin This file exists and contains data, if data was provided on stdin when the type was called. Environment variables (for reading) ----------------------------------- The following environment variables are exported by cdist: __cdist_log_level, __cdist_log_level_name cdist log level value and cdist log level name. One of: +----------------+-----------------+ | Log level name | Log level value | +================+=================+ | OFF | 60 | +----------------+-----------------+ | ERROR | 40 | +----------------+-----------------+ | WARNING | 30 | +----------------+-----------------+ | INFO | 20 | +----------------+-----------------+ | VERBOSE | 15 | +----------------+-----------------+ | DEBUG | 10 | +----------------+-----------------+ | TRACE | 5 | +----------------+-----------------+ Available for: initial manifest, explorer, type manifest, type explorer, type gencode. __cdist_colored_log whether or not cdist's log has colors enabled. Is set to the string true if cdist's output is using colors, otherwise the variable contains the string false. Available for: initial manifest, explorer, type manifest, type explorer, type gencode. __cdist_dry_run Is set only when doing dry run (-n flag). Available for: initial manifest, explorer, type manifest, type explorer, type gencode. __explorer Directory that contains all global explorers. Available for: initial manifest, explorer, type explorer, shell. __files Directory that contains content from the "files" subdirectories from the configuration directories. Available for: initial manifest, type manifest, type gencode, shell. __manifest Directory that contains the initial manifest. Available for: initial manifest, type manifest, shell. __global Directory that contains generic output like explorer. Available for: initial manifest, type manifest, type gencode, shell. __messages_in File to read messages from. Available for: initial manifest, type manifest, type gencode. __messages_out File to write messages. Available for: initial manifest, type manifest, type gencode. __object Directory that contains the current object. Available for: type manifest, type explorer, type gencode and code scripts. __object_id The type unique object id. Available for: type manifest, type explorer, type gencode and code scripts. | Note: The leading and the trailing "/" will always be stripped (caused by the filesystem database and ensured by the core). | Note: Double slashes ("//") will not be fixed and result in an error. __object_name The full qualified name of the current object. Available for: type manifest, type explorer, type gencode. __target_host The host we are deploying to. This is primary variable. It's content is literally the one user passed in. Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell. __target_hostname The hostname of host we are deploying to. This variable is derived from **__target_host** (using **socket.getaddrinfo(__target_host)** and then **socket.gethostbyaddr()**). Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell. __target_fqdn The fully qualified domain name of the host we are deploying to. This variable is derived from **__target_host** (using **socket.getfqdn()**). Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell. __target_host_tags Comma separated list of target host tags. Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell. __type Path to the current type. Available for: type manifest, type gencode. __type_explorer Directory that contains the type explorers. Available for: type explorer. Environment variables (for writing) ----------------------------------- The following environment variables influence the behaviour of cdist: require Setup dependencies between objects (see `cdist manifest `_). __cdist_log_level cdist log level value. One of: +----------------+-----------------+ | Log level | Log level value | +================+=================+ | OFF | 60 | +----------------+-----------------+ | ERROR | 40 | +----------------+-----------------+ | WARNING | 30 | +----------------+-----------------+ | INFO | 20 | +----------------+-----------------+ | VERBOSE | 15 | +----------------+-----------------+ | DEBUG | 10 | +----------------+-----------------+ | TRACE | 5 | +----------------+-----------------+ If set cdist will set this log level in accordance with configuration rules. If cdist invokation is used in types then nested cdist will honor this specified log level if not specified otherwise while invoking it. CDIST_PATH Colon delimited list of config directories. CDIST_LOCAL_SHELL Use this shell locally instead of /bin/sh to execute scripts. CDIST_REMOTE_SHELL Use this shell remotely instead of /bin/sh to execute scripts. CDIST_OVERRIDE Allow overwriting type parameters (see `cdist manifest `_). CDIST_ORDER_DEPENDENCY Create dependencies based on the execution order (see `cdist manifest `_). Note that in version 6.2.0 semantic of this processing mode is finally fixed and well defined. CDIST_REMOTE_EXEC Use this command for remote execution (should behave like ssh). CDIST_REMOTE_COPY Use this command for remote copy (should behave like scp). CDIST_INVENTORY_DIR Use this directory as inventory directory. CDIST_BETA Enable beta functionalities. CDIST_COLORED_OUTPUT Colorize cdist's output. If enabled, cdist will use different colors for different log levels. Recognized values are 'always', 'never', and 'auto' (the default). CDIST_CACHE_PATH_PATTERN Custom cache path pattern.