Skip to content

Commit

Permalink
review and split non-provider intergration changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mtulio committed May 2, 2023
1 parent ebf7900 commit dd1bd5a
Show file tree
Hide file tree
Showing 28 changed files with 401 additions and 190 deletions.
1 change: 0 additions & 1 deletion playbooks/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
- name: okd-installer | Installer Configuration
hosts: localhost
connection: local

roles:
- config
33 changes: 24 additions & 9 deletions playbooks/create_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,43 @@
ansible.builtin.set_fact:
okdi_call_timer_start: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}"

# - name: OKD Installer | Create all | check required vars
# ansible.builtin.import_playbook: var_check_required.yaml

- name: OKD Installer | Create all | create config
- name: OKD Installer | Create all | Config | create config
ansible.builtin.import_playbook: config.yaml
vars:
mode: create
mode: create-config

- name: OKD Installer | Create all | create stack | network
ansible.builtin.import_playbook: stack_network.yaml
- name: OKD Installer | Create all | Config | create config
ansible.builtin.import_playbook: config.yaml
vars:
mode: create-manifests

- name: OKD Installer | Create all | create stack | IAM
ansible.builtin.import_playbook: stack_iam.yaml

- name: OKD Installer | Create all | create stack | network
ansible.builtin.import_playbook: stack_network.yaml

- name: OKD Installer | Create all | create stack | DNS
ansible.builtin.import_playbook: stack_dns.yaml

- name: OKD Installer | Create all | create stack | Load Balancer
ansible.builtin.import_playbook: stack_loadbalancer.yaml

- name: OKD Installer | Create all | create stack | Compute
- name: OKD Installer | Create all | Config | patch manifests
ansible.builtin.import_playbook: config.yaml
vars:
mode: patch-manifests

- name: OKD Installer | Create all | Config | create ignitions
ansible.builtin.import_playbook: config.yaml
vars:
mode: create-ignitions

- name: OKD Installer | Create all | os_mirror
ansible.builtin.import_playbook: os_mirror.yaml
when: os_mirror | d(false)

- name: OKD Installer | Create all | create stack | Compute nodes
ansible.builtin.import_playbook: create_node_all.yaml

- name: OKD Installer | Create all | create stack | Load Balancer Router
Expand All @@ -54,7 +70,6 @@
ansible.builtin.import_playbook: destroy_bootstrap.yaml
when: destroy_bootstrap | d('yes') == 'yes'


- name: OKD Installer | Create ALL | End
hosts: '{{ target|default("localhost") }}'
connection: local
Expand Down
24 changes: 9 additions & 15 deletions playbooks/destroy_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
hosts: '{{ target|default("localhost") }}'
connection: local
gather_facts: yes

tasks:
- name: OKD Installer | Destroy | Timer start
ansible.builtin.set_fact:
okdi_del_timer_start: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}"

# - ansible.builtin.import_playbook: var_check_required.yaml

- name: okd-installer | Cluster Destroy | Config load
ansible.builtin.import_playbook: config.yaml
vars:
Expand All @@ -20,12 +17,14 @@
hosts: '{{target|default("localhost")}}'
connection: local
gather_facts: yes

vars:
profile_path: "{{ playbook_dir }}/vars/{{ config_provider }}/profiles/{{ cluster_profile|d('default') }}"

vars_files:
- "{{ profile_path }}/iam.yaml"
- "{{ profile_path }}/dns.yaml"

pre_tasks:
# Network
- name: okd-installer | Destroy | Network | Loading Topology Names
Expand All @@ -45,35 +44,30 @@
ansible.builtin.include_vars:
file: "{{ profile_path }}/loadbalancer-router-default.yaml"

- name: okd-installer | Destroy | LB | Merge list
- name: okd-installer | Destroy | LB | Merge
ansible.builtin.set_fact:
load_balancers_all: "{{ load_balancers_all + cloud_loadbalancers }}"
load_balancers_all: "{{ (load_balancers_all | d([])) + (cloud_loadbalancers | d([])) }}"

- name: okd-installer | Destroy | LB | Load API Names
ansible.builtin.include_vars:
file: "{{ profile_path }}/loadbalancer.yaml"

- name: okd-installer | Destroy | LB | Merge list
- name: okd-installer | Destroy | LB | Merge
ansible.builtin.set_fact:
load_balancers_all: "{{ load_balancers_all + cloud_loadbalancers }}"
load_balancers_all: "{{ load_balancers_all + (cloud_loadbalancers | d([])) }}"

- name: okd-installer | Destroy | LB | Consolidate
ansible.builtin.set_fact:
cloud_loadbalancers: "{{ load_balancers_all }}"

- name: okd-installer | Destroy | LB | Show number of resources
- name: okd-installer | Destroy | LB | Show resource count
ansible.builtin.debug:
msg: "Found {{ cloud_loadbalancers | length }} Load Balancers on the Configuration"

