From 0cd6bdf896d6a2eb5fdda269cf61f990aa4831f8 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Tue, 28 May 2019 18:02:04 +0200 Subject: [PATCH] Update beta manual --- .../manual/beta/_sources/cdist-type.rst.txt | 67 ++++++++++++++++++ .../_sources/man7/cdist-type__acl.rst.txt | 6 +- .../_sources/man7/cdist-type__apt_key.rst.txt | 17 ++++- .../manual/beta/cdist-best-practice.html | 6 +- src/extra/manual/beta/cdist-bootstrap.html | 6 +- src/extra/manual/beta/cdist-cache.html | 6 +- .../manual/beta/cdist-configuration.html | 6 +- src/extra/manual/beta/cdist-explorer.html | 6 +- src/extra/manual/beta/cdist-features.html | 6 +- src/extra/manual/beta/cdist-hacker.html | 6 +- src/extra/manual/beta/cdist-install.html | 6 +- src/extra/manual/beta/cdist-integration.html | 6 +- src/extra/manual/beta/cdist-inventory.html | 6 +- src/extra/manual/beta/cdist-manifest.html | 6 +- src/extra/manual/beta/cdist-messaging.html | 6 +- src/extra/manual/beta/cdist-os.html | 6 +- .../manual/beta/cdist-parallelization.html | 6 +- src/extra/manual/beta/cdist-preos.html | 6 +- src/extra/manual/beta/cdist-quickstart.html | 6 +- src/extra/manual/beta/cdist-real-world.html | 6 +- src/extra/manual/beta/cdist-reference.html | 6 +- .../manual/beta/cdist-remote-exec-copy.html | 6 +- .../beta/cdist-saving-output-streams.html | 6 +- src/extra/manual/beta/cdist-stages.html | 6 +- src/extra/manual/beta/cdist-support.html | 6 +- src/extra/manual/beta/cdist-trigger.html | 6 +- .../manual/beta/cdist-troubleshooting.html | 6 +- src/extra/manual/beta/cdist-type.html | 65 +++++++++++++++-- src/extra/manual/beta/cdist-types.html | 6 +- src/extra/manual/beta/cdist-upgrade.html | 6 +- src/extra/manual/beta/cdist-why.html | 6 +- src/extra/manual/beta/genindex.html | 6 +- src/extra/manual/beta/index.html | 6 +- src/extra/manual/beta/man1/cdist-dump.html | 6 +- .../manual/beta/man1/cdist-new-type.html | 6 +- src/extra/manual/beta/man1/cdist.html | 6 +- .../manual/beta/man7/cdist-type__acl.html | 10 ++- .../man7/cdist-type__apt_default_release.html | 6 +- .../manual/beta/man7/cdist-type__apt_key.html | 23 ++++-- .../beta/man7/cdist-type__apt_key_uri.html | 6 +- .../beta/man7/cdist-type__apt_mark.html | 6 +- .../man7/cdist-type__apt_norecommends.html | 6 +- .../manual/beta/man7/cdist-type__apt_ppa.html | 6 +- .../beta/man7/cdist-type__apt_source.html | 6 +- .../man7/cdist-type__apt_update_index.html | 6 +- .../manual/beta/man7/cdist-type__block.html | 6 +- .../man7/cdist-type__ccollect_source.html | 6 +- .../manual/beta/man7/cdist-type__cdist.html | 6 +- .../man7/cdist-type__cdist_preos_trigger.html | 6 +- .../beta/man7/cdist-type__cdistmarker.html | 6 +- .../beta/man7/cdist-type__check_messages.html | 6 +- .../beta/man7/cdist-type__chroot_mount.html | 6 +- .../beta/man7/cdist-type__chroot_umount.html | 6 +- .../beta/man7/cdist-type__clean_path.html | 6 +- .../beta/man7/cdist-type__config_file.html | 6 +- .../manual/beta/man7/cdist-type__consul.html | 6 +- .../beta/man7/cdist-type__consul_agent.html | 6 +- .../beta/man7/cdist-type__consul_check.html | 6 +- .../beta/man7/cdist-type__consul_reload.html | 6 +- .../beta/man7/cdist-type__consul_service.html | 6 +- .../man7/cdist-type__consul_template.html | 6 +- .../cdist-type__consul_template_template.html | 6 +- .../man7/cdist-type__consul_watch_checks.html | 6 +- .../man7/cdist-type__consul_watch_event.html | 6 +- .../man7/cdist-type__consul_watch_key.html | 6 +- .../cdist-type__consul_watch_keyprefix.html | 6 +- .../man7/cdist-type__consul_watch_nodes.html | 6 +- .../cdist-type__consul_watch_service.html | 6 +- .../cdist-type__consul_watch_services.html | 6 +- .../manual/beta/man7/cdist-type__cron.html | 6 +- .../beta/man7/cdist-type__daemontools.html | 6 +- .../man7/cdist-type__daemontools_service.html | 6 +- .../cdist-type__debconf_set_selections.html | 6 +- .../beta/man7/cdist-type__directory.html | 6 +- .../manual/beta/man7/cdist-type__docker.html | 6 +- .../beta/man7/cdist-type__docker_compose.html | 6 +- .../beta/man7/cdist-type__docker_config.html | 6 +- .../beta/man7/cdist-type__docker_secret.html | 6 +- .../beta/man7/cdist-type__docker_stack.html | 6 +- .../beta/man7/cdist-type__docker_swarm.html | 6 +- .../manual/beta/man7/cdist-type__dog_vdi.html | 6 +- .../beta/man7/cdist-type__dot_file.html | 6 +- .../manual/beta/man7/cdist-type__file.html | 6 +- .../beta/man7/cdist-type__filesystem.html | 6 +- .../beta/man7/cdist-type__firewalld_rule.html | 6 +- .../man7/cdist-type__firewalld_start.html | 6 +- .../manual/beta/man7/cdist-type__git.html | 6 +- .../manual/beta/man7/cdist-type__go_get.html | 6 +- .../man7/cdist-type__golang_from_vendor.html | 6 +- .../man7/cdist-type__grafana_dashboard.html | 6 +- .../manual/beta/man7/cdist-type__group.html | 6 +- .../beta/man7/cdist-type__hostname.html | 6 +- .../manual/beta/man7/cdist-type__hosts.html | 6 +- .../cdist-type__install_bootloader_grub.html | 6 +- .../cdist-type__install_chroot_mount.html | 6 +- .../cdist-type__install_chroot_umount.html | 6 +- .../beta/man7/cdist-type__install_config.html | 6 +- .../beta/man7/cdist-type__install_coreos.html | 6 +- .../man7/cdist-type__install_directory.html | 6 +- .../beta/man7/cdist-type__install_file.html | 6 +- .../beta/man7/cdist-type__install_fstab.html | 6 +- .../cdist-type__install_generate_fstab.html | 6 +- .../beta/man7/cdist-type__install_mkfs.html | 6 +- .../beta/man7/cdist-type__install_mount.html | 6 +- .../cdist-type__install_partition_msdos.html | 6 +- ...t-type__install_partition_msdos_apply.html | 6 +- .../beta/man7/cdist-type__install_reboot.html | 6 +- .../man7/cdist-type__install_reset_disk.html | 6 +- .../beta/man7/cdist-type__install_stage.html | 6 +- .../beta/man7/cdist-type__install_umount.html | 6 +- .../beta/man7/cdist-type__iptables_apply.html | 6 +- .../beta/man7/cdist-type__iptables_rule.html | 6 +- .../manual/beta/man7/cdist-type__issue.html | 6 +- .../manual/beta/man7/cdist-type__jail.html | 6 +- .../beta/man7/cdist-type__jail_freebsd10.html | 6 +- .../beta/man7/cdist-type__jail_freebsd9.html | 6 +- .../beta/man7/cdist-type__key_value.html | 6 +- .../beta/man7/cdist-type__keyboard.html | 6 +- .../man7/cdist-type__letsencrypt_cert.html | 6 +- .../manual/beta/man7/cdist-type__line.html | 6 +- .../manual/beta/man7/cdist-type__link.html | 6 +- .../manual/beta/man7/cdist-type__locale.html | 6 +- .../beta/man7/cdist-type__locale_system.html | 6 +- .../manual/beta/man7/cdist-type__motd.html | 6 +- .../manual/beta/man7/cdist-type__mount.html | 6 +- .../beta/man7/cdist-type__mysql_database.html | 6 +- .../manual/beta/man7/cdist-type__package.html | 6 +- .../beta/man7/cdist-type__package_apk.html | 6 +- .../beta/man7/cdist-type__package_apt.html | 6 +- .../beta/man7/cdist-type__package_dpkg.html | 6 +- .../beta/man7/cdist-type__package_emerge.html | 6 +- ...ist-type__package_emerge_dependencies.html | 6 +- .../man7/cdist-type__package_luarocks.html | 6 +- .../beta/man7/cdist-type__package_opkg.html | 6 +- .../beta/man7/cdist-type__package_pacman.html | 6 +- .../beta/man7/cdist-type__package_pip.html | 6 +- .../man7/cdist-type__package_pkg_freebsd.html | 6 +- .../man7/cdist-type__package_pkg_openbsd.html | 6 +- .../cdist-type__package_pkgng_freebsd.html | 6 +- .../man7/cdist-type__package_rubygem.html | 6 +- .../cdist-type__package_update_index.html | 6 +- .../man7/cdist-type__package_upgrade_all.html | 6 +- .../beta/man7/cdist-type__package_yum.html | 6 +- .../beta/man7/cdist-type__package_zypper.html | 6 +- .../beta/man7/cdist-type__pacman_conf.html | 6 +- .../cdist-type__pacman_conf_integrate.html | 6 +- .../beta/man7/cdist-type__pf_apply.html | 6 +- .../beta/man7/cdist-type__pf_ruleset.html | 6 +- .../manual/beta/man7/cdist-type__ping.html | 6 +- .../manual/beta/man7/cdist-type__postfix.html | 6 +- .../beta/man7/cdist-type__postfix_master.html | 6 +- .../man7/cdist-type__postfix_postconf.html | 6 +- .../man7/cdist-type__postfix_postmap.html | 6 +- .../beta/man7/cdist-type__postfix_reload.html | 6 +- .../man7/cdist-type__postgres_database.html | 6 +- .../man7/cdist-type__postgres_extension.html | 6 +- .../beta/man7/cdist-type__postgres_role.html | 6 +- .../manual/beta/man7/cdist-type__process.html | 6 +- .../cdist-type__prometheus_alertmanager.html | 6 +- .../man7/cdist-type__prometheus_exporter.html | 6 +- .../man7/cdist-type__prometheus_server.html | 6 +- .../manual/beta/man7/cdist-type__pyvenv.html | 6 +- .../beta/man7/cdist-type__qemu_img.html | 6 +- .../manual/beta/man7/cdist-type__rbenv.html | 6 +- .../manual/beta/man7/cdist-type__rsync.html | 6 +- .../manual/beta/man7/cdist-type__rvm.html | 6 +- .../manual/beta/man7/cdist-type__rvm_gem.html | 6 +- .../beta/man7/cdist-type__rvm_gemset.html | 6 +- .../beta/man7/cdist-type__rvm_ruby.html | 6 +- .../man7/cdist-type__ssh_authorized_key.html | 6 +- .../man7/cdist-type__ssh_authorized_keys.html | 6 +- .../beta/man7/cdist-type__ssh_dot_ssh.html | 6 +- .../beta/man7/cdist-type__staged_file.html | 6 +- .../beta/man7/cdist-type__start_on_boot.html | 6 +- .../manual/beta/man7/cdist-type__sysctl.html | 6 +- .../beta/man7/cdist-type__systemd_unit.html | 6 +- .../beta/man7/cdist-type__timezone.html | 6 +- .../manual/beta/man7/cdist-type__ufw.html | 6 +- .../beta/man7/cdist-type__ufw_rule.html | 6 +- .../man7/cdist-type__update_alternatives.html | 6 +- .../manual/beta/man7/cdist-type__user.html | 6 +- .../beta/man7/cdist-type__user_groups.html | 6 +- .../beta/man7/cdist-type__yum_repo.html | 6 +- .../beta/man7/cdist-type__zypper_repo.html | 6 +- .../beta/man7/cdist-type__zypper_service.html | 6 +- src/extra/manual/beta/objects.inv | Bin 2658 -> 2658 bytes src/extra/manual/beta/search.html | 6 +- src/extra/manual/beta/searchindex.js | 2 +- 188 files changed, 704 insertions(+), 566 deletions(-) diff --git a/src/extra/manual/beta/_sources/cdist-type.rst.txt b/src/extra/manual/beta/_sources/cdist-type.rst.txt index a5eefff5..12a203b7 100644 --- a/src/extra/manual/beta/_sources/cdist-type.rst.txt +++ b/src/extra/manual/beta/_sources/cdist-type.rst.txt @@ -216,6 +216,73 @@ In the __file type, stdin is used as source for the file, if - is used for sourc .... +Stdin inside a loop +~~~~~~~~~~~~~~~~~~~ +Since cdist saves type's stdin content in the object as **$__object/stdin**, +so it can be accessed in manifest and gencode-* scripts, this can lead to +unexpected behavior. For example, suppose you have some type with the following +in its manifest: + +.. code-block:: sh + + if [ -f "$__object/parameter/foo" ] + then + while read -r l + do + __file "$l" + echo "$l" >&2 + done < "$__object/parameter/foo" + fi + +and init manifest: + +.. code-block:: sh + + __foo foo --foo a --foo b --foo c + +You expect that manifest stderr content is: + +.. code-block:: sh + + a + b + c + +and that files *a*, *b* and *c* are created. But all you get in manifest stderr +is: + +.. code-block:: sh + + a + +and only *a* file is created. + +When redirecting parameter *foo* file content to while's stdin that means that all +commands in while body have this same stdin. So when *__file* type gets executed, +cdist saves its stdin which means it gets the remaining content of parameter *foo* +file, i.e.: + +.. code-block:: sh + + b + c + +The solution is to make sure that your types inside such loops get their stdin +from somewhere else, e.g. for the above problem *__file* type can get empty +stdin from */dev/null*: + +.. code-block:: sh + + if [ -f "$__object/parameter/foo" ] + then + while read -r l + do + __file "$l" < /dev/null + echo "$l" >&2 + done < "$__object/parameter/foo" + fi + + Writing the manifest -------------------- In the manifest of a type you can use other types, so your type extends diff --git a/src/extra/manual/beta/_sources/man7/cdist-type__acl.rst.txt b/src/extra/manual/beta/_sources/man7/cdist-type__acl.rst.txt index 092eb555..d066aae5 100644 --- a/src/extra/manual/beta/_sources/man7/cdist-type__acl.rst.txt +++ b/src/extra/manual/beta/_sources/man7/cdist-type__acl.rst.txt @@ -10,11 +10,7 @@ DESCRIPTION ----------- ACL must be defined as 3-symbol combination, using ``r``, ``w``, ``x`` and ``-``. -Fully supported on Linux (tested on Debian and CentOS). - -Partial support for FreeBSD, OSX and Solaris. - -OpenBSD and NetBSD support is not possible. +Fully supported and tested on Linux (ext4 filesystem), partial support for FreeBSD. See ``setfacl`` and ``acl`` manpages for more details. diff --git a/src/extra/manual/beta/_sources/man7/cdist-type__apt_key.rst.txt b/src/extra/manual/beta/_sources/man7/cdist-type__apt_key.rst.txt index 9009877e..234bc715 100644 --- a/src/extra/manual/beta/_sources/man7/cdist-type__apt_key.rst.txt +++ b/src/extra/manual/beta/_sources/man7/cdist-type__apt_key.rst.txt @@ -28,6 +28,12 @@ keyserver the keyserver from which to fetch the key. If omitted the default set in ./parameter/default/keyserver is used. +keydir + key save location, defaults to ``/etc/apt/trusted.pgp.d`` + +uri + the URI from which to download the key + EXAMPLES -------- @@ -47,15 +53,20 @@ EXAMPLES # same thing with other keyserver __apt_key UbuntuArchiveKey --keyid 437D05B5 --keyserver keyserver.ubuntu.com + # download key from the internet + __apt_key rabbitmq \ + --uri http://www.rabbitmq.com/rabbitmq-signing-key-public.asc + AUTHORS ------- Steven Armstrong +Ander Punnar COPYING ------- -Copyright \(C) 2011-2014 Steven Armstrong. You can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation, either version 3 of the +Copyright \(C) 2011-2019 Steven Armstrong and Ander Punnar. You can +redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/src/extra/manual/beta/cdist-best-practice.html b/src/extra/manual/beta/cdist-best-practice.html index 498e38ea..aae026f7 100644 --- a/src/extra/manual/beta/cdist-best-practice.html +++ b/src/extra/manual/beta/cdist-best-practice.html @@ -8,7 +8,7 @@ - 25. Best practice — cdist 5.1.0 documentation + 25. Best practice — cdist 5.1.1 documentation @@ -23,7 +23,7 @@