- Ansible Quick Start Guide
- Mohamed Alibi
- 87字
- 2021-07-23 16:37:47
ad-hoc versus playbook: the copy module
The Ansible copy module can be used in ad hoc mode to quickly run a copy job:
ansible servers -m copy --args="src=./file1.txt dest=~/file1.txt"
The output of this command should look as follows:
Alternatively, this can be used in a playbook with various options for a personalized result:
---
- name: copy a file to hosts
hosts: servers
become: true
fast_gathering: false
tasks:
- name: copy a file to the home directory of a user
copy:
src: ./file1.txt
dest: ~/file1.txt
owner: setup
mode: 0766
推薦閱讀
- 大學(xué)計(jì)算機(jī)信息技術(shù)導(dǎo)論
- 構(gòu)建高質(zhì)量的C#代碼
- 高性能混合信號(hào)ARM:ADuC7xxx原理與應(yīng)用開(kāi)發(fā)
- Getting Started with Clickteam Fusion
- 計(jì)算機(jī)原理
- 手把手教你學(xué)AutoCAD 2010
- Mobile DevOps
- Visual C# 2008開(kāi)發(fā)技術(shù)詳解
- 網(wǎng)絡(luò)綜合布線技術(shù)
- 傳感器技術(shù)應(yīng)用
- 工業(yè)機(jī)器人運(yùn)動(dòng)仿真編程實(shí)踐:基于Android和OpenGL
- Docker on Amazon Web Services
- 電腦上網(wǎng)入門
- Photoshop CS4數(shù)碼照片處理入門、進(jìn)階與提高
- 機(jī)器人剛?cè)狁詈蟿?dòng)力學(xué)