# Copyright 2020 The Kubernetes Authors.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- hosts: all
  become: yes
  vars:
    firstboot_custom_roles_pre: ""
    firstboot_custom_roles_post: ""

  tasks:
    - include_role:
        name: "{{ role }}"
      loop: "{{ firstboot_custom_roles_pre.split() }}"
      loop_control:
        loop_var: role
      when: firstboot_custom_roles_pre != ""
    - include_role:
        name: firstboot
    - include_role:
        name: "{{ role }}"
      loop: "{{ firstboot_custom_roles_post.split() }}"
      loop_control:
        loop_var: role
      when: firstboot_custom_roles_post != ""

  environment:
    http_proxy: "{{ http_proxy | default('') }}"
    https_proxy: "{{ https_proxy | default('') }}"
    no_proxy: "{{ no_proxy | default('') }}"
    HTTP_PROXY: "{{ http_proxy | default('') }}"
    HTTPS_PROXY: "{{ https_proxy | default('') }}"
    NO_PROXY: "{{ no_proxy | default('') }}"