How to store command output into array in Ansible?

前端 未结 3 617
长情又很酷
长情又很酷 2020-12-31 21:51

Essentially, I want to be able to handle \"wildcard filenames\" in Linux using ansible. In essence, this means using the ls command with part of a filename followed by an \

3条回答
  •  粉色の甜心
    2020-12-31 22:41

    Can you try as below.

    - name: Run command to cat each file and then capture that output.
       shell: cat {{ item.stdout_lines }}
       register: annoying_words
       with_items:
        - "{{ annoying.results }}"
    

提交回复
热议问题