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