Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible tutorial/cheatsheet #17

Open
abitrolly opened this issue May 21, 2019 · 0 comments
Open

Ansible tutorial/cheatsheet #17

abitrolly opened this issue May 21, 2019 · 0 comments

Comments

@abitrolly
Copy link
Member

  1. Create inventory and ping all hosts
ansible -i inventory all -m ping
  1. Ping all hosts in internal network by connecting through machine with external IP
ansible -i inventory all --ssh-common-args='-o ProxyCommand="ssh -W %h:%p user@example.com"' -m ping

https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-configure-a-jump-host-to-access-servers-that-i-have-no-direct-access-to

  1. Append my SSH key to all hosts from inventory
ansible -i inventory all -m authorized_key -a "user=ubuntu key='https://gitlab.com/abitrolly.keys'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant