diff --git a/openstack/intel-worker/playbooks/intel-worker-cleanup-playbook.yml b/openstack/intel-worker/playbooks/intel-worker-cleanup-playbook.yml index 01f2081..29d299e 100644 --- a/openstack/intel-worker/playbooks/intel-worker-cleanup-playbook.yml +++ b/openstack/intel-worker/playbooks/intel-worker-cleanup-playbook.yml @@ -1,16 +1,15 @@ --- -- name: OpenStack worker node configuration Tasks +- name: Intel worker vitrual_machine delete hosts: all - tasks: - - name: Intel worker vitrual_machine delete - roles: - - vm-delete + roles: + - virtual_machine_delete - - name: Intel worker flavor create - roles: - - flavor-delete +- name: Intel worker flavor create + hosts: all + roles: + - custom_flavor_delete - - name: Create RHCHOS image - hosts: all - roles: - - rhcosImage-delete +- name: Create RHCHOS image + hosts: all + roles: + - rhcos_delete_image diff --git a/openstack/intel-worker/playbooks/intel-worker-playbook.yml b/openstack/intel-worker/playbooks/intel-worker-playbook.yml index cc32ba2..83cb053 100644 --- a/openstack/intel-worker/playbooks/intel-worker-playbook.yml +++ b/openstack/intel-worker/playbooks/intel-worker-playbook.yml @@ -1,27 +1,29 @@ --- -- name: OpenStack worker node configuration Tasks +- name: Create RHCHOS image hosts: all - tasks: - - name: Create RHCHOS image - roles: - - rhcosImage-create + roles: + - rhcos_create_image - - name: Intel worker flavor create - roles: - - flavor-create +- name: Intel worker flavor create + hosts: all + roles: + - custom_flavor_create - - name: Intel worker vitrual_machine create - roles: - - vm-create +- name: Intel worker vitrual_machine create + hosts: all + roles: + - virtual_machine_create - - name: Intel worker vitrual_machine create - roles: - - vm-server-action - vars: - virtual_machine_server_action: stop +- name: Intel worker vitrual_machine create + hosts: all + roles: + - virtual_machine_action + vars: + virtual_machine_action_name: stop - - name: Intel worker vitrual_machine create - roles: - - vm-server-action - vars: - virtual_machine_server_action: start +- name: Intel worker vitrual_machine create + hosts: all + roles: + - virtual_machine_action + vars: + virtual_machine_action_name: start diff --git a/openstack/intel-worker/playbooks/roles/centosImage-create/defaults/main.yml b/openstack/intel-worker/playbooks/roles/centosImage-create/defaults/main.yml deleted file mode 100644 index 32230ee..0000000 --- a/openstack/intel-worker/playbooks/roles/centosImage-create/defaults/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -# Image details centos -image_name_centos: Centos9_img -image_container_format_centos: bare -image_disk_format_centos: qcow2 -image_dest_filename_centos: /tmp/CentOS-Stream-GenericCloud-9-20230327.0.x86_64.qcow2 -image_is_public_centos: true -image_url_centos: https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20230327.0.x86_64.qcow2 -image_cpu_arch_centos: x86_64 -image_distro_centos: rhel -image_validate_certs_centos: false diff --git a/openstack/intel-worker/playbooks/roles/centosImage-create/tasks/main.yml b/openstack/intel-worker/playbooks/roles/centosImage-create/tasks/main.yml deleted file mode 100644 index 6c96b70..0000000 --- a/openstack/intel-worker/playbooks/roles/centosImage-create/tasks/main.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- 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 }}" diff --git a/openstack/intel-worker/playbooks/roles/centosImage-delete/defaults/main.yml b/openstack/intel-worker/playbooks/roles/centosImage-delete/defaults/main.yml deleted file mode 100644 index 97d39b0..0000000 --- a/openstack/intel-worker/playbooks/roles/centosImage-delete/defaults/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- - -# Image details centos -image_name_centos: Centos9_img -image_container_format_centos: bare -image_disk_format_centos: qcow2 -image_is_public_centos: true -image_cpu_arch_centos: x86_64 -image_distro_centos: rhel diff --git a/openstack/intel-worker/playbooks/roles/centosImage-delete/tasks/main.yml b/openstack/intel-worker/playbooks/roles/centosImage-delete/tasks/main.yml deleted file mode 100644 index 2c4a283..0000000 --- a/openstack/intel-worker/playbooks/roles/centosImage-delete/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- 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 }}" diff --git a/openstack/intel-worker/playbooks/roles/centos_create_image/defaults/main.yml b/openstack/intel-worker/playbooks/roles/centos_create_image/defaults/main.yml new file mode 100644 index 0000000..0ea7ba0 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/centos_create_image/defaults/main.yml @@ -0,0 +1,12 @@ +--- + +# Image details centos +centos_create_image_name: Centos9_img +centos_create_image_container_format: bare +centos_create_image_disk_format: qcow2 +centos_create_image_dest_filename: /tmp/CentOS-Stream-GenericCloud-9-20230327.0.x86_64.qcow2 +centos_create_image_is_public: true +centos_create_image_url: https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20230327.0.x86_64.qcow2 +centos_create_image_cpu_arch: x86_64 +centos_create_image_distro: rhel +centos_create_image_validate_certs: false diff --git a/openstack/intel-worker/playbooks/roles/centos_create_image/tasks/main.yml b/openstack/intel-worker/playbooks/roles/centos_create_image/tasks/main.yml new file mode 100644 index 0000000..a925c40 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/centos_create_image/tasks/main.yml @@ -0,0 +1,21 @@ +--- +- name: Download the Image from the URL and use to create image + ansible.builtin.get_url: + url: "{{ centos_create_image_url }}" + dest: "{{ centos_create_image_dest_filename }}" + mode: "0755" + validate_certs: "{{ centos_create_image_validate_certs }}" + register: image_download_stats + +- name: Create/upload Centos images to openstack. + openstack.cloud.image: + cloud: openstack + state: present + name: "{{ centos_create_image_name }}" + container_format: "{{ centos_create_image_container_format }}" + disk_format: "{{ centos_create_image_disk_format }}" + filename: "{{ centos_create_image_dest_filename }}" + is_public: "{{ centos_create_image_is_public }}" + properties: + cpu_arch: "{{ centos_create_image_cpu_arch }}" + distro: "{{ centos_create_image_distro }}" diff --git a/openstack/intel-worker/playbooks/roles/centos_delete_image/defaults/main.yml b/openstack/intel-worker/playbooks/roles/centos_delete_image/defaults/main.yml new file mode 100644 index 0000000..5eee7af --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/centos_delete_image/defaults/main.yml @@ -0,0 +1,4 @@ +--- + +# Image details centos +centos_delete_image_name: Centos9_img diff --git a/openstack/intel-worker/playbooks/roles/centos_delete_image/tasks/main.yml b/openstack/intel-worker/playbooks/roles/centos_delete_image/tasks/main.yml new file mode 100644 index 0000000..f023605 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/centos_delete_image/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: Remove Centos images to openstack. + openstack.cloud.image: + cloud: openstack + state: absent + name: "{{ centos_delete_image_name }}" diff --git a/openstack/intel-worker/playbooks/roles/custom_flavor_create/defaults/main.yml b/openstack/intel-worker/playbooks/roles/custom_flavor_create/defaults/main.yml new file mode 100644 index 0000000..e7be003 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/custom_flavor_create/defaults/main.yml @@ -0,0 +1,8 @@ +--- +# Custom flavor details +custom_flavor_create_name: rdr_mac_8vcpu_16ram +custom_flavor_create_ram: 16 +custom_flavor_create_vcpus: 8 +custom_flavor_create_disk: 80 +custom_flavor_create_ephemeral: 80 +custom_flavor_create_description: custom flavour for mac intel worker 8 vcpu and 16gb ram diff --git a/openstack/intel-worker/playbooks/roles/custom_flavor_create/tasks/main.yml b/openstack/intel-worker/playbooks/roles/custom_flavor_create/tasks/main.yml new file mode 100644 index 0000000..9701c29 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/custom_flavor_create/tasks/main.yml @@ -0,0 +1,11 @@ +--- +- name: Create flavor to openstack + openstack.cloud.compute_flavor: + cloud: openstack + state: present + name: "{{ custom_flavor_create_name }}" + ram: "{{ custom_flavor_create_ram }}" + vcpus: "{{ custom_flavor_create_vcpus }}" + disk: "{{ custom_flavor_create_disk }}" + ephemeral: "{{ custom_flavor_create_ephemeral }}" + description: "{{ custom_flavor_create_description }}" diff --git a/openstack/intel-worker/playbooks/roles/custom_flavor_delete/defaults/main.yml b/openstack/intel-worker/playbooks/roles/custom_flavor_delete/defaults/main.yml new file mode 100644 index 0000000..dd8773c --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/custom_flavor_delete/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# Custom flavor details +custom_flavor_delete_name: rdr_mac_8vcpu_16ram diff --git a/openstack/intel-worker/playbooks/roles/flavor-delete/tasks/main.yml b/openstack/intel-worker/playbooks/roles/custom_flavor_delete/tasks/main.yml similarity index 72% rename from openstack/intel-worker/playbooks/roles/flavor-delete/tasks/main.yml rename to openstack/intel-worker/playbooks/roles/custom_flavor_delete/tasks/main.yml index e8ddc34..7ec0f4a 100644 --- a/openstack/intel-worker/playbooks/roles/flavor-delete/tasks/main.yml +++ b/openstack/intel-worker/playbooks/roles/custom_flavor_delete/tasks/main.yml @@ -3,4 +3,4 @@ openstack.cloud.compute_flavor: cloud: openstack state: absent - name: "{{ custom_flavor_name }}" + name: "{{ custom_flavor_delete_name }}" diff --git a/openstack/intel-worker/playbooks/roles/flavor-create/defaults/main.yml b/openstack/intel-worker/playbooks/roles/flavor-create/defaults/main.yml deleted file mode 100644 index 377eec0..0000000 --- a/openstack/intel-worker/playbooks/roles/flavor-create/defaults/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Custom flavor details -custom_flavor_name: rdr_mac_8vcpu_16ram -custom_flavor_ram: 16 -custom_flavor_vcpus: 8 -custom_flavor_disk: 80 -custom_flavor_ephemeral: 80 -custom_flavor_description: custom flavour for mac intel worker 8 vcpu and 16gb ram diff --git a/openstack/intel-worker/playbooks/roles/flavor-create/tasks/main.yml b/openstack/intel-worker/playbooks/roles/flavor-create/tasks/main.yml deleted file mode 100644 index 8258b4e..0000000 --- a/openstack/intel-worker/playbooks/roles/flavor-create/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Create flavor to openstack - openstack.cloud.compute_flavor: - cloud: openstack - state: present - name: "{{ custom_flavor_name }}" - ram: "{{ custom_flavor_ram }}" - vcpus: "{{ custom_flavor_vcpus }}" - disk: "{{ custom_flavor_disk }}" - ephemeral: "{{ custom_flavor_ephemeral }}" - description: "{{ custom_flavor_description }}" diff --git a/openstack/intel-worker/playbooks/roles/flavor-delete/defaults/main.yml b/openstack/intel-worker/playbooks/roles/flavor-delete/defaults/main.yml deleted file mode 100644 index 5b51553..0000000 --- a/openstack/intel-worker/playbooks/roles/flavor-delete/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# Custom flavor details -custom_flavor_name: rdr_mac_8vcpu_16ram diff --git a/openstack/intel-worker/playbooks/roles/host-aggregate-create/defaults/main.yml b/openstack/intel-worker/playbooks/roles/host-aggregate-create/defaults/main.yml deleted file mode 100644 index 3f504cd..0000000 --- a/openstack/intel-worker/playbooks/roles/host-aggregate-create/defaults/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Host aggregate details -host_aggregate_name: multi-arch-compute-aggregate -host_availability_zone_name: multi-arch-aggregate -host_name_list: [, , ] -# Examples: -# host_name_list: ["xcloud8", "xcloud7", "xcloud10"] diff --git a/openstack/intel-worker/playbooks/roles/host-aggregate-create/tasks/main.yml b/openstack/intel-worker/playbooks/roles/host-aggregate-create/tasks/main.yml deleted file mode 100644 index f4489a7..0000000 --- a/openstack/intel-worker/playbooks/roles/host-aggregate-create/tasks/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- 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 }}" diff --git a/openstack/intel-worker/playbooks/roles/host-aggregate-delete/defaults/main.yml b/openstack/intel-worker/playbooks/roles/host-aggregate-delete/defaults/main.yml deleted file mode 100644 index 55ac066..0000000 --- a/openstack/intel-worker/playbooks/roles/host-aggregate-delete/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# Host aggregate details -host_aggregate_name: multi-arch-compute-aggregate diff --git a/openstack/intel-worker/playbooks/roles/host_aggregate_create/defaults/main.yml b/openstack/intel-worker/playbooks/roles/host_aggregate_create/defaults/main.yml new file mode 100644 index 0000000..b398fa9 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/host_aggregate_create/defaults/main.yml @@ -0,0 +1,7 @@ +--- +# Host aggregate details +host_aggregate_create_name: multi-arch-compute-aggregate +host_aggregate_create_availability_zone_name: multi-arch-aggregate +host_aggregate_create_name_list: [, , ] +# Examples: +# host_name_list: ["xcloud8", "xcloud7", "xcloud10"] diff --git a/openstack/intel-worker/playbooks/roles/host_aggregate_create/tasks/main.yml b/openstack/intel-worker/playbooks/roles/host_aggregate_create/tasks/main.yml new file mode 100644 index 0000000..ee0c220 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/host_aggregate_create/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- name: Create host aggregate (host group) to openstack + openstack.cloud.host_aggregate: + cloud: openstack + state: present + name: "{{ host_aggregate_create_name }}" + hosts: "{{ host_aggregate_create_name_list }}" + metadata: + availability_zone: "{{ host_aggregate_create_availability_zone_name }}" diff --git a/openstack/intel-worker/playbooks/roles/host_aggregate_delete/defaults/main.yml b/openstack/intel-worker/playbooks/roles/host_aggregate_delete/defaults/main.yml new file mode 100644 index 0000000..70bb69c --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/host_aggregate_delete/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# Host aggregate details +host_aggregate_delete_name: multi-arch-compute-aggregate diff --git a/openstack/intel-worker/playbooks/roles/host-aggregate-delete/tasks/main.yml b/openstack/intel-worker/playbooks/roles/host_aggregate_delete/tasks/main.yml similarity index 75% rename from openstack/intel-worker/playbooks/roles/host-aggregate-delete/tasks/main.yml rename to openstack/intel-worker/playbooks/roles/host_aggregate_delete/tasks/main.yml index 3ff988a..683d07e 100644 --- a/openstack/intel-worker/playbooks/roles/host-aggregate-delete/tasks/main.yml +++ b/openstack/intel-worker/playbooks/roles/host_aggregate_delete/tasks/main.yml @@ -3,4 +3,4 @@ openstack.cloud.host_aggregate: cloud: openstack state: absent - name: "{{ host_aggregate_name }}" + name: "{{ host_aggregate_delete_name }}" diff --git a/openstack/intel-worker/playbooks/roles/rhcosImage-create/defaults/main.yml b/openstack/intel-worker/playbooks/roles/rhcosImage-create/defaults/main.yml deleted file mode 100644 index bc3ce3f..0000000 --- a/openstack/intel-worker/playbooks/roles/rhcosImage-create/defaults/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# Image details Rhcos -image_name_rhcos: RHCOS_img -image_container_format_rhcos: bare -image_disk_format_rhcos: qcow2 -image_dest_filename_rhcos: /tmp/rhcos-openstack.x86_64.qcow2.gz -image_is_public_rhcos: true -image_url_rhcos: https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos/latest/rhcos-openstack.x86_64.qcow2.gz -image_cpu_arch_rhcos: x86_64 -image_distro_rhcos: rhel -image_validate_certs_rhcos: false diff --git a/openstack/intel-worker/playbooks/roles/rhcosImage-create/tasks/main.yml b/openstack/intel-worker/playbooks/roles/rhcosImage-create/tasks/main.yml deleted file mode 100644 index f806293..0000000 --- a/openstack/intel-worker/playbooks/roles/rhcosImage-create/tasks/main.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- 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 }}" diff --git a/openstack/intel-worker/playbooks/roles/rhcosImage-delete/defaults/main.yml b/openstack/intel-worker/playbooks/roles/rhcosImage-delete/defaults/main.yml deleted file mode 100644 index 0a31d42..0000000 --- a/openstack/intel-worker/playbooks/roles/rhcosImage-delete/defaults/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Image details Rhcos -image_name_rhcos: RHCOS_img -image_container_format_rhcos: bare -image_disk_format_rhcos: qcow2 -image_cpu_arch_rhcos: x86_64 -image_distro_rhcos: rhel diff --git a/openstack/intel-worker/playbooks/roles/rhcosImage-delete/tasks/main.yml b/openstack/intel-worker/playbooks/roles/rhcosImage-delete/tasks/main.yml deleted file mode 100644 index 7b9daf0..0000000 --- a/openstack/intel-worker/playbooks/roles/rhcosImage-delete/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- 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 }}" diff --git a/openstack/intel-worker/playbooks/roles/rhcos_create_image/defaults/main.yml b/openstack/intel-worker/playbooks/roles/rhcos_create_image/defaults/main.yml new file mode 100644 index 0000000..cbe6040 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/rhcos_create_image/defaults/main.yml @@ -0,0 +1,11 @@ +--- +# Image details Rhcos +rhcos_create_image_name: RHCOS_img +rhcos_create_image_container_format: bare +rhcos_create_image_disk_format: qcow2 +rhcos_create_image_dest_filename: /tmp/rhcos-openstack.x86_64.qcow2.gz +rhcos_create_image_is_public: true +rhcos_create_image_url: https://mirror.openshift.com/pub/openshift-v4/x86_64/dependencies/rhcos/latest/rhcos-openstack.x86_64.qcow2.gz +rhcos_create_image_cpu_arch: x86_64 +rhcos_create_image_distro: rhel +rhcos_create_image_validate_certs: false diff --git a/openstack/intel-worker/playbooks/roles/rhcos_create_image/tasks/main.yml b/openstack/intel-worker/playbooks/roles/rhcos_create_image/tasks/main.yml new file mode 100644 index 0000000..ac37bde --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/rhcos_create_image/tasks/main.yml @@ -0,0 +1,21 @@ +--- +- name: Download the Image from the URL and use to create image + ansible.builtin.get_url: + url: "{{ rhcos_create_image_url }}" + dest: "{{ rhcos_create_image_dest_filename }}" + mode: "0755" + validate_certs: "{{ rhcos_create_image_validate_certs }}" + register: image_download_stats + +- name: Create/upload RHCOS images to openstack. + openstack.cloud.image: + cloud: openstack + state: present + name: "{{ rhcos_create_image_name_rhcos }}" + container_format: "{{ rhcos_create_image_container_format }}" + disk_format: "{{ rhcos_create_image_disk_format }}" + filename: "{{ rhcos_create_image_dest_filename }}" + is_public: "{{ rhcos_create_image_is_public }}" + properties: + cpu_arch: "{{ rhcos_create_image_cpu_arch }}" + distro: "{{ rhcos_create_image_distro }}" diff --git a/openstack/intel-worker/playbooks/roles/rhcos_delete_image/defaults/main.yml b/openstack/intel-worker/playbooks/roles/rhcos_delete_image/defaults/main.yml new file mode 100644 index 0000000..32b7bc2 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/rhcos_delete_image/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# Image details Rhcos +rhcos_delete_image_name: RHCOS_img diff --git a/openstack/intel-worker/playbooks/roles/rhcos_delete_image/tasks/main.yml b/openstack/intel-worker/playbooks/roles/rhcos_delete_image/tasks/main.yml new file mode 100644 index 0000000..1a07c84 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/rhcos_delete_image/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: Remove RHCOS images from openstack. + openstack.cloud.image: + cloud: openstack + state: absent + name: "{{ rhcos_create_image_name }}" diff --git a/openstack/intel-worker/playbooks/roles/vm-server-action/defaults/main.yml b/openstack/intel-worker/playbooks/roles/virtual_machine_action/defaults/main.yml similarity index 88% rename from openstack/intel-worker/playbooks/roles/vm-server-action/defaults/main.yml rename to openstack/intel-worker/playbooks/roles/virtual_machine_action/defaults/main.yml index eea6dca..bf45368 100644 --- a/openstack/intel-worker/playbooks/roles/vm-server-action/defaults/main.yml +++ b/openstack/intel-worker/playbooks/roles/virtual_machine_action/defaults/main.yml @@ -1,6 +1,6 @@ --- # Virtual machine action -virtual_machine_server_action: start +virtual_machine_action_name: start # server action list # "lock" # "pause" diff --git a/openstack/intel-worker/playbooks/roles/vm-server-action/tasks/main.yml b/openstack/intel-worker/playbooks/roles/virtual_machine_action/tasks/main.yml similarity index 72% rename from openstack/intel-worker/playbooks/roles/vm-server-action/tasks/main.yml rename to openstack/intel-worker/playbooks/roles/virtual_machine_action/tasks/main.yml index 2d3de18..f8409d0 100644 --- a/openstack/intel-worker/playbooks/roles/vm-server-action/tasks/main.yml +++ b/openstack/intel-worker/playbooks/roles/virtual_machine_action/tasks/main.yml @@ -2,7 +2,7 @@ - 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 }}" + action: "{{ virtual_machine_action_name }}" + server: "{{ virtual_machine_create_name }}" timeout: "{{ virtual_machine_action_timeout }}" wait: "{{ virtual_machine_action_wait }}" diff --git a/openstack/intel-worker/playbooks/roles/virtual_machine_create/defaults/main.yml b/openstack/intel-worker/playbooks/roles/virtual_machine_create/defaults/main.yml new file mode 100644 index 0000000..78e47f5 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/virtual_machine_create/defaults/main.yml @@ -0,0 +1,23 @@ +--- +# Virtual_machine details +virtual_machine_create_name: rdr-mac-worker +virtual_machine_create_region_name: RegionOne +virtual_machine_create_availability_zone: +virtual_machine_create_image_name: +virtual_machine_create_flavor: +virtual_machine_create_volume_size: 80 +virtual_machine_create_keypair_name: +virtual_machine_create_network_name: +virtual_machine_create_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: +# userdata: | +# #cloud-config +# chpasswd: +# list: | +# ubuntu:{{ default_password }} +# expire: False +# packages: +# - ansible +# package_upgrade: true +virtual_machine_create_timeout: 300 diff --git a/openstack/intel-worker/playbooks/roles/virtual_machine_create/tasks/main.yml b/openstack/intel-worker/playbooks/roles/virtual_machine_create/tasks/main.yml new file mode 100644 index 0000000..bae46fc --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/virtual_machine_create/tasks/main.yml @@ -0,0 +1,17 @@ +--- +# file: intel-worker-playbook.yml + +- name: Create server in the Multi-Arch Compute OpenStack Instance + openstack.cloud.server: + cloud: openstack + state: present + name: "{{ virtual_machine_create_name }}" + region_name: "{{ virtual_machine_create_region_name }}" + availability_zone: "{{ vitrual_machine_create_availability_zone }}" + image: "{{ virtual_machine_create_image_name }}" + flavor: "{{ virtual_machine_create_flavor }}" + volume_size: "{{ virtual_machine_create_volume_size }}" + key_name: "{{ virtual_machine_create_keypair_name }}" + network: "{{ virtual_machine_create_network_name }}" + userdata: "{{ virtual_machine_create_userdata }}" + timeout: "{{ virtual_machine_create_timeout }}" diff --git a/openstack/intel-worker/playbooks/roles/virtual_machine_delete/defaults/main.yml b/openstack/intel-worker/playbooks/roles/virtual_machine_delete/defaults/main.yml new file mode 100644 index 0000000..734b1f7 --- /dev/null +++ b/openstack/intel-worker/playbooks/roles/virtual_machine_delete/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# Virtual_machine details +virtual_machine_delete_name: rdr-mac-worker diff --git a/openstack/intel-worker/playbooks/roles/vm-delete/tasks/main.yml b/openstack/intel-worker/playbooks/roles/virtual_machine_delete/tasks/main.yml similarity index 74% rename from openstack/intel-worker/playbooks/roles/vm-delete/tasks/main.yml rename to openstack/intel-worker/playbooks/roles/virtual_machine_delete/tasks/main.yml index 507722d..6260af4 100644 --- a/openstack/intel-worker/playbooks/roles/vm-delete/tasks/main.yml +++ b/openstack/intel-worker/playbooks/roles/virtual_machine_delete/tasks/main.yml @@ -3,4 +3,4 @@ openstack.cloud.server: cloud: openstack state: absent - name: "{{ virtual_machine_name }}" + name: "{{ virtual_machine_delete_name }}" diff --git a/openstack/intel-worker/playbooks/roles/vm-create/defaults/main.yml b/openstack/intel-worker/playbooks/roles/vm-create/defaults/main.yml deleted file mode 100644 index 58e95f9..0000000 --- a/openstack/intel-worker/playbooks/roles/vm-create/defaults/main.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -# Virtual_machine details -virtual_machine_name: rdr-mac-worker -virtual_machine_region_name: RegionOne -vitrual_machine_availability_zone: -virtual_machine_image_name: -virtual_machine_flavor: -virtual_machine_volume_size: 80 -virtual_machine_keypair_name: -virtual_machine_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: -# userdata: | -# #cloud-config -# chpasswd: -# list: | -# ubuntu:{{ default_password }} -# expire: False -# packages: -# - ansible -# package_upgrade: true -virtual_machine_timeout: 300 diff --git a/openstack/intel-worker/playbooks/roles/vm-create/tasks/main.yml b/openstack/intel-worker/playbooks/roles/vm-create/tasks/main.yml deleted file mode 100644 index bd5ed5b..0000000 --- a/openstack/intel-worker/playbooks/roles/vm-create/tasks/main.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -# file: intel-worker-playbook.yml - -- 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 }}" diff --git a/openstack/intel-worker/playbooks/roles/vm-delete/defaults/main.yml b/openstack/intel-worker/playbooks/roles/vm-delete/defaults/main.yml deleted file mode 100644 index 3857925..0000000 --- a/openstack/intel-worker/playbooks/roles/vm-delete/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# Virtual_machine details -virtual_machine_name: rdr-mac-worker