Ansible: copy a directory content to another directory

前端 未结 12 1073
青春惊慌失措
青春惊慌失措 2020-12-24 00:25

I am trying to copy the content of dist directory to nginx directory.

- name: copy html file
  copy: src=/home/vagrant/dist/ dest=/usr/share/nginx/html/
         


        
12条回答
  •  礼貌的吻别
    2020-12-24 01:32

    How to copy directory and sub dirs's and files from ansible server to remote host

    - name: copy nmonchart39 directory  to {{ inventory_hostname }}
      copy:
        src: /home/ansib.usr.srv/automation/monitoring/nmonchart39
        dest: /var/nmon/data
    
    
    Where:
    copy entire directory: src: /automation/monitoring/nmonchart39
    copy directory contents src: nmonchart39/
    

提交回复
热议问题