Skip to content

Instantly share code, notes, and snippets.

@xbalaji
Last active February 24, 2021 04:28
Show Gist options
  • Save xbalaji/09232cc77ae8856a7126848b690ccc1f to your computer and use it in GitHub Desktop.
Save xbalaji/09232cc77ae8856a7126848b690ccc1f to your computer and use it in GitHub Desktop.
ansible-adhoc-facts
# get facts from a remote 'myhost.com' with ssh user root, password on prompt
ansible all -i 'myhost.com,' -m setup -u root -k
# Ansible playbook structure - create directories first, so you can run a single touch command
mkdir -p group_vars host_vars library filter_plugin roles/common/{tasks,handlers,templates,files,vars,defaults,meta}
touch ansible.cfg hosts.ini site.yml staging.ini production.ini roles/common/{tasks,handlers,templates,files,vars,defaults,meta}/main.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment