Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use upstream collection #306

Merged
merged 4 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy_prerequisites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- name: Play to populate image_hashes for relevant images
hosts: localhost
roles:
- get_image_hash
- redhatci.ocp.get_image_hash

- import_playbook: playbooks/deploy_ntp.yml

Expand Down
7 changes: 4 additions & 3 deletions playbooks/add_day2_nodes.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- hosts: day2_workers
- name: Add day2 workers
hosts: day2_workers
gather_facts: false
strategy: free
strategy: ansible.builtin.free
roles:
- name: add_day2_node
- role: redhatci.ocp.add_day2_node
when: groups['day2_workers'] | default([]) | length > 0
5 changes: 3 additions & 2 deletions playbooks/approve_csrs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- hosts: bastion
- name: Approve CSRs on cluster
hosts: bastion
gather_facts: false
roles:
- role: approve_csrs
- role: redhatci.ocp.approve_csrs
when: groups['day2_workers'] | default([]) | length > 0
4 changes: 2 additions & 2 deletions playbooks/boot_disk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

- name: Unmounting Assisted Installer Discovery ISO
hosts: bastion
gather_facts: False
gather_facts: false
roles:
- boot_disk
- redhatci.ocp.boot_disk
8 changes: 4 additions & 4 deletions playbooks/boot_iso.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Mounting, Booting the Assisted Installer Discovery ISO
hosts: "{{ boot_iso_hosts | default('nodes') }}"
gather_facts: False
strategy: "{{ use_boot_iso_strategy_free | default(True) | bool | ternary('free', omit) }}"
serial: "{{ use_boot_iso_strategy_free | default(True) | bool | ternary(omit, 1) }}"
gather_facts: false
strategy: "{{ use_boot_iso_strategy_free | default(true) | bool | ternary('free', omit) }}"
serial: "{{ use_boot_iso_strategy_free | default(true) | bool | ternary(omit, 1) }}"
roles:
- boot_iso
- redhatci.ocp.boot_iso
7 changes: 4 additions & 3 deletions playbooks/create_cluster.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: Create cluster and generate Assisted Installer Discovery ISO
hosts: bastion
gather_facts: False
gather_facts: false
roles:
- create_cluster
- patch_cluster
- redhatci.ocp.create_cluster
- redhatci.ocp.patch_cluster
42 changes: 21 additions & 21 deletions playbooks/create_crucible_user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@
state: "present"
shell: "/bin/bash"
homedir:
createhome: yes
createhome: true
uid:
generate_ssh_keypair: yes
generate_ssh_keypair: true
tasks:
- name: "Adding user {{ username }}"
ansible.builtin.user:
name: "{{ username }}"
comment: "{{ fullname | default(omit) }}"
uid: "{{ uid | int | default(omit, true) }}"
createhome: "{{ createhome | default('yes') }}"
home: "{{ homedir | default('/home/' + username, true) }}"
shell: "{{ shell | default('/bin/bash') }}"
- name: "Adding user {{ username }} to secondary groups"
ansible.builtin.user:
group: "{{ group | default(omit) }}"
name: "{{ username }}"
groups: "{{ my_groups | default(omit) }}"
- name: "Adding sshkey to user {{ username }}"
ansible.builtin.user:
name: "{{ username }}"
generate_ssh_key: "{{ generate_ssh_keypair | default('yes') }}"
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
- name: "Adding user {{ username }}"
ansible.builtin.user:
name: "{{ username }}"
comment: "{{ fullname | default(omit) }}"
uid: "{{ uid | int | default(omit, true) }}"
createhome: "{{ createhome | default('yes') }}"
home: "{{ homedir | default('/home/' + username, true) }}"
shell: "{{ shell | default('/bin/bash') }}"
- name: "Adding user {{ username }} to secondary groups" # noqa: name[template]
ansible.builtin.user:
group: "{{ group | default(omit) }}"
name: "{{ username }}"
groups: "{{ my_groups | default(omit) }}"
- name: "Adding sshkey to user {{ username }}"
ansible.builtin.user:
name: "{{ username }}"
generate_ssh_key: "{{ generate_ssh_keypair | default('yes') }}"
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
7 changes: 4 additions & 3 deletions playbooks/create_day2_cluster.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- hosts: bastion
- name: Create day2 cluster definition
hosts: bastion
roles:
- role: create_day2_cluster
- role: redhatci.ocp.create_day2_cluster
when: groups['day2_workers'] | default([]) | length > 0
vars:
- disconnected: "{{ use_local_mirror_registry | default(setup_registry_service | default(true)) }}"
disconnected: "{{ use_local_mirror_registry | default(setup_registry_service | default(true)) }}"
14 changes: 7 additions & 7 deletions playbooks/create_vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
- name: Process KVM nodes
hosts: bastion
roles:
- role: process_kvm_nodes
- role: redhatci.ocp.process_kvm_nodes
when: (setup_vms | default(true))

- name: Provision VMS
hosts: vm_hosts
gather_facts: False
gather_facts: false
vars:
SETUP_VMS: "{{ setup_vms | default((kvm_nodes | default([])) | length | int >= 1) }}"
pre_tasks:
- name: Setup facts
setup:
when: SETUP_VMS == True
ansible.builtin.setup:
when: SETUP_VMS | bool
roles:
- role: destroy_vms
- role: redhatci.ocp.destroy_vms
when: SETUP_VMS | bool
tags:
- destroy_vms

- role: setup_vm_host_network
- role: redhatci.ocp.setup_vm_host_network
when: (SETUP_VM_BRIDGE | default(SETUP_VMS)) | bool

- role: create_vms
- role: redhatci.ocp.create_vms
when: SETUP_VMS | bool
tags:
- setup_vms
6 changes: 3 additions & 3 deletions playbooks/dell_idrac_soft_reset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
vars_prompt:
- name: reset_confirmation
prompt: You are about to preform a SOFT RESET of a Dell Drac. ARE YOU SURE [yes|no]?
private: no
private: false
tasks:
- name: RESETING THE DRAC AND CMC
raw: racadm racreset
ansible.builtin.raw: racadm racreset
when: reset_confirmation | bool
register: result
failed_when: "'RAC reset operation initiated successfully' not in result['stdout']"
- name: Wait for reset
pause:
ansible.builtin.pause:
prompt: "Pausing 3 mins to allow the iDRAC and CMC to return to a usable state."
minutes: 3
23 changes: 12 additions & 11 deletions playbooks/deploy_assisted_installer_onprem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
destination_hosts:
- assisted_installer
pre_tasks:
- name: pre-compute need to get hashes
set_fact:
run_get_hash: "{{ image_hashes | default({}) | length == 0 }}"
- name: Pre-compute need to get hashes
ansible.builtin.set_fact:
run_get_hash: "{{ image_hashes | default({}) | length == 0 }}"
roles:
- role: get_image_hash
- role: redhatci.ocp.get_image_hash
when: run_get_hash

- name: Deploy OpenShift Assisted Installer On Prem
hosts: assisted_installer
roles:
- role: setup_assisted_installer
when: SETUP_ASSISTED_INSTALLER == True
- role: redhatci.ocp.setup_assisted_installer
when: SETUP_ASSISTED_INSTALLER | bool
vars:
SETUP_ASSISTED_INSTALLER: "{{ setup_assisted_installer | default(True) }}"
SETUP_ASSISTED_INSTALLER: "{{ setup_assisted_installer | default(true) }}"
post_tasks:
# This should be moved into the role.
- name: Wait for up to 60 minutes for the assisted installer to come online
uri:
ansible.builtin.uri:
url: "http://{{ ansible_host }}:8090/ready"
method: GET
status_code: [200, 201]
Expand All @@ -30,10 +31,10 @@
retries: 120
delay: 30
delegate_to: bastion
when: SETUP_ASSISTED_INSTALLER == True
when: SETUP_ASSISTED_INSTALLER | bool

- name: Wait for up to 60 minutes for the assisted installer image service to come online
uri:
ansible.builtin.uri:
url: "http://{{ ansible_host }}:8888/health"
method: GET
status_code: [200, 201]
Expand All @@ -42,4 +43,4 @@
retries: 120
delay: 30
delegate_to: bastion
when: SETUP_ASSISTED_INSTALLER == True
when: SETUP_ASSISTED_INSTALLER | bool
20 changes: 13 additions & 7 deletions playbooks/deploy_cluster_agent_based_installer.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
---
- import_playbook: extract_agent_based_installer.yml
- name: Extract Agent based installer
ansible.builtin.import_playbook: extract_agent_based_installer.yml
when: agent_based_installer_path is not defined

- import_playbook: generate_ssh_key_pair.yml
when: generate_ssh_keys | default(True) == True
- name: Generate SSH Key for node access
ansible.builtin.import_playbook: generate_ssh_key_pair.yml
when: (generate_ssh_keys | default(true)) | bool

