Step: ansible
-----------------------------------------------------------------------------

Run Ansible using a provided playbook, to configure the image. vmdb2
sets up Ansible so that it treats the image as the host being
configured (via the `chroot` connection). The image MUST have Python
installed (version 2 or 3 depending on Ansible version).

Step keys:

* `ansible` &mdash; REQUIRED; value is the tag of the root filesystem.

* `config_file` &mdash; OPTIONAL; value is the filename of an Ansible
  configuration file, relative to the .vmdb file.

* `group` &mdash; OPTIONAL; the name of the Ansible inventory group. Defaults
  to "image"

* `playbook` &mdash; REQUIRED; value is the filename of the Ansible
  playbook, relative to the .vmdb file.

* `tags` &mdash; OPTIONAL; a comma-separated list of Ansible tags to execute

* `extra_vars` &mdash; OPTIONAL; a dictionary defining variables to pass to the
  Ansible playbook.

Example (in the .vmdb file):

    - apt: install
      tag: root
      packages: [python]

    - ansible: root
      playbook: foo.yml
      tags: bar
      config_file: ansible.cfg
      group: AwesomeGroup
      extra_vars:
        iface:
          name: eth0

Example (`foo.yml`):

    - hosts: image
      tasks:

        - name: "set /etc/hostname"
          shell: |
            echo "{{ hostname }}" > /etc/hostname

        - name: "unset root password"
          shell: |
            sed -i '/^root:[^:]*:/s//root::/' /etc/passwd

        - name: "configure networking"
          copy:
            content: |
              auto {{ iface.name }}
              iface {{ iface.name }} inet dhcp
              iface {{ iface.name }} inet6 auto
            dest: /etc/network/interfaces.d/wired

      vars:
        hostname: discworld
