Get the App
SLTechnology News&Howtos  ›  Servers  › 

Ansible is easy to use

Shulou Source: shulou.com Published: 2022-06-03 08:38:52 12月06日 Update

Copy files from the control host to the local (fetch), and then copy the files from the local to the remote control host copy

Copy the file from the control host to the local and extract it to the remote host fetch unarchive

Tasks:

The meaning of implementing tasks:

Trigger notify handlers

Tag tag

Variables of type facts

Custom variables in the command line of the ansible-playbook command if you want to specify more than one variable, you can boot with multiple-e

Two remote hosts (remote host) transfer data to each other: reference: https://www.cnblogs.com/xiaoxiaoleo/p/6626299.html

-name: Transfer file from ServerB to ServerA shell: scp-r / path/on/server_b node@ServerA:/path/on/server_a ignore_errors: True delegate_to: ServerB

Example:

Custom variable

Tags: Host variable file control command multiple two example meaning data label type trigger remote control transmission reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Huawei NVidia Apple Xiaomi