# 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. --- - name: Include prerequisites tasks include_tasks: file: prerequisites.yaml - name: Configure /etc/hosts template: src: files/hosts dest: /etc/hosts - name: Deploy Containerd include_tasks: file: containerd.yaml - name: Common K8s tasks include_tasks: file: common_k8s.yaml - name: Include control-plane tasks include_tasks: file: control-plane.yaml when: inventory_hostname == 'primary' - name: Join workload nodes to cluster command: "{{ hostvars['primary']['join_command'].stdout_lines[0] }}" when: inventory_hostname in (groups['nodes'] | default([])) - name: Wait for cluster is ready become: false block: - name: Sleep 10 before checking calico nodes pause: seconds: 10 - name: Wait for Calico pods ready command: kubectl -n kube-system wait --timeout=240s --for=condition=Ready pods -l k8s-app=calico-node when: inventory_hostname == 'primary' - name: Add coredns to /etc/resolv.conf lineinfile: line: nameserver 10.96.0.10 path: /etc/resolv.conf state: present insertbefore: "BOF" - name: Loop devices include_tasks: file: loopback_devices.yaml when: loopback_setup ...