## 分发密钥
ansible all -m authorized_key -a "user=root key='{{ lookup('file', '/root/.ssh/id_rsa.pub') }}'"
简单使用
批量设置主机名为资产名
ansible all -m shell -a 'hostnamectl set-hostname {{inventory_hostname}}'
ansible all -m shell -a 'echo "{{ansible_ssh_host}} {{inventory_hostname}}" >> /etc/hosts'