[Ansible] Login server with custom SSH Information
Create file ansible_hosts with below content:
[server]
104.207.128.XX ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=133112
52.74.36.XX ansible_ssh_port=22 ansible_ssh_user=ec2-user ansible_ssh_pass=133112
[webserver]
104.207.128.XX ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=133112
[email]
52.74.36.XX ansible_ssh_port=22 ansible_ssh_user=ec2-user ansible_ssh_pass=133112
Then run the ansible-playbook command
# ansible-playbook -i ansible_hosts ping.yml
[server]
104.207.128.XX ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=133112
52.74.36.XX ansible_ssh_port=22 ansible_ssh_user=ec2-user ansible_ssh_pass=133112
[webserver]
104.207.128.XX ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass=133112
[email]
52.74.36.XX ansible_ssh_port=22 ansible_ssh_user=ec2-user ansible_ssh_pass=133112
Then run the ansible-playbook command
# ansible-playbook -i ansible_hosts ping.yml
Nhận xét
Đăng nhận xét