How to create an empty file with Ansible?

后端 未结 10 799
傲寒
傲寒 2021-01-31 12:53

What is the easiest way to create an empty file using Ansible? I know I can save an empty file into the files directory and then copy it to the remote host, but I f

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-31 13:32

    In order to create a file in the remote machine with the ad-hoc command

    ansible client -m file -a"dest=/tmp/file state=touch"
    

    Please correct me if I am wrong

提交回复
热议问题