🟢mac上使用ansible控制多台ubuntu执行命令
pip install ansiblebrew install ansiblessh-keygen -t rsa -b 4096ssh-copy-id user@hostname[ubuntu_servers] server1 ansible_host=192.168.1.101 ansible_user=root server2 ansible_host=192.168.1.102 ansible_user=root--- - name: Execute command on multiple Ubuntu servers hosts: ubuntu_servers tasks: - name: Run a shell command shell: echo "Hello, World!"ansible-playbook -i /path/to/your/hosts playbook.yml
使用 Ansible Ad-Hoc 命令
Last updated