Use common playbook to wait for SSH (#4734)
This commit is contained in:
parent
787a9c74fa
commit
5e3bd2dff1
7 changed files with 17 additions and 38 deletions
|
@ -37,6 +37,7 @@
|
||||||
CI_PLATFORM: tf
|
CI_PLATFORM: tf
|
||||||
script:
|
script:
|
||||||
- cd tests && make create-${CI_PLATFORM} -s ; cd -
|
- cd tests && make create-${CI_PLATFORM} -s ; cd -
|
||||||
|
- ansible-playbook tests/cloud_playbooks/wait-for-ssh.yml
|
||||||
- ansible-playbook cluster.yml --become
|
- ansible-playbook cluster.yml --become
|
||||||
# - tests/scripts/testcases_prepare.sh
|
# - tests/scripts/testcases_prepare.sh
|
||||||
after_script:
|
after_script:
|
||||||
|
|
|
@ -22,12 +22,3 @@
|
||||||
template:
|
template:
|
||||||
src: ../templates/inventory-aws.j2
|
src: ../templates/inventory-aws.j2
|
||||||
dest: "{{ inventory_path }}"
|
dest: "{{ inventory_path }}"
|
||||||
|
|
||||||
- name: Wait until SSH is available
|
|
||||||
wait_for:
|
|
||||||
host: "{{ item.public_ip }}"
|
|
||||||
port: 22
|
|
||||||
timeout: 300
|
|
||||||
state: started
|
|
||||||
delegate_to: localhost
|
|
||||||
with_items: "{{ ec2.instances }}"
|
|
||||||
|
|
|
@ -90,8 +90,3 @@
|
||||||
src: ../templates/inventory-do.j2
|
src: ../templates/inventory-do.j2
|
||||||
dest: "{{ inventory_path }}"
|
dest: "{{ inventory_path }}"
|
||||||
when: state == 'present'
|
when: state == 'present'
|
||||||
|
|
||||||
- name: Wait for SSH to come up
|
|
||||||
wait_for: host={{ item.droplet.ip_address }} port=22 delay=10 timeout=180 state=started
|
|
||||||
with_items: "{{ droplets.results }}"
|
|
||||||
when: state == 'present'
|
|
||||||
|
|
|
@ -71,16 +71,3 @@
|
||||||
state: absent
|
state: absent
|
||||||
recurse: yes
|
recurse: yes
|
||||||
when: delete_group_vars
|
when: delete_group_vars
|
||||||
|
|
||||||
- name: Wait for instances
|
|
||||||
hosts: "waitfor_hosts"
|
|
||||||
gather_facts: false
|
|
||||||
tasks:
|
|
||||||
- name: Wait for SSH to come up.
|
|
||||||
wait_for:
|
|
||||||
host: "{{ inventory_hostname }}"
|
|
||||||
port: 22
|
|
||||||
delay: 60
|
|
||||||
timeout: 240
|
|
||||||
state: started
|
|
||||||
delegate_to: localhost
|
|
||||||
|
|
|
@ -40,16 +40,6 @@
|
||||||
until:
|
until:
|
||||||
- vm_ips.stdout | ipaddr
|
- vm_ips.stdout | ipaddr
|
||||||
|
|
||||||
- name: Wait for SSH to become available on vms
|
|
||||||
wait_for:
|
|
||||||
host: "{{ item.stdout }}"
|
|
||||||
port: 22
|
|
||||||
delay: 30
|
|
||||||
timeout: 240
|
|
||||||
state: started
|
|
||||||
with_items:
|
|
||||||
- "{{ vm_ips.results }}"
|
|
||||||
|
|
||||||
- name: "Create inventory for CI test in file /tmp/{{ test_name }}/inventory"
|
- name: "Create inventory for CI test in file /tmp/{{ test_name }}/inventory"
|
||||||
template:
|
template:
|
||||||
src: "inventory.j2"
|
src: "inventory.j2"
|
||||||
|
|
12
tests/cloud_playbooks/wait-for-ssh.yml
Normal file
12
tests/cloud_playbooks/wait-for-ssh.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
become: False
|
||||||
|
gather_facts: False
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Wait until SSH is available
|
||||||
|
wait_for:
|
||||||
|
host: "{{ ansible_ssh_host }}"
|
||||||
|
port: 22
|
||||||
|
timeout: 240
|
||||||
|
delegate_to: localhost
|
|
@ -7,12 +7,15 @@ echo "PYPATH is $PYPATH"
|
||||||
pwd
|
pwd
|
||||||
ls
|
ls
|
||||||
echo ${PWD}
|
echo ${PWD}
|
||||||
cd tests && make create-${CI_PLATFORM} -s ; cd -
|
|
||||||
|
|
||||||
export ANSIBLE_REMOTE_USER=$SSH_USER
|
export ANSIBLE_REMOTE_USER=$SSH_USER
|
||||||
export ANSIBLE_BECOME=true
|
export ANSIBLE_BECOME=true
|
||||||
export ANSIBLE_BECOME_USER=root
|
export ANSIBLE_BECOME_USER=root
|
||||||
|
|
||||||
|
cd tests && make create-${CI_PLATFORM} -s ; cd -
|
||||||
|
ansible-playbook tests/cloud_playbooks/wait-for-ssh.yml
|
||||||
|
|
||||||
|
|
||||||
# Check out latest tag if testing upgrade
|
# Check out latest tag if testing upgrade
|
||||||
test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout "$KUBESPRAY_VERSION"
|
test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout "$KUBESPRAY_VERSION"
|
||||||
# Checkout the CI vars file so it is available
|
# Checkout the CI vars file so it is available
|
||||||
|
|
Loading…
Reference in a new issue