- 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
    - 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
    - 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"

Split roles after unbound into own play
Split roles after unbound into own play

This is because we actually want unbound to finish reloading before
running any other roles. Without this, we only restart unbound after
all roles have run.

This is to help debug an issue in fedora, where we cannot traceroute
to git.o.o properly, and think we are failing to resolve DNS properly.

  http://logs.openstack.org/47/586847/1/gate/windmill-fedora-27/2f06941/job-output.txt.gz

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