mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 22:40:12 +01:00
refact(e2e): load key's passphrase in dataset after node-power-failure test case
Signed-off-by: w3aman <aman.gupta@mayadata.io>
This commit is contained in:
parent
c0653530bd
commit
96ae41c094
4 changed files with 60 additions and 3 deletions
|
|
@ -25,12 +25,29 @@
|
|||
|
||||
- block:
|
||||
|
||||
- name: stop the {{ svc_type }} service on node where application pod is scheduled
|
||||
- name: stop the docker service on node where application pod is scheduled
|
||||
shell: >
|
||||
sshpass -p {{ node_pwd }} ssh -o StrictHostKeyChecking=no {{ user }}@{{ node_ip_add }}
|
||||
"echo {{ node_pwd }} | sudo -S su -c 'systemctl stop docker.socket'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
when: svc_type == "docker"
|
||||
|
||||
- name: stop the container runtime (if containerd, or crio) services on the application node
|
||||
shell: >
|
||||
sshpass -p {{ node_pwd }} ssh -o StrictHostKeyChecking=no {{ user }}@{{ node_ip_add }}
|
||||
"echo {{ node_pwd }} | sudo -S su -c 'systemctl stop {{ svc_type }}.service'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
when: svc_type == "containerd" or svc_type == "crio"
|
||||
|
||||
- name: stop the kubelet service on node where application pod is scheduled
|
||||
shell: >
|
||||
sshpass -p {{ node_pwd }} ssh -o StrictHostKeyChecking=no {{ user }}@{{ node_ip_add }}
|
||||
"echo {{ node_pwd }} | sudo -S su -c 'systemctl stop kubelet.service'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
when: svc_type == "kubelet"
|
||||
|
||||
- name: Check for the {{ svc_type }} service status
|
||||
shell: >
|
||||
|
|
@ -91,12 +108,29 @@
|
|||
|
||||
- block:
|
||||
|
||||
- name: Start the {{ svc_type }} services
|
||||
- name: Start the docker services
|
||||
shell: >
|
||||
sshpass -p {{ node_pwd }} ssh -o StrictHostKeyChecking=no {{ user }}@{{ node_ip_add }}
|
||||
"echo {{ node_pwd }} | sudo -S su -c 'systemctl start docker.socket'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
when: svc_type == "docker"
|
||||
|
||||
- name: Start the container runtime (if containerd, or crio) services
|
||||
shell: >
|
||||
sshpass -p {{ node_pwd }} ssh -o StrictHostKeyChecking=no {{ user }}@{{ node_ip_add }}
|
||||
"echo {{ node_pwd }} | sudo -S su -c 'systemctl start {{ svc_type }}.service'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
when: svc_type == "containerd" or svc_type == "crio"
|
||||
|
||||
- name: Start the kubelet services
|
||||
shell: >
|
||||
sshpass -p {{ node_pwd }} ssh -o StrictHostKeyChecking=no {{ user }}@{{ node_ip_add }}
|
||||
"echo {{ node_pwd }} | sudo -S su -c 'systemctl start kubelet.service'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
when: svc_type == "kubelet"
|
||||
|
||||
- name: Check for the {{ svc_type }} services status
|
||||
shell: >
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@ spec:
|
|||
- name: ZPOOL_NAME
|
||||
value: ''
|
||||
|
||||
- name: ZPOOL_ENCRYPTION_PASSWORD
|
||||
value: 'test1234'
|
||||
|
||||
- name: ESX_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
|
|
|
|||
|
|
@ -194,6 +194,24 @@
|
|||
delay: 10
|
||||
retries: 30
|
||||
|
||||
- name: Check encryption keystatus on node
|
||||
shell: >
|
||||
sshpass -p {{ node_pwd }} ssh -o StrictHostKeyChecking=no {{ user }}@{{ node_ip_add }} "zfs get keystatus | grep {{ zpool_name }}"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: keystatus
|
||||
failed_when: "keystatus.rc != 0"
|
||||
|
||||
- name: Load key's passphrase into datasets on the node
|
||||
shell: >
|
||||
sshpass -p {{ node_pwd }} ssh -o StrictHostKeyChecking=no {{ user }}@{{ node_ip_add }}
|
||||
"echo {{ node_pwd }} | sudo -S su -c 'echo {{ enc_pwd }} | zfs load-key -L prompt {{ zpool_name }}'"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: key_load_status
|
||||
failed_when: "key_load_status.rc != 0"
|
||||
when: "'unavailable' in keystatus.stdout"
|
||||
|
||||
- name: check the newly scheduled application pod status
|
||||
shell: kubectl get pod {{ new_app_pod }} -n {{ namespace }} --no-headers -o custom-columns=:.status.phase
|
||||
args:
|
||||
|
|
|
|||
|
|
@ -21,4 +21,6 @@ user: "{{ lookup('env','USERNAME') }}"
|
|||
|
||||
zpool_name: "{{ lookup('env','ZPOOL_NAME') }}"
|
||||
|
||||
enc_pwd: "{{ lookup('env','ZPOOL_ENCRYPTION_PASSWORD') }}"
|
||||
|
||||
node_pwd: "{{ lookup('env','NODE_PASSWORD') }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue