-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For immutable and other non traditional deployments ie no cloud_provi…
…der (#8946) * New, minimal, config for immutable and other non traditional deployments ie no cloud_provider * Update minimal-vars.yml --------- Co-authored-by: klewis0928 <[email protected]>
- Loading branch information
1 parent
c1aca01
commit f5908c1
Showing
17 changed files
with
384 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extends: default | ||
|
||
rules: | ||
comments: | ||
require-starting-space: false | ||
min-spaces-from-content: 1 | ||
comments-indentation: disable | ||
indentation: | ||
indent-sequences: consistent | ||
line-length: | ||
max: 200 | ||
allow-non-breakable-inline-mappings: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
= Overview | ||
|
||
*minimal* is indeed minimal and provides zero deployment logic. | ||
IE run by itself with no vars it will simple run through all the stage playbooks and do nothing. | ||
|
||
It is intended to be used as a config where the user brings all their own logic in the form of workload roles. | ||
|
||
== Workloads | ||
|
||
Workloads are defined as a set of roles that are applied to a host and/or cloud. | ||
|
||
[source,sh] | ||
---- | ||
pre_infra_workloads | ||
infra_workloads | ||
post_infra_workloads | ||
pre_software_workloads | ||
software_workloads | ||
post_software_workloads | ||
---- | ||
|
||
In addition workloads can be provided for stop, start, and destroying | ||
|
||
[source,sh] | ||
---- | ||
destroy_workloads | ||
stop_workloads | ||
start_workloads | ||
---- | ||
|
||
== Usage | ||
|
||
[source,sh] | ||
---- | ||
ansible-playbook ansible/main.yml -e @ansible/configs/minimal/default_vars.yml | ||
---- | ||
|
||
| This will run through all the stage playbooks and do nothing. | ||
|
||
== Use Cases | ||
|
||
* Immutable Operating Systems eg RHEL AI (traditional configs by default assume mutability) | ||
* Highly customized infrastructure bypassing a traditional cloud_provider | ||
|
||
=== Cloud Support | ||
|
||
None - it is intended to be used as a config where the user brings all their own logic in the form of workload roles. | ||
|
||
=== Architecture | ||
|
||
None | ||
|
||
== Developers Notes | ||
|
||
Authors: Tony Kay ([email protected]) 2025-01-03 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
# default vars for minimal, see README.adoc for full details | ||
|
||
env_type: minimal | ||
cloud_provider: none | ||
software_to_deploy: none | ||
|
||
output_dir: "/tmp/output_dir/{{ guid }}" # Writable working scratch directory | ||
project_tag: "{{ env_type }}-{{ guid }}" # This var is used to identify stack (cloudformation, azure resourcegroup, ...) | ||
agnosticd_inventory_exporter_enable: true # Dump inventory in output_dir | ||
|
||
email: "{{ env_type }}@opentlc.com" | ||
guid: "{{ env_type }}-01" | ||
uuid: "{{ guid }}" | ||
|
||
student_name: "{{ requester_username | default('lab-user') }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
|
||
- name: Import destroy workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Pre Infra" | ||
_workloads_: "{{ destroy_workloads | default([]) }}" | ||
|
||
- name: Import default cloud_provider destroy playbook | ||
ansible.builtin.import_playbook: ../../cloud_providers/{{ cloud_provider }}_destroy_env.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
|
||
- name: Step 001 Infrastructure | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
become: false | ||
tags: | ||
- step001 | ||
- infrastructure | ||
|
||
tasks: | ||
|
||
- name: "Step 001 Infrastructure" | ||
ansible.builtin.debug: | ||
msg: "Step 001 Infrastructure" | ||
|
||
# ---------------------------------------------------------------------- | ||
# Infra Workloads as role | ||
# ---------------------------------------------------------------------- | ||
|
||
- name: Import infra workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Infra" | ||
_workloads_: "{{ infra_workloads | default([]) }}" | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Hook for post start validations etc | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
become: false | ||
tasks: | ||
|
||
- name: Validation checks hook | ||
ansible.builtin.debug: | ||
msg: "Insert post restart validations if required" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Hook for post stop cleanup and validations etc | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
become: false | ||
tasks: | ||
|
||
- name: Validation checks hook | ||
ansible.builtin.debug: | ||
msg: "Insert post stop validations if required" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
|
||
- name: Step 002 Post Infrastructure | ||
hosts: localhost | ||
connection: local | ||
become: false | ||
gather_facts: false | ||
tags: | ||
- step002 | ||
- post_infrastructure | ||
|
||
tasks: | ||
|
||
- name: "Step 002 Post Infrastructure" | ||
ansible.builtin.debug: | ||
msg: "Step 002 Post Infrastructure" | ||
# ---------------------------------------------------------------------- | ||
# Post Infrasructure Workloads as role | ||
# ---------------------------------------------------------------------- | ||
|
||
- name: Import post_infra workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Post Infra" | ||
_workloads_: "{{ post_infra_workloads | default([]) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- name: Step 006 Post Software | ||
hosts: localhost | ||
gather_facts: false | ||
become: true | ||
tags: | ||
- step006 | ||
- post_software | ||
tasks: | ||
- ansible.builtin.debug: | ||
msg: "Post-Software tasks Started" | ||
|
||
# ---------------------------------------------------------------------- | ||
# Post-Software Workloads as role | ||
# ---------------------------------------------------------------------- | ||
|
||
- name: Import Post-software workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Post Software" | ||
_workloads_: "{{ post_software_workloads | default([]) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
|
||
- name: Step 000 Pre Infrastructure | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
become: false | ||
tags: | ||
- step000 | ||
- pre_infrastructure | ||
|
||
tasks: | ||
|
||
- name: "Step 000 Pre Infrastructure" | ||
ansible.builtin.debug: | ||
msg: "Step 000 Pre Infrastructure" | ||
|
||
# ---------------------------------------------------------------------- | ||
# Pre-Infra Workloads as role | ||
# ---------------------------------------------------------------------- | ||
|
||
- name: Import pre_infra workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Pre Infra" | ||
_workloads_: "{{ pre_infra_workloads | default([]) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
- name: Step 003 Pre Software | ||
hosts: localhost | ||
gather_facts: false | ||
become: false | ||
tags: | ||
- step004 | ||
- pre_software | ||
|
||
tasks: | ||
|
||
- name: "Step 003 Pre Software" | ||
ansible.builtin.debug: | ||
msg: "Step 000 Pre Software" | ||
|
||
# ---------------------------------------------------------------------- | ||
# Pre-Software Workloads as role | ||
# ---------------------------------------------------------------------- | ||
|
||
- name: Import Pre-software workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Pre Software" | ||
_workloads_: "{{ pre_software_workloads | default([]) }}" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
|
||
env_type: minimal | ||
cloud_provider: none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
|
||
- name: Step 004 Software | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
become: false | ||
tags: | ||
- step004 | ||
- software | ||
|
||
tasks: | ||
|
||
- name: "Software tasks Started" | ||
ansible.builtin.debug: | ||
msg: "Software tasks Started" | ||
|
||
# ---------------------------------------------------------------------- | ||
# Software Workloads as role | ||
# ---------------------------------------------------------------------- | ||
|
||
- name: Import Software workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Software" | ||
_workloads_: "{{ software_workloads | default([]) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Start Playbook | ||
hosts: localhost | ||
gather_facts: false | ||
become: false | ||
tasks: | ||
|
||
- name: Start Playbook | ||
ansible.builtin.debug: | ||
msg: "Start Playbook Running" | ||
|
||
# ---------------------------------------------------------------------- | ||
# Start Workloads as role | ||
# ---------------------------------------------------------------------- | ||
|
||
- name: Import start workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Start" | ||
_workloads_: "{{ start_workloads | default([]) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Stop Playbook | ||
hosts: localhost | ||
gather_facts: false | ||
become: false | ||
tasks: | ||
|
||
- name: Stop Playbook | ||
ansible.builtin.debug: | ||
msg: "Stop Playbook Running" | ||
|
||
# ---------------------------------------------------------------------- | ||
# Stop Workloads as role | ||
# ---------------------------------------------------------------------- | ||
|
||
- name: Import stop workloads | ||
ansible.builtin.import_playbook: workloads.yml | ||
vars: | ||
_workload_title_: "Stop" | ||
_workloads_: "{{ stop_workloads | default([]) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
- name: Install {{ _workload_title_ }} workloads for all nodes omit localhost | ||
hosts: all:!localhost | ||
become: true | ||
tasks: | ||
|
||
- name: Deploying {{ _workload_title_ }} workloads on all nodes omit localhost | ||
when: _workloads_.all_omit_local | default("") | length > 0 | ||
ansible.builtin.include_role: | ||
name: "{{ _pre_all_local }}" | ||
loop: "{{ _workloads_.all_omit_local }}" | ||
loop_control: | ||
loop_var: _pre_all_local | ||
|
||
- name: Install {{ _workload_title_ }} workloads on localhost | ||
hosts: localhost | ||
gather_facts: false | ||
become: true | ||
tasks: | ||
- name: Deploying {{ _workload_title_ }} workloads on localhost | ||
when: _workloads_.localhost | default("") | length > 0 | ||
ansible.builtin.include_role: | ||
name: "{{ _pre_localhost }}" | ||
loop: "{{ _workloads_.localhost }}" | ||
loop_control: | ||
loop_var: _pre_localhost | ||
|
||
- name: Install {{ _workload_title_ }} workloads on all hosts | ||
hosts: all:!windows | ||
become: true | ||
tasks: | ||
- name: Deploying {{ _workload_title_ }} workloads on all hosts | ||
when: _workloads_.all | default("") | length > 0 | ||
ansible.builtin.include_role: | ||
name: "{{ _pre_all }}" | ||
loop: "{{ _workloads_.all }}" | ||
loop_control: | ||
loop_var: _pre_all | ||
|
||
- name: Install {{ _workload_title_ }} workloads on bastion | ||
hosts: bastions | ||
become: true | ||
tasks: | ||
- name: Deploying {{ _workload_title_ }} workloads on bastion | ||
when: _workloads_.bastions | default("") | length > 0 | ||
ansible.builtin.include_role: | ||
name: "{{ _pre_bastion }}" | ||
loop: "{{ _workloads_.bastions }}" | ||
loop_control: | ||
loop_var: _pre_bastion | ||
|
||
- name: Install {{ _workload_title_ }} workloads for windows | ||
hosts: windows | ||
gather_facts: false | ||
become: true | ||
tasks: | ||
- name: Deploying {{ _workload_title_ }} workloads on windows | ||
when: _workloads_.windows | default("") | length > 0 | ||
ansible.builtin.include_role: | ||
name: "{{ _pre_windows }}" | ||
loop: "{{ _workloads_.windows }}" | ||
loop_control: | ||
loop_var: _pre_windows | ||
|
||
- name: Install {{ _workload_title_ }} workloads for nodes | ||
hosts: nodes | ||
become: true | ||
tasks: | ||
- name: Deploying {{ _workload_title_ }} workloads on nodes | ||
when: _workloads_.nodes | default("") | length > 0 | ||
ansible.builtin.include_role: | ||
name: "{{ _pre_nodes }}" | ||
loop: "{{ _workloads_.nodes }}" | ||
loop_control: | ||
loop_var: _pre_nodes |