- import_playbook: generate_manifests.yml
- import_playbook: generate_agent_iso.yml
- name: Generate ABI input manfiests
ansible.builtin.import_playbook: generate_manifests.yml
- name: Generate boot iso using ABI
ansible.builtin.import_playbook: generate_agent_iso.yml

- import_playbook: boot_iso.yml
- name: Boot ISO
ansible.builtin.import_playbook: boot_iso.yml
vars:
boot_iso_hosts: masters,workers

- import_playbook: monitor_agent_based_installer.yml
- name: Monitior installation
ansible.builtin.import_playbook: monitor_agent_based_installer.yml
26 changes: 17 additions & 9 deletions playbooks/deploy_cluster_assisted_installer.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
---
- import_playbook: generate_ssh_key_pair.yml
when: generate_ssh_keys | default(True) == True
- name: Generate SSH Keys for node access
ansible.builtin.import_playbook: generate_ssh_key_pair.yml
when: (generate_ssh_keys | default(true)) | bool

- import_playbook: create_cluster.yml
- name: Create cluster definition is assisted installer
ansible.builtin.import_playbook: create_cluster.yml

- import_playbook: generate_discovery_iso.yml
- name: Generate and download discovery iso
ansible.builtin.import_playbook: generate_discovery_iso.yml

- import_playbook: mount_discovery_iso_for_pxe.yml
- name: Mount discovery iso to extract PXE artifacts
ansible.builtin.import_playbook: mount_discovery_iso_for_pxe.yml

- import_playbook: boot_iso.yml
- name: Boot discovery iso
ansible.builtin.import_playbook: boot_iso.yml
vars:
boot_iso_hosts: masters,workers

- import_playbook: install_cluster.yml
- name: Trigger cluster install
ansible.builtin.import_playbook: install_cluster.yml

- import_playbook: monitor_hosts.yml
- name: Monitor during installation
ansible.builtin.import_playbook: monitor_hosts.yml

- import_playbook: monitor_cluster.yml
- name: Monitior cluster has installed
ansible.builtin.import_playbook: monitor_cluster.yml
14 changes: 7 additions & 7 deletions playbooks/deploy_dns.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
- name: Setup DNS Records
hosts: dns_host
gather_facts: False
gather_facts: false
vars:
SETUP_DNS_SERVICE: "{{ setup_dns_service | default(True) }}"
SETUP_DNS_SERVICE: "{{ setup_dns_service | default(true) }}"
pre_tasks:
- name: Setup facts
setup:
when: SETUP_DNS_SERVICE == True
ansible.builtin.setup:
when: SETUP_DNS_SERVICE | bool
roles:
- role: insert_dns_records
when: SETUP_DNS_SERVICE == True
- role: validate_dns_records
- role: redhatci.ocp.insert_dns_records
when: SETUP_DNS_SERVICE | bool
- role: redhatci.ocp.validate_dns_records
14 changes: 7 additions & 7 deletions playbooks/deploy_http_store.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
- name: Install and http_store service
hosts: http_store
gather_facts: False
gather_facts: false
vars:
SETUP_HTTP_STORE_SERVICE: "{{ setup_http_store_service | default(True) }}"
SETUP_HTTP_STORE_SERVICE: "{{ (setup_http_store_service | default(true)) | bool }}"
pre_tasks:
- name: Setup facts
setup:
when: SETUP_HTTP_STORE_SERVICE == True
ansible.builtin.setup:
when: SETUP_HTTP_STORE_SERVICE | bool
roles:
- name: setup_http_store
when: SETUP_HTTP_STORE_SERVICE == True
- validate_http_store
- role: redhatci.ocp.setup_http_store
when: SETUP_HTTP_STORE_SERVICE | bool
- redhatci.ocp.validate_http_store
12 changes: 6 additions & 6 deletions playbooks/deploy_ntp.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- name: Setup NTP
hosts: ntp_host
gather_facts: False
gather_facts: false
vars:
SETUP_NTP_SERVICE: "{{setup_ntp_service | default(True)}}"
SETUP_NTP_SERVICE: "{{setup_ntp_service | default(true)}}"
pre_tasks:
- name: Setup facts
setup:
when: SETUP_NTP_SERVICE == True
ansible.builtin.set_fact:
when: SETUP_NTP_SERVICE | bool
roles:
- role: setup_ntp
when: SETUP_NTP_SERVICE == True
- role: redhatci.ocp.setup_ntp
when: SETUP_NTP_SERVICE | bool
Loading
Loading