diff --git a/common/deploy-steps-tasks-step-0.j2.yaml b/common/deploy-steps-tasks-step-0.j2.yaml index 3634eb4626..3203a43ac3 100644 --- a/common/deploy-steps-tasks-step-0.j2.yaml +++ b/common/deploy-steps-tasks-step-0.j2.yaml @@ -7,6 +7,20 @@ - name: Ensure /var/log/journal exists become: true file: path=/var/log/journal state=directory mode=0750 owner=root group=root setype=var_log_t +- name: Populate service facts + service_facts: +- name: Wait for cloud-init to finish, if enabled + cloud_init_data_facts: + filter: status + register: res + until: > + res.cloud_init_data_facts.status.v1.stage is defined and + not res.cloud_init_data_facts.status.v1.stage + retries: 50 + delay: 5 + when: > + 'cloud-init.service' in ansible_facts.services and + ansible_facts.services['cloud-init.service']['status'] == 'enabled' - name: Create /var/lib/container-puppet become: true no_log: True