Copy multiple files with Ansible

前端 未结 11 1153
执念已碎
执念已碎 2021-01-29 22:29

How can I copy more than a single file into remote nodes by Ansible in a task?

I\'ve tried to duplicate the copy module line in my task to define files but it only copie

11条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-29 22:51

    You can use the with_fileglob loop for this:

    - copy:
        src: "{{ item }}"
        dest: /etc/fooapp/
        owner: root
        mode: 600
      with_fileglob:
        - /playbooks/files/fooapp/*
    

提交回复
热议问题