ansible模块官方手册
模块筛选
$ ansible-doc -l | grep 'copy'
vsphere_copy Copy a file to a VMware datastore
win_copy Copies files to remote locations on windows hosts
bigip_file_copy Manage files in datastores on a BIG-IP
ec2_ami_copy copies AMI between AWS regions, return new image id
win_robocopy Synchronizes the contents of two directories using Robocopy
copy Copy files to remote locations
na_ontap_lun_copy NetApp ONTAP copy LUNs
icx_copy Transfer files from or to remote Ruckus ICX 7000 series switches
unarchive Unpacks an archive after (optionally) copying it from the local machine
postgresql_copy Copy data between a file/program and a PostgreSQL table
ec2_snapshot_copy copies an EC2 snapshot and returns the new Snapshot ID
nxos_file_copy Copy a file to a remote NXOS device
netapp_e_volume_copy NetApp E-Series create volume copy pairs
详细的模块描述手册
ansible-doc copy
只包含模块参数用法的模块描述手册
ansible-doc -s copy
连接行为变量
常见的解释
yaml与json格式转换
也可以用yq将yaml转换成json 格式。
ansible关于lookup的插件
ansible支持的magic variables
sh模式下没有ip ifconfig 命令如何看IP?
hostname -I | awk ‘{print $1}’
没有telnet 工具如何测试端口?
(echo >/dev/tcp/172.18.0.1/6666) &>/dev/null && echo "open" || echo "closed"
开放 open
未开放 closed
ansible告警
[WARNING]: Platform linux on host node3 is using the discovered Python interpreter at /usr/bin/python3.7, but future installation of
another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
处理方式
关闭告警
vim /etc/ansible/ansible.cfg
[defaults]
interpreter_python=auto_silent
debain ansible所有版本
https://packages.debian.org/buster-backports/all/ansible/download
ansible rpm包所有版本
https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/
评论区