Ansible example

Just dropping this here as a starter/reminder about Ansible. This isn’t even scratching the surface, and more than likely not the best or only way. Hopefully, I come back periodically to revise and refine.

# hello_world.yml
- name: Hello World Sample
  hosts: all
  tasks:
    - name: Hello Message
      debug:
        msg: "Hello World!"

To run the playbook locally, call it with the following command:

ansible-playbook hello_world.yml --connection=local -i 127.0.0.1,

If the playbook requires elevated privileges through become, use the -K parameter to prompt for the become password.

ansible-playbook hello_world.yml --connection=local -i 127.0.0.1, -K


Posted

in

,

by