Difference between revisions of "Ansible File Commands"

From rbachwiki
Jump to navigation Jump to search
(Created page with "=Copy File to remote servers= --- - name: copy file from local to remote hosts: all tasks: - name: copy file copy: src: ~/photo.jpg dest: ~/ owner: root group: root mode: 0777")
 
Line 12: Line 12:
       group: root
       group: root
       mode: 0777
       mode: 0777
=Change Permission of file on remote server =
---
- name: change permission on remote
  hosts: all
  tasks:
  - name: change permission
    file:
      path: ~/photo.jpg
      owner: root
      group: root
      mode: 0666

Revision as of 19:12, 22 June 2022

Copy File to remote servers

---
- name: copy file from local to remote
 hosts: all
 
 tasks:
 - name: copy file
   copy:
     src: ~/photo.jpg
     dest: ~/    
     owner: root
     group: root
     mode: 0777

Change Permission of file on remote server

---
- name: change permission on remote
 hosts: all
 tasks:
 - name: change permission
   file:
     path: ~/photo.jpg
     owner: root
     group: root
     mode: 0666