- 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
推薦閱讀
- 大學計算機信息技術(shù)導論
- 機器學習實戰(zhàn):基于Sophon平臺的機器學習理論與實踐
- Practical Data Analysis
- 機器自動化控制器原理與應(yīng)用
- Supervised Machine Learning with Python
- PostgreSQL 10 Administration Cookbook
- 深度學習與目標檢測
- Bayesian Analysis with Python
- 云計算和大數(shù)據(jù)的應(yīng)用
- Hands-On Data Warehousing with Azure Data Factory
- 實戰(zhàn)Windows Azure
- 軟測之魂
- 暗戰(zhàn)強人:黑客攻防入門全程圖解
- 百度智能小程序:AI賦能新機遇
- 商業(yè)周刊/中文版·天地無人:無人技術(shù)專刊(商業(yè)周刊/中文版)