2017-05-25 23 views

答えて

2

で状態を確認する方法

、ここであなたが望む何かにdebugからアクションを変更する必要があります。

は、ここでは、そのディレクトリ( no which you want to perform action

上のファイルのリストを収集し、我々はその特定のコマンドの出力を印刷しているdebugを使用しています。

注:あなたが欲しいあなたのアクションでdebugの私の例を変更する必要があります。

--- 
- hosts: "localhost" 
    gather_facts: no 
    tasks: 
    - name: "Looking for files" 
    command: ls /path/to/directory 
    register: command_output 
    - name: "Looking for output" 
    debug: 
    msg: "{{command_output}}" 
    when: command_output.stdout != "" 
関連する問題