tripleo-ansible/tripleo_ansible/playbooks/deploy-tripleo-os-install.yml

94 lines
2.8 KiB
YAML

---
# Copyright 2022 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- hosts: "{{ primary_role_name | default([]) }}:{{ deploy_target_host | default('overcloud') }}"
strategy: tripleo_free
gather_facts: "{{ gather_facts | default(false) }}"
any_errors_fatal: true
become: true
tasks:
- 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
- debug:
var: cloud_init_enabled
- name: Check if cloud-init is disabled via kernel args
shell: cat /proc/cmdline | grep -q cloud-init=disabled
failed_when: false
check_mode: false
register: cloud_init_vendor_disabled
- name: Wait for cloud-init to finish, if enabled
community.general.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:
- not ansible_check_mode
- cloud_init_enabled.rc is defined
- cloud_init_enabled.rc == 0
- cloud_init_vendor_disabled.rc is not defined or cloud_init_vendor_disabled.rc != 0
- name: Install tripleo_bootstrap
import_role:
name: tripleo_bootstrap
tasks_from: bootstrap.yml
tags:
- tripleo_bootstrap
- name: Install tripleo_kernel
import_role:
name: tripleo_kernel
tags:
- tripleo_kernel
- name: Install tripleo_podman
import_role:
name: tripleo_podman
tasks_from: tripleo_podman_install.yml
tags:
- tripleo_podman
- name: Install tripleo_sshd
import_role:
name: tripleo_sshd
tasks_from: install.yml
tags:
- tripleo_sshd
- name: Install chrony
import_role:
name: chrony
tasks_from: install.yml
tags:
- chrony
- name: Install tripleo_ovn
import_role:
name: tripleo_ovn
tasks_from: install.yml
tags:
- tripleo_ovn