fix(ansible): fix lint

This commit is contained in:
Timothy Stewart 2022-08-28 16:42:07 -05:00
parent 611cf5ab0b
commit 47ac514dc6
3 changed files with 17 additions and 0 deletions

View File

@ -9,6 +9,7 @@
- name: Clean previous runs of k3s-init - name: Clean previous runs of k3s-init
command: systemctl reset-failed k3s-init command: systemctl reset-failed k3s-init
failed_when: false failed_when: false
changed_when: false
args: args:
warn: false # The ansible systemd module does not support reset-failed warn: false # The ansible systemd module does not support reset-failed
@ -58,6 +59,7 @@
until: nodes.rc == 0 and (nodes.stdout.split() | length) == (groups['master'] | length) until: nodes.rc == 0 and (nodes.stdout.split() | length) == (groups['master'] | length)
retries: "{{ retry_count | default(20) }}" retries: "{{ retry_count | default(20) }}"
delay: 10 delay: 10
changed_when: false
always: always:
- name: Kill the temporary service used for initialization - name: Kill the temporary service used for initialization
systemd: systemd:

View File

@ -42,24 +42,28 @@
- name: Apply metallb-system namespace - name: Apply metallb-system namespace
command: >- command: >-
k3s kubectl apply -f /tmp/k3s/metallb-namespace.yaml k3s kubectl apply -f /tmp/k3s/metallb-namespace.yaml
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
- name: Test metallb-system namespace - name: Test metallb-system namespace
command: >- command: >-
k3s kubectl -n metallb-system k3s kubectl -n metallb-system
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
- name: Apply metallb crds and service - name: Apply metallb crds and service
command: >- command: >-
k3s kubectl apply -f /tmp/k3s/metallb.yaml k3s kubectl apply -f /tmp/k3s/metallb.yaml
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
- name: Wait for metallb controller to be running - name: Wait for metallb controller to be running
command: >- command: >-
kubectl wait deployment -n metallb-system controller --for condition=Available=True --timeout=60s kubectl wait deployment -n metallb-system controller --for condition=Available=True --timeout=60s
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
@ -67,6 +71,7 @@
command: >- command: >-
kubectl wait -n metallb-system --for=jsonpath='{.status.phase}'=Running pods \ kubectl wait -n metallb-system --for=jsonpath='{.status.phase}'=Running pods \
--selector component=controller --timeout=60s --selector component=controller --timeout=60s
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
@ -79,6 +84,7 @@
command: >- command: >-
kubectl wait pods -n metallb-system --for condition=Ready \ kubectl wait pods -n metallb-system --for condition=Ready \
--selector component=controller,app=metallb --timeout=60s --selector component=controller,app=metallb --timeout=60s
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
@ -86,6 +92,7 @@
command: >- command: >-
kubectl wait -n metallb-system --for=jsonpath='{.status.readyReplicas}'=1 replicasets \ kubectl wait -n metallb-system --for=jsonpath='{.status.readyReplicas}'=1 replicasets \
--selector component=controller,app=metallb --timeout=60s --selector component=controller,app=metallb --timeout=60s
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
@ -93,6 +100,7 @@
command: >- command: >-
kubectl wait -n metallb-system --for=jsonpath='{.status.fullyLabeledReplicas}'=1 replicasets \ kubectl wait -n metallb-system --for=jsonpath='{.status.fullyLabeledReplicas}'=1 replicasets \
--selector component=controller,app=metallb --timeout=60s --selector component=controller,app=metallb --timeout=60s
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
@ -100,30 +108,35 @@
command: >- command: >-
kubectl wait -n metallb-system --for=jsonpath='{.status.availableReplicas}'=1 replicasets \ kubectl wait -n metallb-system --for=jsonpath='{.status.availableReplicas}'=1 replicasets \
--selector component=controller,app=metallb --timeout=60s --selector component=controller,app=metallb --timeout=60s
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
- name: Test metallb-system webhook-service endpoint - name: Test metallb-system webhook-service endpoint
command: >- command: >-
k3s kubectl -n metallb-system get endpoints webhook-service k3s kubectl -n metallb-system get endpoints webhook-service
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
- name: Apply metallb CRs - name: Apply metallb CRs
command: >- command: >-
k3s kubectl apply -f /tmp/k3s/metallb-crs.yaml k3s kubectl apply -f /tmp/k3s/metallb-crs.yaml
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
- name: Test metallb-system IPAddressPool - name: Test metallb-system IPAddressPool
command: >- command: >-
k3s kubectl -n metallb-system get IPAddressPool k3s kubectl -n metallb-system get IPAddressPool
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true
- name: Test metallb-system L2Advertisement - name: Test metallb-system L2Advertisement
command: >- command: >-
k3s kubectl -n metallb-system get L2Advertisement k3s kubectl -n metallb-system get L2Advertisement
changed_when: false
with_items: "{{ groups['master'] }}" with_items: "{{ groups['master'] }}"
run_once: true run_once: true

View File

@ -3,11 +3,13 @@
command: grep -E "Raspberry Pi|BCM2708|BCM2709|BCM2835|BCM2836" /proc/cpuinfo command: grep -E "Raspberry Pi|BCM2708|BCM2709|BCM2835|BCM2836" /proc/cpuinfo
register: grep_cpuinfo_raspberrypi register: grep_cpuinfo_raspberrypi
failed_when: false failed_when: false
changed_when: false
- name: Test for raspberry pi /proc/device-tree/model - name: Test for raspberry pi /proc/device-tree/model
command: grep -E "Raspberry Pi" /proc/device-tree/model command: grep -E "Raspberry Pi" /proc/device-tree/model
register: grep_device_tree_model_raspberrypi register: grep_device_tree_model_raspberrypi
failed_when: false failed_when: false
changed_when: false
- name: Set raspberry_pi fact to true - name: Set raspberry_pi fact to true
set_fact: set_fact: