2022-02-12 21:36:34 +00:00
|
|
|
---
|
|
|
|
# Installs everything on hosts
|
|
|
|
#
|
|
|
|
- name: Bootstrap nodes for distributed OSA installation
|
2023-04-24 02:14:38 +00:00
|
|
|
hosts: "{{ host | default('infra1,compute1,compute2,storage1') }}"
|
2022-02-12 21:36:34 +00:00
|
|
|
become: true
|
|
|
|
|
2023-04-24 02:14:38 +00:00
|
|
|
vars:
|
|
|
|
|
2022-02-12 21:36:34 +00:00
|
|
|
handlers:
|
|
|
|
- import_tasks: handlers/main.yml
|
|
|
|
|
|
|
|
pre_tasks:
|
|
|
|
- name: Check if ansible cannot be run here
|
|
|
|
stat:
|
|
|
|
path: /etc/no-ansible
|
|
|
|
register: no_ansible
|
|
|
|
|
|
|
|
- name: Verify if we can run ansible
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "not no_ansible.stat.exists"
|
|
|
|
success_msg: "We are able to run on this node"
|
|
|
|
fail_msg: "/etc/no-ansible exists - skipping run on this node"
|
|
|
|
|
|
|
|
- name: Loading Variables from OS Common
|
|
|
|
import_tasks: tasks/common_vars.yml
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: Initialize nodes
|
2023-04-24 02:14:38 +00:00
|
|
|
tags:
|
|
|
|
- init
|
|
|
|
args:
|
|
|
|
apply:
|
|
|
|
tags:
|
|
|
|
- init
|
|
|
|
include_tasks: tasks/init-nodes.yml
|
2022-02-12 21:36:34 +00:00
|
|
|
|
|
|
|
- name: Reboot
|
2022-02-13 01:31:50 +00:00
|
|
|
import_tasks: tasks/reboot.yml
|
|
|
|
when: reboot | default(true) | bool
|
2022-02-12 21:36:34 +00:00
|
|
|
|
|
|
|
- name: Setup infra hosts
|
2023-04-24 02:14:38 +00:00
|
|
|
include_tasks: tasks/infra-host.yml
|
|
|
|
tags:
|
|
|
|
- infrastructure
|
|
|
|
args:
|
|
|
|
apply:
|
|
|
|
tags:
|
|
|
|
- infrastructure
|
|
|
|
when: tag.find("infra") != -1 or aio_install | default(false) | bool
|
2022-02-12 21:36:34 +00:00
|
|
|
|
|
|
|
- name: Setup storage hosts
|
2023-04-24 02:14:38 +00:00
|
|
|
include_tasks: tasks/storage-host.yml
|
|
|
|
tags:
|
|
|
|
- storage
|
|
|
|
args:
|
|
|
|
apply:
|
|
|
|
tags:
|
|
|
|
- storage
|
|
|
|
when: tag.find("storage") != -1
|
2022-02-12 21:36:34 +00:00
|
|
|
|
|
|
|
post_tasks:
|
|
|
|
- name: Touching run file that ansible has ran here
|
|
|
|
file:
|
|
|
|
path: /var/log/ansible.run
|
|
|
|
state: touch
|
|
|
|
mode: '0644'
|
|
|
|
owner: root
|
|
|
|
group: root
|