gpt4 book ai didi

linux - SaltStack : creating directory only if does not exists

转载 作者:IT王子 更新时间:2023-10-29 01:02:45 25 4
gpt4 key购买 nike

目前我有以下创建目录的规则

/init/dir:
file.recurse:
- source: salt://init_dir/init
- user: name
- group: group
- name: /path/init
- dir_mode: 2775
- file_mode: 777

现在我只想在目录不存在的情况下在新的 minions 上创建一个目录。

最佳答案

虽然您的示例确实有效,但没有必要。 file.directory 只会尝试创建不存在的目录。

关于linux - SaltStack : creating directory only if does not exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31059738/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com