Last active
February 25, 2021 16:21
-
-
Save bneutra/39b8d7036a5f8c593c1d9ef616978429 to your computer and use it in GitHub Desktop.
testing ansible commands with a simple local playbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Here's a basic example if you want to just test out ansible commands on | |
# your localhost (without the complexity of ssh). Note: this assumes you | |
# have a properly installed ansible. | |
# e.g. install py 3.6.4. with pyenv and pip install ansible | |
# To run these tasks (you may need to run as sudo): | |
# ansible-playbook [this_file.yml] | |
- name: run the playbook tasks on the localhost | |
hosts: 127.0.0.1 | |
connection: local | |
become: yes | |
tasks: | |
- name: touch a file | |
file: | |
state: touch | |
path: "/tmp/testfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment