mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-29 22:03:22 -02:30
* ci: run the Ansible controller as an unprivileged user * ci: clarify non-root controller check * ci: make the sudo privilege check fail when sudo succeeds Bash does not apply errexit to the negated sudo command. The old check could not fail the job even when passwordless sudo worked. Exit explicitly when sudo succeeds. Remove --break-system-packages from both upgrade pip installs because they run inside the controller virtual environment.
34 lines
974 B
YAML
34 lines
974 B
YAML
---
|
|
- name: Provision Packet VMs
|
|
hosts: localhost
|
|
gather_facts: false
|
|
become: false
|
|
tasks:
|
|
- name: Create Kubevirt VMs
|
|
import_role:
|
|
name: packet-ci
|
|
- name: Update inventory for Molecule
|
|
meta: refresh_inventory
|
|
|
|
- name: Wait until SSH is available
|
|
hosts: all
|
|
become: false
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
# Check ssh access without relying on python - this is an horrible hack
|
|
# but wait_for_connection does not work without python
|
|
# and 'until' is incompatible with unreachable errors
|
|
# https://github.com/ansible/ansible/issues/78358
|
|
- name: Wait until SSH is available
|
|
command: >
|
|
ssh -i "{{ lookup('env', 'ANSIBLE_PRIVATE_KEY_FILE') }}"
|
|
-o StrictHostKeyChecking=no
|
|
-o UserKnownHostsFile=/dev/null
|
|
-o ConnectTimeout=3 "{{ lookup('env', 'ANSIBLE_REMOTE_USER') }}@{{ ansible_host }}"
|
|
register: ssh_command
|
|
delay: 0
|
|
until: ssh_command.rc != 255
|
|
retries: 60
|
|
delegate_to: localhost
|