Closed torsina closed 1 month ago
If it helps I am on a bootstrap node also on hetzner on ubuntu that I haven't touched apart from installing ansible, git and setting up my ssh key
Are you waiting for the server to be booted and listening for connections before tying to connect to it?
I recommend adding the following task at the end of a playbook that creates servers:
- name: Wait to become reachable
ansible.builtin.wait_for_connection:
You could replace the following task with what I suggested above:
- name: Ensure the server is started
async: 45
poll: 0
hetzner.hcloud.server:
name: "{{item.server_name}}"
state: started
api_token: "{{item.api_token}}"
Summary
I have a first play that creates a set of node to create a k8 cluster, the first play takes care of creting the servers (hetzner), as well as using add_host for the next play to use said servers
but said servers refuses to connect to said servers via ssh while I can ssh into those servers at the same time if I type the command ssh manually the first action that Ansible wants to do with said server leads to a crash, the server be it in rescue mode or not. I tried running the playbook in sudo, but that didn't change anything
I an running on a bootstrap server from hetzner as to have a reproducible environement, I copied my ssh key on that server
Issue Type
Bug Report
Component Name
hcloud
Ansible Version
Configuration
OS / Environment
Ubuntu 22
Steps to Reproduce
very long gist, removed secrets like private keys or vault secrets https://gist.github.com/torsina/0b9ed4c1784c81b55de4d7e387de9cdf
Expected Results
That the second play can connect via ssh to those newly created servers and install arch linux accordingly for now and then continue to develop roles to install k8
Actual Results
Code of Conduct