- hosts: localhost
  roles:
    - role: emit-job-header
      zuul_log_url: "http://logs.openstack.org"

- hosts: all
  pre_tasks:
    # NOTE(pabelanger): Until we hit the validate-host role, we have a minimal
    # set of ansible variables collected by zuul-executor. This doesn't include
    # network variables (ansible_default_ipv4 / ansible_default_ipv6) so gather
    # these variables as they are important to the configure-unbound role.
    - name: Gather network facts
      setup:
        gather_subset: 'network'

  roles:
    - add-build-sshkey
    - start-zuul-console
    - log-inventory
    - configure-unbound
    # NOTE(pabelanger): Do not add any more roles after configure-unbound, this
    # is because we want unbound to actually restart before doing anything else
    # to the node. And with handlers in ansible, they are the last thing to run
    # in a play.

- hosts: all
  roles:
    - validate-host
    - use-cached-repos
    - mirror-workspace-git-repos
    - mirror-info
    - role: configure-mirrors
      set_apt_mirrors_trusted: True
    - role: fetch-zuul-cloner
      destination: "/usr/zuul-env/bin/zuul-cloner"
      repo_src_dir: "/home/zuul/src/git.openstack.org"

- hosts: localhost
  roles:
    - role: emit-job-header
      zuul_log_url: "http://logs.openstack.org"

- hosts: all
  pre_tasks:
    # NOTE(pabelanger): Until we hit the validate-host role, we have a minimal
    # set of ansible variables collected by zuul-executor. This doesn't include
    # network variables (ansible_default_ipv4 / ansible_default_ipv6) so gather
    # these variables as they are important to the configure-unbound role.
    - name: Gather network facts
      setup:
        gather_subset: 'network'

  roles:
    - add-build-sshkey
    - start-zuul-console
    - log-inventory

- hosts: all
  roles:
    # NOTE(pabelanger): We run this role in its own play to ensure unbound is
    # restarted before proceeding with any other role.  This is because of
    # how handlers work in ansible.
    - configure-unbound

- hosts: all
  roles:
    - validate-host
    - use-cached-repos
    - mirror-workspace-git-repos
    - mirror-info
    - role: configure-mirrors
      set_apt_mirrors_trusted: True
    - role: fetch-zuul-cloner
      destination: "/usr/zuul-env/bin/zuul-cloner"
      repo_src_dir: "/home/zuul/src/git.openstack.org"

Move configure-unbound into its own play
Move configure-unbound into its own play

Clean up pre.yaml based on previous comments.

Change-Id: I1db6ba6b2bd974d2b78626ae0005190e4784a938
Signed-off-by: Paul Belanger <e7139c8e6c4ea75cc1c287ce081b2dc0f3ab39ec@redhat.com>
