Download a file with remote file resource chef
For example, to write the home page for an Apache website:. The full syntax for all of the properties that are available to the file resource is:. Perform atomic file updates on a per-resource basis. Set to true for atomic file updates.
Set to false for non-atomic file updates. Set to false to prevent backups from being kept. The SHA checksum of the file. Use to ensure that a specific file is used. If the checksum does not match, the file is not used. A string that is written to the file. The contents of this property replace any previous content when this property has something other than the default value. The default behavior will not modify content. How Chef Infra Client handles certain situations when the target file turns out not to be a file.
For example, when a target file is actually a symlink. Set to true for Chef Infra Client to delete the non-file target and replace it with the specified file.
Set to false for Chef Infra Client to raise an error. If this value is not specified, existing groups remain unchanged and new group assignments use the default POSIX group if available. Change the behavior of the file resource if it is pointed at a symlink. The default behavior is true but emits a warning that the default value will be changed to false in a future version; setting this explicitly to true or false suppresses this warning.
A quoted character string that defines the octal mode. For example: '' , '' , or If mode is not specified and if the file already exists, the existing mode on the file is used. If mode is not specified, the file does not exist, and the :create action is specified, Chef Infra Client assumes a mask value of '' and then applies the umask for the system on which the file is to be created to the mask value. For example, if the umask on a system is '' , Chef Infra Client uses the default value of ''.
UNIX- and Linux-based systems: A quoted character string that defines the octal mode that is passed to chmod.
If the value is specified as a quoted string, it works exactly as if the chmod command was passed. Whether a file inherits rights from its parent directory.
Cause the chef-client to detect and manage the source file for a symlink. Possible values: nil , true , or false. Default value: nil. The default value will be changed to false in a future version. A quoted character string that defines the octal mode. For example: '' , '' , or If mode is not specified and if the file already exists, the existing mode on the file is used. If mode is not specified, the file does not exist, and the :create action is specified, the chef-client assumes a mask value of '' and then applies the umask for the system on which the file is to be created to the mask value.
For example, if the umask on a system is '' , the chef-client uses the default value of ''. UNIX- and Linux-based systems: A quoted character string that defines the octal mode that is passed to chmod. If the value is specified as a quoted string, it works exactly as if the chmod command was passed.
If the value is specified as an integer, prepend a zero 0 to the value to ensure that it is interpreted as an octal number. For example, to assign read, write, and execute rights for all users, use '' or '' ; for the same rights, plus the sticky bit, use or ''. Microsoft Windows: A quoted character string that defines the octal mode that is translated into rights for Microsoft Windows security.
This property has no effect if not specified, but when it and rights are both specified, the effects are cumulative. A resource may notify another resource to take action when its state changes.
Specify a 'resource[name]' , the :action that resource should take, and then the :timer for that action. A resource may notifiy more than one resource; use a notifies statement for each resource to be notified. A timer specifies the point during the chef-client run at which a notification is run. The following timers are available:.
If this value is not specified, existing owners remain unchanged and new owner assignments use the current user when necessary. The full path to the file, including the file name and its extension. The number of times to catch exceptions and retry the resource. Default value: 0. The retry delay in seconds. Default value: 2. The permissions for users and groups in a Microsoft Windows environment.
The location of the source file. When multiple paths are specified, the chef-client will attempt to download the files in the order listed, stopping after the first successful download. A resource may listen to another resource, and then take action if the state of the resource being listened to changes.
A block or a string that returns true or false. A string, when true is executed as a system command. A block is arbitrary Ruby defined within the resource block by using the verify property. When a block is true , Chef Infra Client will continue to update the file as appropriate. If a string or a block return false , the Chef Infra Client run will stop and an error is returned. Atomic updates are used with file -based resources to help ensure that file updates can be made when updating a binary or if disk space runs out.
Atomic updates are enabled by default. On certain platforms, and after a file has been moved into place, Chef Infra Client may modify file permissions to support features specific to those platforms. On platforms with SELinux enabled, Chef Infra Client will fix up the security contexts after a file has been moved into the correct location by running the restorecon command. The rights property can be used in a recipe to manage access control lists ACLs , which allow permissions to be given to multiple users and groups.
Use the rights property can be used as many times as necessary; Chef Infra Client will apply them to the file or directory as required. The syntax for the rights property is as follows:. Use to specify which rights are granted to the principal. Integers used for permissions must match the following list FileSystemRights Enum fields.
Use to specify a group or user. The principal can be specified by either name or SID. Chef Infra Client does not need to know if a principal is a user or a group.
A hash that contains advanced rights options. Possible option types:. The ordering is independent of using the rights property. For example:. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast what if you could invest in your favorite developer? Who owns this outage? Building intelligent escalation chains for modern SRE. Featured on Meta.
Now live: A fully responsive profile. Reducing the weight of our footer. Related 2. Hot Network Questions.
0コメント