2.puppet学习笔记:puppet资源file详细介绍

本文详细介绍了Puppet中的file资源,包括其作用、可使用的参数和多个实战案例,展示了如何管理文件、目录、软链接,设置权限、来源等。通过示例展示如何在agent节点上创建、下载和配置文件及其属性。
摘要由CSDN通过智能技术生成

puppet资源file资源介绍


资源的介绍

资源是puppet最基本的元素,每个资源的定义都具有标题、类型以及一系列的属性。puppet的特性就是处理资源与资源之间的依赖关系。

任何相同类型的资源都会具有一些相同的属性。

资源定义有如下的特性:
1.puppet使用title在编译时期区分每个资源,使用命名变量(namevar)在执行时区分资源。
2.在同一类资源中title和namevar都是唯一的。
3.每个类型都有部分属性有默认值
4,如果不指定namevar,则默认赋予其title的值。


file资源

Description
Manages files, including their content, ownership, and permissions.The file type can manage normal files, directories, and symlinks; the type should be specified in the ensure attribute. Note that symlinks cannot be managed on Windows systems.
File contents can be managed directly with the content attribute, or downloaded from a remote source using the source attribute; the latter can also be used to recursively serve directories (when the recurse attribute is set to true or local). On Wi

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值