34 lines
916 B
YAML
34 lines
916 B
YAML
|
|
---
|
||
|
|
- name: Provision Enterprise Infrastructure Nodes
|
||
|
|
hosts: all
|
||
|
|
become: true
|
||
|
|
gather_facts: true
|
||
|
|
|
||
|
|
pre_tasks:
|
||
|
|
- name: Validate Ansible version
|
||
|
|
ansible.builtin.assert:
|
||
|
|
that:
|
||
|
|
- ansible_version.major >= 2
|
||
|
|
- ansible_version.minor >= 9
|
||
|
|
fail_msg: "Ansible 2.9+ is required"
|
||
|
|
|
||
|
|
- name: Display provisioning information
|
||
|
|
ansible.builtin.debug:
|
||
|
|
msg: |
|
||
|
|
Provisioning {{ inventory_hostname }}
|
||
|
|
OS: {{ ansible_os_family }}
|
||
|
|
Python: {{ ansible_python_version }}
|
||
|
|
|
||
|
|
roles:
|
||
|
|
- role: base_provision
|
||
|
|
tags: ['provision', 'base']
|
||
|
|
|
||
|
|
post_tasks:
|
||
|
|
- name: Generate provisioning summary
|
||
|
|
ansible.builtin.debug:
|
||
|
|
msg: |
|
||
|
|
Provisioning completed successfully!
|
||
|
|
Host: {{ inventory_hostname }}
|
||
|
|
IP: {{ ansible_default_ipv4.address }}
|
||
|
|
OS: {{ ansible_os_family }} {{ ansible_os_version }}
|