---
- import_tasks: verify-settings.yml
  when:
  - not dns_late
  tags:
  - asserts

# This is run before bin_dir is pinned because these tasks are run on localhost
- import_tasks: pre_upgrade.yml
  run_once: true
  when:
  - not dns_late
  tags:
  - upgrade

- import_tasks: set_facts.yml
  when:
  - not dns_late
  tags:
  - resolvconf
  - facts

- import_tasks: create_directories.yml
  when:
  - not dns_late

- import_tasks: resolvconf.yml
  when:
  - dns_mode != 'none'
  - resolvconf_mode == 'host_resolvconf'
  tags:
  - bootstrap-os
  - resolvconf

- import_tasks: dhclient-hooks.yml
  when:
  - dns_mode != 'none'
  - resolvconf_mode == 'host_resolvconf'
  - not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  tags:
  - bootstrap-os
  - resolvconf

- import_tasks: dhclient-hooks-undo.yml
  when:
  - dns_mode != 'none'
  - resolvconf_mode != 'host_resolvconf'
  - not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
  tags:
  - bootstrap-os
  - resolvconf

# We need to make sure the network is restarted early enough so that docker can later pick up the correct system
# nameservers and search domains
- meta: flush_handlers
