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

OCTOPUS-644:code refactor for openstack #13

Merged
merged 2 commits into from
Mar 4, 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
40 changes: 20 additions & 20 deletions openstack/intel-worker/tasks/create_centos_image.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---

Check failure on line 1 in openstack/intel-worker/tasks/create_centos_image.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

schema[tasks]

$[0] 'block' is a required property
- name: OpenStack worker node configuration Tasks (i.e. Create worker.ign, Upload RHCOS Image, Create Customization Script, Create Instance etc)
hosts: all
vars_files:
- ../vars/main.yml

tasks:
- name: "Download the Image from the URL and use to create image"
ansible.builtin.get_url:
url: "{{ image_url_centos }}"
dest: "{{ image_dest_filename_centos }}"
mode: '0755'
validate_certs: "{{ image_validate_certs_centos }}"
register: image_download_stats
- name: Create/upload Centos images to openstack.
openstack.cloud.image:
cloud: openstack
state: present
name: "{{ image_name_centos_centos }}"
container_format: "{{ image_container_format_centos }}"
disk_format: "{{ image_disk_format_centos }}"
filename: "{{ image_dest_filename_centos }}"
is_public: "{{ image_is_public_centos }}"
properties:
cpu_arch: "{{ image_cpu_arch_centos }}"
distro: "{{ image_distro_centos }}"
- name: Download the Image from the URL and use to create image
ansible.builtin.get_url:
url: "{{ image_url_centos }}"
dest: "{{ image_dest_filename_centos }}"
mode: '0755'
validate_certs: "{{ image_validate_certs_centos }}"
register: image_download_stats

- name: Create/upload Centos images to openstack.
openstack.cloud.image:
cloud: openstack
state: present
name: "{{ image_name_centos_centos }}"
container_format: "{{ image_container_format_centos }}"
disk_format: "{{ image_disk_format_centos }}"
filename: "{{ image_dest_filename_centos }}"
is_public: "{{ image_is_public_centos }}"
properties:
cpu_arch: "{{ image_cpu_arch_centos }}"
distro: "{{ image_distro_centos }}"
2 changes: 1 addition & 1 deletion openstack/intel-worker/tasks/create_flavor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check failure on line 1 in openstack/intel-worker/tasks/create_flavor.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

schema[tasks]

$[0] 'block' is a required property
- name: OpenStack worker node configuration Tasks (i.e. Create worker.ign, Upload RHCOS Image, Create Customization Script, Create Instance etc)
hosts: all
vars_files:
Expand All @@ -14,4 +14,4 @@
vcpus: "{{ custom_flavor_vcpus }}"
disk: "{{ custom_flavor_disk }}"
ephemeral: "{{ custom_flavor_ephemeral }}"
description: "{{ custom_flavor_description }}"
description: "{{ custom_flavor_description }}"
16 changes: 8 additions & 8 deletions openstack/intel-worker/tasks/create_host_aggregate.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---

Check failure on line 1 in openstack/intel-worker/tasks/create_host_aggregate.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

schema[tasks]

$[0] 'block' is a required property
- name: OpenStack worker node configuration Tasks (i.e. Create worker.ign, Upload RHCOS Image, Create Customization Script, Create Instance etc)
hosts: all
vars_files:
- ../vars/main.yml

tasks:
- name: Create host aggregate (host group) to openstack
openstack.cloud.host_aggregate:
cloud: openstack
state: present
name: "{{ host_aggregate_name }}"
hosts: "{{ host_name_list }}"
metadata:
availability_zone: "{{ host_availability_zone_name }}"
- name: Create host aggregate (host group) to openstack
openstack.cloud.host_aggregate:
cloud: openstack
state: present
name: "{{ host_aggregate_name }}"
hosts: "{{ host_name_list }}"
metadata:
availability_zone: "{{ host_availability_zone_name }}"

Check failure on line 15 in openstack/intel-worker/tasks/create_host_aggregate.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[new-line-at-end-of-file]

No new line character at the end of file
40 changes: 20 additions & 20 deletions openstack/intel-worker/tasks/create_rhcos_image.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---

Check failure on line 1 in openstack/intel-worker/tasks/create_rhcos_image.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

schema[tasks]

$[0] 'block' is a required property
- name: OpenStack worker node configuration Tasks (i.e. Create worker.ign, Upload RHCOS Image, Create Customization Script, Create Instance etc)
hosts: all
vars_files:
- ../vars/main.yml