roles:
- role: destroy


- name: okd-installer | Destroy | Finish
hosts: '{{ target|default("localhost") }}'
connection: local
gather_facts: true
tasks:
post_tasks:
- name: okd-installer | Destroy | Finish | Timer end
ansible.builtin.set_fact:
okdi_del_timer_end: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}"
Expand All @@ -82,4 +76,4 @@
ansible.builtin.debug:
msg:
- "start=[{{ okdi_del_timer_start | d('') }}] end=[{{ okdi_del_timer_end }}]"
- "total=[{{ ((okdi_del_timer_end | to_datetime) - (okdi_del_timer_start | to_datetime)) }}]"
- "total=[{{ ((okdi_del_timer_end | to_datetime) - (okdi_del_timer_start | to_datetime)) }}]"
3 changes: 2 additions & 1 deletion playbooks/group_vars/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ collection_cluster_dir: "{{ bindir | d(collection_work_dir + '/clusters') }}"

config_install_dir: "{{ collection_cluster_dir }}/{{ cluster_name }}"
bin_openshift_install: "{{ collection_bin_dir }}/openshift-install"
bin_oc: "{{ collection_bin_dir }}/openshift-install"
bin_oc: "{{ collection_bin_dir }}/oc"
bin_butane: "{{ collection_bin_dir }}/butane"

## export CONFIG_PULL_SECRET_FILE=${HOME}/.openshift/pull-secret-latest.jso
config_pull_secret_file: "{{ lookup('ansible.builtin.env', 'CONFIG_PULL_SECRET_FILE') }}"
Expand Down
12 changes: 12 additions & 0 deletions playbooks/os_mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: okd-installer | Create Stack | Compute | Load Config
ansible.builtin.import_playbook: config.yaml
vars:
mode: load

- name: okd-installer | OS Mirror
hosts: localhost
connection: local

roles:
- os_mirror
21 changes: 14 additions & 7 deletions playbooks/stack_loadbalancer.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# - ansible.builtin.import_playbook: var_check_required.yaml

- name: okd-installer | Stack | Load Balancer | Config load
ansible.builtin.import_playbook: config.yaml
Expand All @@ -9,6 +10,7 @@
hosts: '{{target|default("localhost")}}'
connection: local
vars:
cloud_loadbalancers_state: []
profile_path: "{{ playbook_dir }}/vars/{{ config_provider }}/profiles/{{ cluster_profile|d('default') }}"

pre_tasks:
Expand All @@ -22,11 +24,16 @@
file: "{{ profile_path }}/loadbalancer.yaml"
when: var_file is not defined

roles:
- cloud_load_balancer
- name: okd-installer | Stack | LB | setup
ansible.builtin.include_role:
name: cloud_load_balancer

- name: okd-installer | Stack | LB | Save state
ansible.builtin.import_playbook: config.yaml
vars:
mode: save-state
cluster_state: "{{ cluster_state | combine({'load_balancers': cloud_load_balancers_state}) }}"
- name: okd-installer | Stack | LB | update cluster_state
ansible.builtin.set_fact:
cluster_state: "{{ cluster_state | combine({'loadbalancers': cloud_loadbalancers_state}) }}"

- name: okd-installer | Stack | LB | save cluster_state
ansible.builtin.include_role:
name: config
vars:
mode: save-state
4 changes: 2 additions & 2 deletions playbooks/templates/ocp-bootstrap-user-data.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"ignition": {
"config": {
"replace": {
"source": "{{ openshift_userdata.config_source }}"
"source": "{{ userdata_config_source }}"
}
},
"version": "3.1.0"
}
}
}
3 changes: 0 additions & 3 deletions roles/bootstrap/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ galaxy_info:
- okd
- installer
- bootstrap
- aws
- amazon
- digitalocean

dependencies: []
7 changes: 7 additions & 0 deletions roles/clients/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ release_image_version_arch: "{{ release_image }}:{{ release_version }}"

workdir: "{{ lookup('env', 'HOME') }}/.ansible/okd-installer"
client_os: linux

## Butane https://github.com/coreos/butane
cli_butane_version: v0.17.0
cli_butane_arch: x86_64
cli_butane_os: unknown-linux-gnu
cli_butane_bin: "butane-{{ cli_butane_arch }}-{{ cli_butane_os }}"
cli_butane_url: "https://github.com/coreos/butane/releases/download/{{ cli_butane_version }}/{{ cli_butane_bin }}"
5 changes: 3 additions & 2 deletions roles/clients/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ galaxy_info:
- openshift
- okd
- installer
- aws
- amazon
- okd-installer
- openshift-installer
- automation

dependencies: []
Loading

0 comments on commit dd1bd5a

Please sign in to comment.