Playbook #1

/root/kubeinit/ci/builds/bsU8uCNn/0/kubeinit/kubeinit/kubeinit-aux/kubeinit/playbook.yml

Report Status CLI Date Duration Controller User Versions Hosts Plays Tasks Results Files Records
28 Mar 2024 09:21:02 +0000 00:13:07.58 nyctea root Ansible 2.15.2 ara 1.6.1 (client), 1.6.1 (server) Python 3.11.4 7 10 778 845 48 1

File: /root/.ansible/collections/ansible_collections/kubeinit/kubeinit/roles/kubeinit_validations/tasks/main.yml

---
# Copyright kubeinit contributors
# All Rights Reserved.
#
# 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: Cleanup the hypervisors and stop the deployment if required
  block:
    - name: Cleanup hypervisors if needed
      ansible.builtin.include_role:
        name: kubeinit.kubeinit.kubeinit_libvirt
        tasks_from: cleanup_hypervisors.yml
        public: true
      vars:
        hypervisors_cleaned: "{{ 'kubeinit_facts' in groups }}"
      when: not hypervisors_cleaned

    - name: Gather hosts facts and stop the deployment if required
      block:
        - name: "Stop before 'task-run-validations' when requested"
          ansible.builtin.add_host:
            name: "kubeinit-facts"
            playbook_terminated: true
        - name: End play
          ansible.builtin.meta: end_play
      when: kubeinit_stop_before_task is defined and kubeinit_stop_before_task == 'task-run-validations'
  tags: omit_from_grapher

#
# Include Libvirt validations
#

- name: Check that the hypervisor has enough disk space
  ansible.builtin.include_tasks: 10_libvirt_free_space.yml

- name: Check that the hypervisor has enough RAM
  ansible.builtin.include_tasks: 20_libvirt_available_ram.yml

- name: Check that the hypervisor has enough cores
  ansible.builtin.include_tasks: 30_libvirt_check_cpu_cores.yml

- name: Gather hosts facts and stop the deployment if required
  block:
    - name: Add task-run-validations to tasks_completed
      ansible.builtin.add_host:
        name: "kubeinit-facts"
        tasks_completed: "{{ kubeinit_facts_hostvars.tasks_completed | union(['task-run-validations']) }}"

    - name: Update kubeinit_facts_hostvars
      ansible.builtin.set_fact:
        kubeinit_facts_hostvars: "{{ hostvars['kubeinit-facts'] }}"

    - name: Stop the deployment if required
      block:
        - name: Stop after 'task-run-validations' when requested
          ansible.builtin.add_host:
            name: "kubeinit-facts"
            playbook_terminated: true
        - name: End play
          ansible.builtin.meta: end_play
      when: kubeinit_stop_after_task is defined and kubeinit_stop_after_task in kubeinit_facts_hostvars.tasks_completed
  tags: omit_from_grapher