Standard ensure, valid values are absent or present. Defaults to present. The name of the environment variable. This will be inferred from the title if not given explicitly. The value of the environment variable. How this will treat existing content depends on mergemode.
The user whose environment will be modified. Default is undef , i. There is no awareness of network profiles in this module; knowing how changes to the local profile will affect a distributed profile is up to you. Default is ';'.
Specifies how to treat content already in the environment variable, and how to handle deletion of variables. Default is insert. The type of registry value to use. Default is undef for existing keys i. Specifies how long in ms to wait per window for refreshes to go through when environment variables change.
Default is ms. This probably doesn't need changing unless you're having issues with the refreshes taking a long time they generally happen nearly instantly. Note that this only works for the user that initiated the puppet run; if puppet runs in the background, updates to the environment will not propagate to logged in users until they log out and back in or refresh their environment by some other means.
Note that the names will appear as uppercase in the fact, for example the windir environment variable will appears as WINDIR in the fact. The puppet-windows-path module by Bastian Krol was the starting point for this module.
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module. NET [System. Console]::Error stream like:. Specifies the file to look for before running the command. The command runs only if the file doesn't exist. Note: This parameter does not create a file, it only looks for one.
Valid options: A string of the path to the file. Default: Undefined. Sets the directory from which to run the command. Valid options: A string of the directory path.
Specifies the actual PowerShell command to execute. Must either be fully qualified or a search path for the command must be provided. Valid options: String. Sets additional environment variables to set for a command. Valid options: String, or an array of multiple options. Defines whether to log command output in addition to logging the exit code.
Specifies the search path used for command execution. Valid options: String of the path, an array, or a semicolon-separated list. Refreshes the command only when a dependent object is changed. Used with subscribe and notify metaparameters.
Valid options: true, false. Default: false. Lists the expected return code s. If the executed command returns something else, an error is returned. Valid options: An array of acceptable return codes or a single value. Default: 0. Sets the maximum time in seconds that the command should take.
Valid options: Number or string representation of a number. Default: A value of 0 for this property will result in using the default timeout of Inifinite timeout is not supported in this module, but large timeouts are allowed if needed. Determines the number of times execution of the command should be attempted. Valid options: Number or a string representation of a number. Default: '1'. Specifies the time to sleep in seconds between tries.
Runs the exec , unless the command returns 0. Note that this module will not install PowerShell on these platforms. For further information see the Linux installation instructions.
When using here-strings in inline or templated scripts executed by this module, you must use the double-quote style syntax that begins with " and ends with ". The single-quote syntax that begins with ' and ends with ' is not supported.
Note that any external. Since Puppet uses the plain Win32 APIs, it will report the very large number instead of the negative number, which might not be what you expect if you got the exit code from a cmd. To convert a negative exit code to the positive one Puppet will use, add it to The maximum time the command should take. If the command takes longer than the timeout, the command is considered to have failed and will be stopped. The timeout is specified in seconds. The default timeout is seconds and you can set it to 0 to disable the timeout.
The number of times execution of the command should be tried. This many attempts will be made to execute the command until an acceptable return code is returned. Note that the timeout parameter applies to each try rather than to the complete set of tries. If present, Puppet runs this test command first, then runs the main command unless the test has an exit code of 0 success.
This would add root to the cron. The user to run the command as. Note that if you use this then any error output is not currently captured. This is because of a bug within Ruby. If you are using Puppet to create this user, the exec will automatically require the user, as long as it is specified by name. Executes external binaries directly, without passing through a shell or performing any interpolation.
This allows the use of shell globbing and built-ins, and does not require that the path to a command be fully-qualified. Although this can be more convenient than the posix provider, it also means that you need to be more careful with escaping; as ever, with great power comes etc. Execute external binaries on Windows systems. As with the posix provider, this provider directly calls the command with the arguments given, without passing it through a shell or performing any interpolation.
To use shell built-ins — that is, to emulate the shell provider on Windows — a command must explicitly invoke the shell:. To run PowerShell scripts, specify the remotesigned execution policy as part of the command:. To send us feedback or let us know about a docs error, open a ticket you need a Jira account or leave a comment.
0コメント