tripleo-heat-templates/common/deploy-steps-tasks-step-0.j2.yaml
Alex Schultz f9100964f9 Drop service facts usage
This change switches from using service facts to using systemctl
commands to do service checks. This is done to reduce the amount of
memory used as part of the deployment.

Change-Id: I0cd5b24933e50680baefd055d6e68e277ab09315
Related-Bug: #1915761
2021-02-16 07:48:53 -07:00

44 lines
1.6 KiB
YAML

- name: Deploy step tasks for step 0
delegate_to: localhost
run_once: true
debug:
msg: Use --start-at-task 'Deploy step tasks for step 0' to resume from this task
when: "tripleo_minor_update is not defined or tripleo_minor_update != 'true'"
- 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: Check cloud-init status
shell: systemctl is-active cloud-init.service || systemctl is-enabled cloud-init.service
failed_when: false
become: true
register: cloud_init_enabled
- 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_enabled.rc is defined
- cloud_init_enabled.rc == 0
- name: Create /var/lib/container-puppet
become: true
no_log: True
file: path=/var/lib/container-puppet state=directory setype=container_file_t selevel=s0 recurse=true
- name: Write container-puppet.sh
become: true
no_log: True
copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755 setype=container_file_t
{%- for role in roles %}
- include_tasks: "{% raw %}{{ _task_file_path }}{% endraw %}"
vars:
_task_file_path: "{{role.name}}/deploy_steps_tasks_step0.yaml"
when:
- tripleo_role_name == '{{role.name}}'
- "{% raw %}'{{ playbook_dir }}/{{ _task_file_path }}' is exists{% endraw %}"
{%- endfor %}