From b8adaee9d46582d7ce57b92451ffb3f0c4f1bdbe Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Fri, 14 Apr 2023 09:38:34 +0200 Subject: [PATCH] use cloudinit-wait role from git --- ansible/max.yml | 27 +++++---------------------- ansible/requirements.yml | 3 +++ 2 files changed, 8 insertions(+), 22 deletions(-) create mode 100644 ansible/requirements.yml diff --git a/ansible/max.yml b/ansible/max.yml index cc056f1..2d677ff 100644 --- a/ansible/max.yml +++ b/ansible/max.yml @@ -1,28 +1,11 @@ -- name: Setup homeserver +- name: Wait for servers to come up hosts: max gather_facts: no + roles: + - 'cloudinit-wait' - pre_tasks: - - name: Wait for host to come up - tags: always - block: - - name: Wait for SSH connection - wait_for: - state: started - port: 22 - host: max.dmz - timeout: 300 - connect_timeout: 300 - search_regex: OpenSSH - delegate_to: localhost - - name: Wait for cloud-init to finish - shell: - cmd: "cloud-init status --wait" - register: cloudinit - changed_when: "'..' in cloudinit.stdout" - - name: Gather facts - setup: - +- name: Start services + hosts: max roles: - {role: 'watchtower', tags: 'watchtower'} - {role: 'forgejo', tags: 'forgejo'} diff --git a/ansible/requirements.yml b/ansible/requirements.yml new file mode 100644 index 0000000..5530c9f --- /dev/null +++ b/ansible/requirements.yml @@ -0,0 +1,3 @@ +- name: cloudinit-wait + src: https://git.pim.kunis.nl/pim/ansible-role-cloudinit-wait + scm: git