tasks:
- name: "Download the Image from the URL and use to create image"
ansible.builtin.get_url:
url: "{{ image_url_rhcos }}"
dest: "{{ image_dest_filename_rhcos }}"
mode: '0755'
validate_certs: "{{ image_validate_certs_rhcos }}"
register: image_download_stats
- name: Create/upload RHCOS images to openstack.
openstack.cloud.image:
cloud: openstack
state: present
name: "{{ image_name_rhcos }}"
container_format: "{{ image_container_format_rhcos }}"
disk_format: "{{ image_disk_format_rhcos }}"
filename: "{{ image_dest_filename_rhcos }}"
is_public: "{{ image_is_public_rhcos }}"
properties:
cpu_arch: "{{ image_cpu_arch_rhcos }}"
distro: "{{ image_distro_rhcos }}"
- name: "Download the Image from the URL and use to create image"
ansible.builtin.get_url:
url: "{{ image_url_rhcos }}"
dest: "{{ image_dest_filename_rhcos }}"
mode: '0755'
validate_certs: "{{ image_validate_certs_rhcos }}"
register: image_download_stats

- name: Create/upload RHCOS images to openstack.
openstack.cloud.image:
cloud: openstack
state: present
name: "{{ image_name_rhcos }}"
container_format: "{{ image_container_format_rhcos }}"
disk_format: "{{ image_disk_format_rhcos }}"
filename: "{{ image_dest_filename_rhcos }}"
is_public: "{{ image_is_public_rhcos }}"
properties:
cpu_arch: "{{ image_cpu_arch_rhcos }}"
distro: "{{ image_distro_rhcos }}"
28 changes: 14 additions & 14 deletions openstack/intel-worker/tasks/create_vm_instance.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---

Check failure on line 1 in openstack/intel-worker/tasks/create_vm_instance.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

schema[tasks]

$[0] 'block' is a required property
- name: OpenStack worker node configuration Tasks (i.e. Create worker.ign, Upload RHCOS Image, Create Customization Script, Create Instance etc)
hosts: all
vars_files:
- ../vars/main.yml

tasks:
- name: Create server in the Multi-Arch Compute OpenStack Instance
openstack.cloud.server:
cloud: openstack
state: present
name: "{{ virtual_machine_name }}"
region_name: "{{ virtual_machine_region_name }}"
availability_zone: "{{ vitrual_machine_availability_zone }}"
image: "{{ virtual_machine_image_name }}"
flavor: "{{ virtual_machine_flavor }}"
volume_size: "{{ virtual_machine_volume_size }}"
key_name: "{{ virtual_machine_keypair_name }}"
network: "{{ virtual_machine_network_name }}"
userdata: "{{ virtual_machine_userdata }}"
timeout: "{{ virtual_machine_timeout }}"
- name: Create server in the Multi-Arch Compute OpenStack Instance
openstack.cloud.server:
cloud: openstack
state: present
name: "{{ virtual_machine_name }}"
region_name: "{{ virtual_machine_region_name }}"
availability_zone: "{{ vitrual_machine_availability_zone }}"
image: "{{ virtual_machine_image_name }}"
flavor: "{{ virtual_machine_flavor }}"
volume_size: "{{ virtual_machine_volume_size }}"
key_name: "{{ virtual_machine_keypair_name }}"
network: "{{ virtual_machine_network_name }}"
userdata: "{{ virtual_machine_userdata }}"
timeout: "{{ virtual_machine_timeout }}"
10 changes: 5 additions & 5 deletions openstack/intel-worker/tasks/delete_vm_instance.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---

Check failure on line 1 in openstack/intel-worker/tasks/delete_vm_instance.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

schema[tasks]

$[0] 'block' is a required property
- name: OpenStack worker node configuration Tasks (i.e. Create worker.ign, Upload RHCOS Image, Create Customization Script, Create Instance etc)
hosts: all
vars_files:
- ../vars/main.yml

tasks:
- name: Delete server in the Multi-Arch Compute OpenStack Instance
openstack.cloud.server:
cloud: openstack
state: absent
name: "{{ virtual_machine_name }}"
- name: Delete server in the Multi-Arch Compute OpenStack Instance
openstack.cloud.server:
cloud: openstack
state: absent
name: "{{ virtual_machine_name }}"
20 changes: 10 additions & 10 deletions openstack/intel-worker/tasks/remove_centos_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
- ../vars/main.yml

