Write variable to a file in Ansible

前端 未结 4 731
感动是毒
感动是毒 2020-12-24 04:34

I am pulling JSON via the URI module and want to write the received content out to a file. I am able to get the content and output it to the debugger so I know the content

4条回答
  •  旧时难觅i
    2020-12-24 04:51

    Unless you are writing very small files, you should probably use templates.

    Example:

    - name: copy upstart script
      template: 
        src: myCompany-service.conf.j2 
        dest: "/etc/init/myCompany-service.conf"
    

提交回复
热议问题