mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 09:38:12 -03:30
Fix ansible-lint E301 for commands fetching data (#6465)
This commit is contained in:
@@ -29,8 +29,9 @@
|
||||
loop_control:
|
||||
index_var: vm_id
|
||||
|
||||
- name: Wait for vms to have ipaddress assigned # noqa 301 306
|
||||
- name: Wait for vms to have ipaddress assigned # noqa 306
|
||||
shell: "kubectl get vmis -n {{ test_name }} instance-{{ vm_id }} -o json | jq '.status.interfaces[].ipAddress' | tr -d '\"'"
|
||||
changed_when: false
|
||||
register: vm_ips
|
||||
loop: "{{ range(1, vm_count|int + 1, 1) | list }}"
|
||||
loop_control:
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
expire_days: 2
|
||||
|
||||
tasks:
|
||||
- name: Generate uniq bucket name prefix # noqa 301
|
||||
- name: Generate uniq bucket name prefix
|
||||
raw: date +%Y%m%d
|
||||
changed_when: false
|
||||
register: out
|
||||
|
||||
- name: replace_test_id
|
||||
|
||||
@@ -15,16 +15,18 @@
|
||||
- import_role:
|
||||
name: cluster-dump
|
||||
|
||||
- name: Check kubectl output # noqa 301 305
|
||||
- name: Check kubectl output # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl get nodes"
|
||||
changed_when: false
|
||||
register: get_nodes
|
||||
no_log: true
|
||||
|
||||
- debug:
|
||||
msg: "{{ get_nodes.stdout.split('\n') }}"
|
||||
|
||||
- name: Check that all nodes are running and ready # noqa 301 305
|
||||
- name: Check that all nodes are running and ready # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl get nodes --no-headers -o yaml"
|
||||
changed_when: false
|
||||
register: get_nodes_yaml
|
||||
until:
|
||||
# Check that all nodes are Status=Ready
|
||||
|
||||
@@ -15,16 +15,18 @@
|
||||
- import_role:
|
||||
name: cluster-dump
|
||||
|
||||
- name: Check kubectl output # noqa 301 305
|
||||
- name: Check kubectl output # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
||||
changed_when: false
|
||||
register: get_pods
|
||||
no_log: true
|
||||
|
||||
- debug:
|
||||
msg: "{{ get_pods.stdout.split('\n') }}"
|
||||
|
||||
- name: Check that all pods are running and ready # noqa 301 305
|
||||
- name: Check that all pods are running and ready # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl get pods --all-namespaces --no-headers -o yaml"
|
||||
changed_when: false
|
||||
register: run_pods_log
|
||||
until:
|
||||
# Check that all pods are running
|
||||
@@ -36,8 +38,9 @@
|
||||
failed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Check kubectl output # noqa 301 305
|
||||
- name: Check kubectl output # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
||||
changed_when: false
|
||||
register: get_pods
|
||||
no_log: true
|
||||
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
- name: Create test namespace # noqa 301 305
|
||||
shell: "{{ bin_dir }}/kubectl create namespace test"
|
||||
|
||||
- name: Run 2 busybox pods in test ns # noqa 301 305
|
||||
- name: Run 2 busybox pods in test ns # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl run {{ item }} --image={{ test_image_repo }}:{{ test_image_tag }} --namespace test --command -- tail -f /dev/null"
|
||||
changed_when: false
|
||||
loop:
|
||||
- busybox1
|
||||
- busybox2
|
||||
@@ -27,8 +28,9 @@
|
||||
- import_role:
|
||||
name: cluster-dump
|
||||
|
||||
- name: Check that all pods are running and ready # noqa 301 305
|
||||
- name: Check that all pods are running and ready # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl get pods --namespace test --no-headers -o yaml"
|
||||
changed_when: false
|
||||
register: run_pods_log
|
||||
until:
|
||||
# Check that all pods are running
|
||||
@@ -40,8 +42,9 @@
|
||||
failed_when: false
|
||||
no_log: true
|
||||
|
||||
- name: Get pod names # noqa 301 305
|
||||
- name: Get pod names # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl get pods -n test -o json"
|
||||
changed_when: false
|
||||
register: pods
|
||||
no_log: true
|
||||
|
||||
@@ -49,20 +52,23 @@
|
||||
msg: "{{ pods.stdout.split('\n') }}"
|
||||
failed_when: not run_pods_log is success
|
||||
|
||||
- name: Get hostnet pods # noqa 301
|
||||
- name: Get hostnet pods
|
||||
command: "{{ bin_dir }}/kubectl get pods -n test -o
|
||||
jsonpath='{range .items[?(.spec.hostNetwork)]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'"
|
||||
changed_when: false
|
||||
register: hostnet_pods
|
||||
no_log: true
|
||||
|
||||
- name: Get running pods # noqa 301
|
||||
- name: Get running pods
|
||||
command: "{{ bin_dir }}/kubectl get pods -n test -o
|
||||
jsonpath='{range .items[?(.status.phase==\"Running\")]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'"
|
||||
changed_when: False
|
||||
register: running_pods
|
||||
no_log: true
|
||||
|
||||
- name: Check kubectl output # noqa 301 305
|
||||
- name: Check kubectl output # noqa 305
|
||||
shell: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
||||
changed_when: False
|
||||
register: get_pods
|
||||
no_log: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user