diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index 696c99f..325df15 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -3,7 +3,8 @@ inventory = inventory.ini host_key_checking = False retry_files_enabled = False roles_path = roles -stdout_callback = yaml +stdout_callback = default +result_format = yaml interpreter_python = auto_silent [privilege_escalation] diff --git a/ansible/roles/bootstrap-image-prepull/tasks/main.yml b/ansible/roles/bootstrap-image-prepull/tasks/main.yml index 17507ca..87565e0 100644 --- a/ansible/roles/bootstrap-image-prepull/tasks/main.yml +++ b/ansible/roles/bootstrap-image-prepull/tasks/main.yml @@ -1,15 +1,19 @@ --- - name: Pre-pull bootstrap images into containerd - command: /usr/local/bin/ctr -n k8s.io images pull {{ item }} + command: timeout 180s /usr/local/bin/ctr -n k8s.io images pull {{ item }} register: bootstrap_image_pull loop: "{{ bootstrap_prepull_images }}" + retries: 6 + delay: 20 + until: bootstrap_image_pull.rc == 0 changed_when: bootstrap_image_pull.rc == 0 failed_when: false -- name: Report bootstrap images that did not pre-pull +- name: Report bootstrap images that did not pre-pull after retries debug: msg: >- - Bootstrap image pre-pull failed for {{ item.item }}: {{ item.stderr | default('no stderr') }} + Best-effort bootstrap image pre-pull did not complete for {{ item.item }} after + {{ item.attempts | default(1) }} attempt(s): {{ item.stderr | default('no stderr') }} loop: "{{ bootstrap_image_pull.results | default([]) }}" loop_control: label: "{{ item.item }}" diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index 4811500..ace04fd 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -50,9 +50,9 @@ changed_when: true - name: Remove swap from fstab - mount: - name: swap - fstype: swap + lineinfile: + path: /etc/fstab + regexp: '^\s*[^#]\S+\s+\S+\s+swap\s+.*$' state: absent - name: Load br_netfilter module