欢迎光临散文网 会员登陆 & 注册

初识Ansible

2023-03-22 08:41 作者:每天输出五分钟  | 我要投稿

初识Ansible

Control Node

Managed Nodes

Inventory

A list of files, define the managed nodes

The default location: /etc/ansible/hosts

Format of files:

INI

YAML

Run

Use Ad-Hoc command

$ ansible [pattern] -m [module] -a "[module options]"

Eg:

$ ansible webservers -a "/sbin/reboot"

$ ansible dbservers -m ansible.builtin.copy -a "src=/etc/hosts dest=/tmp/hosts"

Use Playbooks

Create playbook file

Run Playbook

$ ansible-playbook -i inventory.yaml playbook.yaml

Output


初识Ansible的评论 (共 条)

分享到微博请遵守国家法律