【问题标题】:How to use patterens,age,age_stamp options in ansible find module如何在 ansible 查找模块中使用模式、年龄、年龄标记选项
【发布时间】:2019-09-25 11:34:24
【问题描述】:

我想在 /var/tmp 中查找具有特定模式“*_info”且上次修改时间大于 200 秒的文件。

这是我的剧本

---
- name: find module
  hosts: myservers
  gather_facts: no
  tasks:
  - name: find files in /var/tmp having specific pattetern _info with last modified time greater than 200 seconds
    find:
      paths: /var/tmp
      patterens: '*_info'
      age: 200
      age_stamp: mtime
      recurse: yes
      file_type: file
    register: out
  - name: to print the files
    debug:
      var: out.files

出现以下错误。

PLAY [find module] *******************************************************************************************************

TASK [find files in /var/tmp having specific pattetern _info with last modified time greater than 200 seconds] ***********
fatal: [ansc1]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (find) module: patterens Supported parameters include: age, age_stamp, contains, depth, excludes, file_type, follow, get_checksum, hidden, paths, patterns, recurse, size, use_regex"}

PLAY RECAP ***************************************************************************************************************
ansc1                      : ok=0    changed=0    unreachable=0    failed=1

【问题讨论】:

    标签: ansible


    【解决方案1】:

    查找模块参数为patterns。您输入了patterens

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-31
      • 2016-10-23
      • 1970-01-01
      • 2019-10-31
      • 1970-01-01
      • 1970-01-01
      • 2015-03-22
      相关资源
      最近更新 更多