![]() The scriptlets also take an argument, passed into them by the controlling rpmbuild process. The scripts support a special flag, -p which allows the scriptlet to invoke a single program directly rather than having to spawn a shell to invoke the programs. The basic syntax is similar to the %build, %install, and other sections of the rpm spec file. Thus, all scriptlets can safely assume that if they are running in shell code, they are running within bash. In Fedora, you can assume that the default shell (/bin/sh) is bash. (See 1.) This potentially obviates the need for most of the scriptlets on this page, but is not currently implemented for all packages. RPM as of Fedora 24 also has functionality to automatically run scripts when files are placed in certain locations. For a more complete treatment of scriptlets, please see the Maximum RPM book. This page offers a quick overview of the RPM scriptlets and a number of common recipes for scriptlets in packages. These scriptlets are mostly used to update the running system with information from the package. spec files have several sections which allow packages to run code on installation and removal.How do I create an environment from a pillar map?.Utility Modules - Code Reuse in Custom Modules.The shell to use for execution, defaults to the shell grain envĪ list of environment variables to be set prior to execution. The user name to run the command as shell The command to execute, remember that the command will execute with the Used to render the downloaded file, currently jinja, mako, and wempy In the directory named spam, and is called eggs, the source string is The source script being downloaded to the minion, this source script is wait_script ( name, source = None, template = None, cwd = None, runas = None, shell = None, env = None, stateful = False, use_vt = False, output_loglevel = 'debug', hide_output = False, success_retcodes = None, success_stdout = None, success_stderr = None, ** kwargs ) ¶ĭownload a script from a remote source and execute it only if a watch wait_call ( name, func, args = (), kws = None, stateful = False, use_vt = False, output_loglevel = 'debug', hide_output = False, ** kwargs ) ¶. ![]() The target user account must be in the Administrators group. On a Windows minion you must also use the password argument, and The defaultīehavior is to run as the user under which Salt is running. Specify an alternate user to run the command. The current working directory to execute the command in, defaults to Currently jinja, mako, and wempyĮither "cmd arg1 arg2 arg3." (cmd is not used) or a source If this setting is applied then the named templating engine will be Master in the directory named spam, and is called eggs, the source script ( name, source = None, template = None, cwd = None, runas = None, password = None, shell = None, env = None, stateful = False, timeout = None, use_vt = False, output_loglevel = 'debug', hide_output = False, defaults = None, context = None, success_retcodes = None, success_stdout = None, success_stderr = None, ** kwargs ) ¶ĭownload a script and execute it with specified arguments. Getpip : cmd.run : - name : /usr/bin/python /usr/local/sbin/get-pip.py - unless : which pip - require : - pkg : python - file : /usr/local/sbin/get-pip.py - reload_modules : True. State that's watching will always be executed due to the changed state in This means that if a cmd state is watched by another state then the Therefore, by default, theĬmd state assumes that any command execution results in a changed state. Of the command is unknown to Salt's state system. When executing a command or script, the state (i.e., changed or not) Please note that the success or failure of the state is not affected by whether a stateĬhange occurred nor the stateful argument. Then you must place the command in a script and explicitly set the exit code of If a command returns a non-zero exit code but you wish to treat this as a success, If the script returns a non-zeroĮxit code, then salt determines that it failed to successfully enforce the state. If the command returns a zero exit code, then saltĭetermines that the state was successfully enforced. Salt determines whether the cmd state is successfully enforced based on the exitĬode returned by the command. Run_installer : cmd.run : - name : /tmp/installer.bin > /dev/null 2>&1
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |