Ansible - localhost
Experiment with Ansible on localhost
Prepare a YAML-based inventory file
examples/ansible/localhost/inventory.yml
all: hosts: 127.0.0.1:
Create an Ansible configuration file
Telling Ansible where the inventory is.
examples/ansible/localhost/ansible.cfg
[defaults] deprecation_warnings = False inventory = inventory.yml host_key_checking = False #ask_pass = True
Make sure you can ssh to localhost:
cd ~/.ssh cat id_rsa.pub >> authorized_keys
Then you can start running commands:
ansible all -m ping ansible all -m ping
Published on 2021-03-16
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post