Ansible: A simple script example

This is a simple ansible playbook book.xml:

- hosts: localhost
  #remote_user: root
  become_method: sudo

  tasks:

  - name: Install Git
    package: name=git state=installed
    become: yes

  - name: Install xcowsay
    package: name=xcowsay state=installed
    become: yes

Execute the ansible script:

$ ansible-playbook -vv book.xml

Links