tasks:
- name: Remove Centos images to openstack.
openstack.cloud.image:
cloud: openstack
state: absent
name: "{{ image_name_centos }}"
disk_format: "{{ image_disk_format_centos }}"
is_public: "{{ image_is_public_centos }}"
properties:
cpu_arch: "{{ image_cpu_arch_centos }}"
distro: "{{ image_distro_centos }}"
- name: Remove Centos images to openstack.
openstack.cloud.image:
cloud: openstack
state: absent
name: "{{ image_name_centos }}"
disk_format: "{{ image_disk_format_centos }}"
is_public: "{{ image_is_public_centos }}"
properties:
cpu_arch: "{{ image_cpu_arch_centos }}"
distro: "{{ image_distro_centos }}"
1 change: 0 additions & 1 deletion openstack/intel-worker/tasks/remove_flavor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
cloud: openstack
state: absent
name: "{{ custom_flavor_name }}"

10 changes: 5 additions & 5 deletions openstack/intel-worker/tasks/remove_host_aggregate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
- ../vars/main.yml

tasks:
- name: Remove host aggregate (host group) from openstack
openstack.cloud.host_aggregate:
cloud: openstack
state: absent
name: "{{ host_aggregate_name }}"
- name: Remove host aggregate (host group) from openstack
openstack.cloud.host_aggregate:
cloud: openstack
state: absent
name: "{{ host_aggregate_name }}"
20 changes: 10 additions & 10 deletions openstack/intel-worker/tasks/remove_rhcos_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
- ../vars/main.yml

tasks:
- name: Remove RHCOS images from openstack.
openstack.cloud.image:
cloud: openstack
state: absent
name: "{{ image_name_rhcos }}"
disk_format: "{{ image_disk_format_rhcos }}"
is_public: "{{ image_is_public_rhcos }}"
properties:
cpu_arch: "{{ image_cpu_arch_rhcos }}"
distro: "{{ image_distro_rhcos }}"
- name: Remove RHCOS images from openstack.
openstack.cloud.image:
cloud: openstack
state: absent
name: "{{ image_name_rhcos }}"
disk_format: "{{ image_disk_format_rhcos }}"
is_public: "{{ image_is_public_rhcos }}"
properties:
cpu_arch: "{{ image_cpu_arch_rhcos }}"
distro: "{{ image_distro_rhcos }}"
16 changes: 7 additions & 9 deletions openstack/intel-worker/tasks/vm_server_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
- ../vars/main.yml

tasks:
- name: Virtual machine action like start/stop/restart etc in the Multi-Arch Compute OpenStack
openstack.cloud.server_action:
cloud: openstack
action: "{{ virtual_machine_server_action }}"
server: "{{ virtual_machine_name }}"
timeout: "{{ virtual_machine_action_timeout }}"
wait: "{{ virtual_machine_action_wait }}"


- name: Virtual machine action like start/stop/restart etc in the Multi-Arch Compute OpenStack
openstack.cloud.server_action:
cloud: openstack
action: "{{ virtual_machine_server_action }}"
server: "{{ virtual_machine_name }}"
timeout: "{{ virtual_machine_action_timeout }}"
wait: "{{ virtual_machine_action_wait }}"
10 changes: 5 additions & 5 deletions openstack/intel-worker/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ virtual_machine_volume_size: 80
virtual_machine_keypair_name: "<Provide the keypair name>"
virtual_machine_network_name: "<Provide the network name>"
virtual_machine_userdata: "#!/bin/sh\nyum -y install python3"
#virtual_machine_userdata: "|\n#cloud-config\nchpasswd:\nlist: |\nubuntu:passw0rd\nexpire: False\npackages:\n- ansible\npackage_upgrade: true"
#Examples:
# virtual_machine_userdata: "|\n#cloud-config\nchpasswd:\nlist: |\nubuntu:passw0rd\nexpire: False\npackages:\n- ansible\npackage_upgrade: true"
# Examples:
# userdata: |
# #cloud-config
# chpasswd:
Expand Down Expand Up @@ -99,6 +99,6 @@ virtual_machine_action_wait: true
# Host aggregate details
host_aggregate_name: "multi-arch-compute-aggregate"
host_availability_zone_name: "multi-arch-aggregate"
host_name_list: [<host1>,<host2>,<host3>]
#Examples:
#host_name_list: ["xcloud8","xcloud7","xcloud10"]
host_name_list: [<host1>, <host2>, <host3>]
# Examples:
# host_name_list: ["xcloud8", "xcloud7", "xcloud10"]
Loading