From e29167b462035a57dd3fa820f273ce517d2b2586 Mon Sep 17 00:00:00 2001 From: sd109 Date: Mon, 25 Mar 2024 10:36:19 +0000 Subject: [PATCH 01/45] Ignore vscode folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d2d6bd4..d73b939 100644 --- a/.gitignore +++ b/.gitignore @@ -114,6 +114,7 @@ ansible/collections/**/ *~ .*.swp .*sw? +.vscode/ # Ignore working dirs ansible/openstack-config-image-cache From 216e5cf0688bfc15c4f8bd5eb4c4962971b91491 Mon Sep 17 00:00:00 2001 From: sd109 Date: Mon, 25 Mar 2024 10:39:22 +0000 Subject: [PATCH 02/45] Disable keystone auth webhook by default --- ansible/templates/magnum-capi-templates.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/templates/magnum-capi-templates.j2 b/ansible/templates/magnum-capi-templates.j2 index f1d2cc7..5c30ec6 100644 --- a/ansible/templates/magnum-capi-templates.j2 +++ b/ansible/templates/magnum-capi-templates.j2 @@ -1,5 +1,5 @@ # Magnum cluster templates generated using latest upstream release tags -# To make use of the generated config snippets, copy them to the +# To make use of the generated config snippets, copy them to the # openstack_container_clusters_templates list. # List snippet to add to existing openstack_container_clusters_templates: @@ -13,6 +13,7 @@ labels: monitoring_enabled: "True" kube_dashboard_enabled: "True" + keystone_auth_enabled: "false" capi_helm_chart_version: "{{ capi_helm_chart_release_data.json.tag_name }}" octavia_provider: {{ magnum_loadbalancer_provider }} external_network_id: {{ magnum_external_net_name }} From c67a42cb519ef320ad7e2ed0dd97118c721f7eb8 Mon Sep 17 00:00:00 2001 From: sd109 Date: Mon, 25 Mar 2024 10:39:41 +0000 Subject: [PATCH 03/45] Make labels lowercase At the moment the CAPI driver expects lowercase for these labels so the previous values were ignored. This will be fixed upstream later. --- ansible/templates/magnum-capi-templates.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/templates/magnum-capi-templates.j2 b/ansible/templates/magnum-capi-templates.j2 index 5c30ec6..65c5c7a 100644 --- a/ansible/templates/magnum-capi-templates.j2 +++ b/ansible/templates/magnum-capi-templates.j2 @@ -11,8 +11,8 @@ {% for item in new_template_data %} {{ item.key | replace('-', '_') }}_{{ item.value.kubernetes_version | replace('.', '_') }}: labels: - monitoring_enabled: "True" - kube_dashboard_enabled: "True" + monitoring_enabled: "true" + kube_dashboard_enabled: "true" keystone_auth_enabled: "false" capi_helm_chart_version: "{{ capi_helm_chart_release_data.json.tag_name }}" octavia_provider: {{ magnum_loadbalancer_provider }} From 2595e0e9c24f5dc7a73970e24271011a36c6b107 Mon Sep 17 00:00:00 2001 From: Jack Hodgkiss Date: Tue, 26 Mar 2024 09:52:32 +0000 Subject: [PATCH 04/45] feat!: bump `stackhpc.openstack` collection --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 2657e4c..e7f338a 100644 --- a/requirements.yml +++ b/requirements.yml @@ -3,4 +3,4 @@ collections: - name: openstack.cloud version: 2.1.0 - name: stackhpc.openstack - version: 0.1.0 + version: 0.1.1 From 0fa661906a8590f372033b343eda356aad9f8c2d Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Fri, 5 Apr 2024 16:48:55 +0000 Subject: [PATCH 05/45] Add Cloudkitty role variables definition to openstack-config. --- etc/openstack-config/openstack-config.yml | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index adcab45..34299b2 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -96,6 +96,46 @@ # Whether generated cluster templates should be public by default (defaults to 'True') # magnum_cluster_templates_public: +############################################################################### +# Configuration variables for a Cloudkitty ratings service deployment. + +# Path to where a virtual environment directory will be created. +# +#os_ratings_venv: /path/to/venv/directory + +# File path or URL containing Python upper constraints. +# +#os_ratings_upper_constraints_file: /path/to/upper_constraints_file + +# Environment variables for the OpenStack CLI. By default this is left empty. +# +#os_ratings_environment: +# - name: ENV_VAR_NAME +# value: ENV_VAR_VALUE + +# A list where each item is a dictionary mapping the associated fields, +# with the 'mappings' field also being a list of dictionaries. +# Example of the mappings and their fields can be found below, +# however for more information please refer to the README.md file. +# +#os_ratings_hashmap_field_mappings: +# - service: SERVICE_NAME +# name: FIELD_NAME +# mappings: +# - value: MAPPING_VALUE +# cost: MAPPING_COST +# group: MAPPING_GROUP +# type: MAPPING_TYPE + +# Much like the field mappings above, the service mappings are a list of +# dictionaries, however these are not associated with a field. +# +#os_ratings_hashmap_service_mappings: +# - service: SERVICE_NAME +# cost: MAPPING_COST +# group: MAPPING_GROUP +# type: MAPPING_TYPE + ############################################################################### # Dummy variable to allow Ansible to accept this file. workaround_ansible_issue_8743: yes From 05a6443b53dc28fc44399da02bd0c41013110d9d Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Mon, 8 Apr 2024 11:00:31 +0000 Subject: [PATCH 06/45] Cloudkitty.yml example file. --- examples/cloudkitty.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/cloudkitty.yml diff --git a/examples/cloudkitty.yml b/examples/cloudkitty.yml new file mode 100644 index 0000000..3ea16eb --- /dev/null +++ b/examples/cloudkitty.yml @@ -0,0 +1,35 @@ +--- +############################################################################### +# Configuration of cloudkitty for openstack. + +# Example playbook for configuring and registering Cloudkitty fields. +# Included is registration for two different Nova flavor mappings and +# a service mapping based on the stored image size in Glance. + +- name: Ensure Cloudkitty ratings are registered + hosts: controllers[0] + tasks: + - import_role: + name: stackhpc.openstack.os_ratings + vars: + os_ratings_venv: "~/os-ratings-venv" + os_ratings_environment: + OS_AUTH_URL: "{{ lookup('env', 'OS_AUTH_URL') }}" + os_ratings_hashmap_field_mappings: + - service: instance + name: flavor_id + mappings: + - value: small + cost: 1.0 + group: instance_uptime_flavor_id + type: flat + - value: large + cost: 2.0 + group: instance_uptime_flavor_id + type: flat + os_ratings_hashmap_service_mappings: + - service: image.size + cost: 0.1 + group: volume_ceph + type: flat + From 375183b6466fd030396f090b13254f3ac0ab2e45 Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Mon, 8 Apr 2024 12:40:59 +0000 Subject: [PATCH 07/45] Added ratings role config and example. Changed requirements. --- ansible/openstack-ratings.yml | 12 ++++++++++++ ansible/openstack.yml | 1 + etc/openstack-config/openstack-config.yml | 10 +++++----- examples/{cloudkitty.yml => ratings.yml} | 2 +- requirements.yml | 6 ++++-- 5 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 ansible/openstack-ratings.yml rename examples/{cloudkitty.yml => ratings.yml} (97%) diff --git a/ansible/openstack-ratings.yml b/ansible/openstack-ratings.yml new file mode 100644 index 0000000..da7680a --- /dev/null +++ b/ansible/openstack-ratings.yml @@ -0,0 +1,12 @@ +--- +- name: Generate OpenStack software ratings + hosts: controllers[0] + tags: + - ratings + roles: + - role: stackhpc.openstack.os_ratings + os_ratings_hashmap_field_mappings: "{{ ratings_hashmap_field_mappings }}" + os_ratings_hashmap_service_mappings: "{{ ratings_hashmap_service_mappings }}" + os_ratings_venv: "{{ ratings_venv }}" + os_ratings_upper_constraints_file: "{{ ratings_upper_constraints_file }}" + os_ratings_environment: "{{ ratings_environment }}" \ No newline at end of file diff --git a/ansible/openstack.yml b/ansible/openstack.yml index cfaf612..ab167a4 100644 --- a/ansible/openstack.yml +++ b/ansible/openstack.yml @@ -6,3 +6,4 @@ - import_playbook: openstack-images.yml - import_playbook: openstack-host-aggregates.yml - import_playbook: openstack-container-clusters.yml +- import_playbook: openstack-ratings.yml \ No newline at end of file diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index 34299b2..c316899 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -101,15 +101,15 @@ # Path to where a virtual environment directory will be created. # -#os_ratings_venv: /path/to/venv/directory +#ratings_venv: /path/to/venv/directory # File path or URL containing Python upper constraints. # -#os_ratings_upper_constraints_file: /path/to/upper_constraints_file +#ratings_upper_constraints_file: /path/to/upper_constraints_file # Environment variables for the OpenStack CLI. By default this is left empty. # -#os_ratings_environment: +#ratings_environment: # - name: ENV_VAR_NAME # value: ENV_VAR_VALUE @@ -118,7 +118,7 @@ # Example of the mappings and their fields can be found below, # however for more information please refer to the README.md file. # -#os_ratings_hashmap_field_mappings: +#ratings_hashmap_field_mappings: # - service: SERVICE_NAME # name: FIELD_NAME # mappings: @@ -130,7 +130,7 @@ # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. # -#os_ratings_hashmap_service_mappings: +#ratings_hashmap_service_mappings: # - service: SERVICE_NAME # cost: MAPPING_COST # group: MAPPING_GROUP diff --git a/examples/cloudkitty.yml b/examples/ratings.yml similarity index 97% rename from examples/cloudkitty.yml rename to examples/ratings.yml index 3ea16eb..2fccb3c 100644 --- a/examples/cloudkitty.yml +++ b/examples/ratings.yml @@ -7,7 +7,7 @@ # a service mapping based on the stored image size in Glance. - name: Ensure Cloudkitty ratings are registered - hosts: controllers[0] + hosts: localhost tasks: - import_role: name: stackhpc.openstack.os_ratings diff --git a/requirements.yml b/requirements.yml index e7f338a..433a047 100644 --- a/requirements.yml +++ b/requirements.yml @@ -2,5 +2,7 @@ collections: - name: openstack.cloud version: 2.1.0 - - name: stackhpc.openstack - version: 0.1.1 + - name: https://github.com/stackhpc/ansible-collection-openstack.git + version: cloudkitty + # - name: stackhpc.openstack + # version: 0.1.1 From 5c95e93a003b30c94b44975105b231eee2d800d4 Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Tue, 9 Apr 2024 08:35:49 +0000 Subject: [PATCH 08/45] Configure some cloudkitty settings. --- ansible/group_vars/all/openstack | 40 +++++++++++++++++++++++ ansible/openstack-ratings.yml | 2 +- etc/openstack-config/openstack-config.yml | 37 ++++++++++++--------- 3 files changed, 62 insertions(+), 17 deletions(-) diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index 462f3eb..67a3b1a 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -48,6 +48,46 @@ openstack_image_elements: [] # List of diskimage-builder element git repos to pull openstack_image_git_elements: [] +############################################################################### +# Configuration variables for a Cloudkitty ratings service deployment. + +# Path to where a virtual environment directory will be created. +# +ratings_venv: "~/os-ratings-venv" + +# File path or URL containing Python upper constraints. +# +ratings_upper_constraints_file: [] + +# Environment variables for the OpenStack CLI. By default this is left empty. +# +#ratings_environment: +# - name: ENV_VAR_NAME +# value: ENV_VAR_VALUE + +# A list where each item is a dictionary mapping the associated fields, +# with the 'mappings' field also being a list of dictionaries. +# Example of the mappings and their fields can be found below, +# however for more information please refer to the README.md file. +# +#ratings_hashmap_field_mappings: +# - service: SERVICE_NAME +# name: FIELD_NAME +# mappings: +# - value: MAPPING_VALUE +# cost: MAPPING_COST +# group: MAPPING_GROUP +# type: MAPPING_TYPE + +# Much like the field mappings above, the service mappings are a list of +# dictionaries, however these are not associated with a field. +# +#ratings_hashmap_service_mappings: +# - service: SERVICE_NAME +# cost: MAPPING_COST +# group: MAPPING_GROUP +# type: MAPPING_TYPE + ############################################################################### # Configuration of nova host aggregates for OpenStack. diff --git a/ansible/openstack-ratings.yml b/ansible/openstack-ratings.yml index da7680a..d7fc573 100644 --- a/ansible/openstack-ratings.yml +++ b/ansible/openstack-ratings.yml @@ -1,6 +1,6 @@ --- - name: Generate OpenStack software ratings - hosts: controllers[0] + hosts: localhost tags: - ratings roles: diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index c316899..5bf7885 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -101,15 +101,15 @@ # Path to where a virtual environment directory will be created. # -#ratings_venv: /path/to/venv/directory +ratings_venv: "~/os-ratings-venv" # File path or URL containing Python upper constraints. # -#ratings_upper_constraints_file: /path/to/upper_constraints_file +# ratings_upper_constraints_file: /path/to/upper_constraints_file # Environment variables for the OpenStack CLI. By default this is left empty. # -#ratings_environment: +# ratings_environment: # - name: ENV_VAR_NAME # value: ENV_VAR_VALUE @@ -118,23 +118,28 @@ # Example of the mappings and their fields can be found below, # however for more information please refer to the README.md file. # -#ratings_hashmap_field_mappings: -# - service: SERVICE_NAME -# name: FIELD_NAME -# mappings: -# - value: MAPPING_VALUE -# cost: MAPPING_COST -# group: MAPPING_GROUP -# type: MAPPING_TYPE +ratings_hashmap_field_mappings: + - service: instance + name: flavor_id + mappings: + - value: small + cost: 1.0 + group: instance_uptime_flavor_id + type: flat + - value: large + cost: 2.0 + group: instance_uptime_flavor_id + type: flat + # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. # -#ratings_hashmap_service_mappings: -# - service: SERVICE_NAME -# cost: MAPPING_COST -# group: MAPPING_GROUP -# type: MAPPING_TYPE +ratings_hashmap_service_mappings: + - service: image.size + cost: 0.1 + group: volume_ceph + type: flat ############################################################################### # Dummy variable to allow Ansible to accept this file. From da06a0527b47d4e879ef7153f979f462577cfec1 Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Tue, 9 Apr 2024 08:58:44 +0000 Subject: [PATCH 09/45] Add type to GitHub requirements. --- requirements.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.yml b/requirements.yml index 433a047..b509ca4 100644 --- a/requirements.yml +++ b/requirements.yml @@ -3,6 +3,7 @@ collections: - name: openstack.cloud version: 2.1.0 - name: https://github.com/stackhpc/ansible-collection-openstack.git + type: git version: cloudkitty # - name: stackhpc.openstack # version: 0.1.1 From d4a16504d9c8fd57a860668f0424f76135506f9f Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Tue, 9 Apr 2024 09:07:51 +0000 Subject: [PATCH 10/45] Amend group variable default. --- ansible/group_vars/all/openstack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index 67a3b1a..2c33adf 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -61,7 +61,7 @@ ratings_upper_constraints_file: [] # Environment variables for the OpenStack CLI. By default this is left empty. # -#ratings_environment: +ratings_environment: [] # - name: ENV_VAR_NAME # value: ENV_VAR_VALUE From 15c130ce2208a7815ce9ee9d7b399ec79507b59b Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Tue, 9 Apr 2024 11:21:20 +0100 Subject: [PATCH 11/45] Fix Ansible Galaxy instructions --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index 13f69ba..f1f7b5d 100644 --- a/README.rst +++ b/README.rst @@ -23,6 +23,7 @@ packages. For example: Install Ansible role and collection dependencies from Ansible Galaxy: .. code-block:: + $ ansible-galaxy collection install \ -p ansible/collections \ -r requirements.yml From 0dac19cce21e41fe84f6d80fb724a7b07bcf9b61 Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Tue, 9 Apr 2024 11:02:03 +0000 Subject: [PATCH 12/45] Change cloudkitty venv to point to openstack_venv. --- ansible/group_vars/all/openstack | 4 - ansible/openstack-ratings.yml | 2 +- etc/openstack-config/openstack-config.yml | 4 - .../openstack-config_template.yml | 137 ++++++++++++++++++ examples/ratings.yml | 2 +- 5 files changed, 139 insertions(+), 10 deletions(-) create mode 100644 etc/openstack-config/openstack-config_template.yml diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index 2c33adf..80fd88c 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -51,10 +51,6 @@ openstack_image_git_elements: [] ############################################################################### # Configuration variables for a Cloudkitty ratings service deployment. -# Path to where a virtual environment directory will be created. -# -ratings_venv: "~/os-ratings-venv" - # File path or URL containing Python upper constraints. # ratings_upper_constraints_file: [] diff --git a/ansible/openstack-ratings.yml b/ansible/openstack-ratings.yml index d7fc573..2d02d2d 100644 --- a/ansible/openstack-ratings.yml +++ b/ansible/openstack-ratings.yml @@ -7,6 +7,6 @@ - role: stackhpc.openstack.os_ratings os_ratings_hashmap_field_mappings: "{{ ratings_hashmap_field_mappings }}" os_ratings_hashmap_service_mappings: "{{ ratings_hashmap_service_mappings }}" - os_ratings_venv: "{{ ratings_venv }}" + os_ratings_venv: "{{ openstack_venv }}" os_ratings_upper_constraints_file: "{{ ratings_upper_constraints_file }}" os_ratings_environment: "{{ ratings_environment }}" \ No newline at end of file diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index 5bf7885..71015d0 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -99,10 +99,6 @@ ############################################################################### # Configuration variables for a Cloudkitty ratings service deployment. -# Path to where a virtual environment directory will be created. -# -ratings_venv: "~/os-ratings-venv" - # File path or URL containing Python upper constraints. # # ratings_upper_constraints_file: /path/to/upper_constraints_file diff --git a/etc/openstack-config/openstack-config_template.yml b/etc/openstack-config/openstack-config_template.yml new file mode 100644 index 0000000..4c0b087 --- /dev/null +++ b/etc/openstack-config/openstack-config_template.yml @@ -0,0 +1,137 @@ +--- +############################################################################### +# Configuration of OpenStack projects and users user environment. + +# List of OpenStack domains. Format is as required by the stackhpc.os-projects +# role. +#openstack_domains: + +# List of OpenStack projects. Format is as required by the stackhpc.os-projects +# role. +#openstack_projects: + +############################################################################### +# Configuration of networks, subnets and routers. + +# List of networks in the openstack system. Format is as required by the +# stackhpc.os-networks role. +#openstack_networks: + +# List of routers in the openstack project. Format is as required by the +# stackhpc.os-networks role. +#openstack_routers: + +# List of security groups in the openstack project. +# Format is as required by the stackhpc.os-networks role. +#openstack_security_groups: + +# List of RBAC definitions in the openstack projct. Format is as required by the +# stackhpc.os-networks role. +#openstack_networks_rbac: + +############################################################################### +# Configuration of nova flavors. + +# List of nova flavors in the openstack project. Format is as required by the +# stackhpc.os-flavors role. +#openstack_flavors: + +############################################################################### +# Configuration of nova host aggregates. + +# List of nova host aggregates. Format is as required by the +# stackhpc.os_host_aggregates role. +#openstack_host_aggregates: + +############################################################################### +# Configuration of Glance software images. + +# List of Glance images. Format is as required by the stackhpc.os-images role. +#openstack_images: + +# List of Diskimage Builder (DIB) elements paths to include in image builds. +#openstack_image_elements: + +# List of Diskimage Builder (DIB) elements Git repositories to use in image +# builds. +#openstack_image_git_elements: + +############################################################################### +# Configuration of Magnum container clusters. + +# List of magnum cluster templates. Format is as required by the +# stackhpc.os-container-clusters role. +#openstack_container_clusters_templates: + +############################################################################### +# Configuration variables for generating new Magnum cluster template config. + +# These variables must be defined before using the generating new cluster +# templates - see repo README for more details. + +# Must have at least 2 CPUs, 4GB RAM and 20GB disk +# magnum_default_master_flavor_name: +# magnum_default_worker_flavor_name: + +# Network to create tenant cluster FIPs on +# magnum_external_net_name: + +# Provider for cluster loadbalancers (e.g. 'ovn') +# magnum_loadbalancer_provider: + +# Kubernetes CNI to use for cluster templates (defaults to 'calico') +# Must be one of the options supported by capi-helm-charts, see +# https://github.com/stackhpc/capi-helm-charts/tree/main/charts/cluster-addons#container-network-interface-cni-plugins +# magnum_default_network_driver: + +# Whether to create a master nodes loadbalancer for cluster templates (defaults to 'True') +# magnum_master_lb_enabled: + +# Whether to add a floating IP to the loadbalancer for cluster templates (defaults to 'True') +# magnum_cluster_floating_ip_enabled: + +# List of nameservers to use for cluster templates +# magnum_cluster_default_dns_nameservers: + +# Whether generated cluster templates should be public by default (defaults to 'True') +# magnum_cluster_templates_public: + +############################################################################### +# Configuration variables for a Cloudkitty ratings service deployment. + +# File path or URL containing Python upper constraints. +# +#ratings_upper_constraints_file: /path/to/upper_constraints_file + +# Environment variables for the OpenStack CLI. By default this is left empty. +# +#ratings_environment: +# - name: ENV_VAR_NAME +# value: ENV_VAR_VALUE + +# A list where each item is a dictionary mapping the associated fields, +# with the 'mappings' field also being a list of dictionaries. +# Example of the mappings and their fields can be found below, +# however for more information please refer to the README.md file. +# +#ratings_hashmap_field_mappings: +# - service: SERVICE_NAME +# name: FIELD_NAME +# mappings: +# - value: MAPPING_VALUE +# cost: MAPPING_COST +# group: MAPPING_GROUP +# type: MAPPING_TYPE + +# Much like the field mappings above, the service mappings are a list of +# dictionaries, however these are not associated with a field. +# +#ratings_hashmap_service_mappings: +# - service: SERVICE_NAME +# cost: MAPPING_COST +# group: MAPPING_GROUP +# type: MAPPING_TYPE + +############################################################################### +# Dummy variable to allow Ansible to accept this file. +workaround_ansible_issue_8743: yes diff --git a/examples/ratings.yml b/examples/ratings.yml index 2fccb3c..e39cc63 100644 --- a/examples/ratings.yml +++ b/examples/ratings.yml @@ -12,7 +12,7 @@ - import_role: name: stackhpc.openstack.os_ratings vars: - os_ratings_venv: "~/os-ratings-venv" + os_ratings_venv: "{{ openstack_venv }}" os_ratings_environment: OS_AUTH_URL: "{{ lookup('env', 'OS_AUTH_URL') }}" os_ratings_hashmap_field_mappings: From f95b0f8f1955ee3453d41339235b73912f3a2f7b Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Wed, 10 Apr 2024 10:01:49 +0000 Subject: [PATCH 13/45] Working Cloudkitty config. --- ansible/group_vars/all/openstack | 4 +-- etc/openstack-config/openstack-config.yml | 34 +++++++++++++++---- .../openstack-config_template.yml | 6 ++++ 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index 80fd88c..c2ef4e0 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -66,7 +66,7 @@ ratings_environment: [] # Example of the mappings and their fields can be found below, # however for more information please refer to the README.md file. # -#ratings_hashmap_field_mappings: +ratings_hashmap_field_mappings: [] # - service: SERVICE_NAME # name: FIELD_NAME # mappings: @@ -78,7 +78,7 @@ ratings_environment: [] # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. # -#ratings_hashmap_service_mappings: +ratings_hashmap_service_mappings: [] # - service: SERVICE_NAME # cost: MAPPING_COST # group: MAPPING_GROUP diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index 71015d0..4690ee1 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -99,6 +99,10 @@ ############################################################################### # Configuration variables for a Cloudkitty ratings service deployment. +# +# +# + # File path or URL containing Python upper constraints. # # ratings_upper_constraints_file: /path/to/upper_constraints_file @@ -118,11 +122,27 @@ ratings_hashmap_field_mappings: - service: instance name: flavor_id mappings: - - value: small + - value: '1' #tiny cost: 1.0 group: instance_uptime_flavor_id type: flat - - value: large + - value: '2' #small + cost: 2.0 + group: instance_uptime_flavor_id + type: flat + - value: '3' #medium + cost: 3.0 + group: instance_uptime_flavor_id + type: flat + - value: '4' #large + cost: 4.0 + group: instance_uptime_flavor_id + type: flat + - value: '5' #xlarge + cost: 5.0 + group: instance_uptime_flavor_id + type: flat + - value: '6' #tiny 2 cost: 2.0 group: instance_uptime_flavor_id type: flat @@ -131,11 +151,11 @@ ratings_hashmap_field_mappings: # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. # -ratings_hashmap_service_mappings: - - service: image.size - cost: 0.1 - group: volume_ceph - type: flat +# ratings_hashmap_service_mappings: +# - service: image.size +# cost: 0.1 +# group: image_size +# type: flat ############################################################################### # Dummy variable to allow Ansible to accept this file. diff --git a/etc/openstack-config/openstack-config_template.yml b/etc/openstack-config/openstack-config_template.yml index 4c0b087..b2b2e3c 100644 --- a/etc/openstack-config/openstack-config_template.yml +++ b/etc/openstack-config/openstack-config_template.yml @@ -99,6 +99,12 @@ ############################################################################### # Configuration variables for a Cloudkitty ratings service deployment. +# # ### ####### ##### IN ORDER TO SUCCESSFULLY DEPLOY CLOUDKITTY +# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE +# # # # # # ### PROVIDED ALONGSIDE THE FOLLOWING CONFIG. +# # # # # # # MORE INFO CAN BE FOUND IN THE README.md +# # ### # ##### 'stackhpc-kayobe-config' DOCS. + # File path or URL containing Python upper constraints. # #ratings_upper_constraints_file: /path/to/upper_constraints_file From 97f6f05751f680069658688e314fc05a30803a35 Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Wed, 10 Apr 2024 10:25:10 +0000 Subject: [PATCH 14/45] Updated and tidied config for Cloudkitty configuration role. --- etc/openstack-config/openstack-config.yml | 63 +++----- .../openstack-config_template.yml | 143 ------------------ examples/ratings.yml | 103 +++++++++---- 3 files changed, 97 insertions(+), 212 deletions(-) delete mode 100644 etc/openstack-config/openstack-config_template.yml diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index 4690ee1..cb5c950 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -99,17 +99,19 @@ ############################################################################### # Configuration variables for a Cloudkitty ratings service deployment. -# -# -# +# # ### ####### ##### IN ORDER TO SUCCESSFULLY DEPLOY CLOUDKITTY +# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE +# # # # # # ### PROVIDED ALONGSIDE THE FOLLOWING CONFIG. +# # # # # # # MORE INFO CAN BE FOUND IN THE README.md +# # ### # ##### 'stackhpc-kayobe-config' DOCS. # File path or URL containing Python upper constraints. -# -# ratings_upper_constraints_file: /path/to/upper_constraints_file +####### THIS IS NOT NECCESSARY TO CONFIGURE ########### +#ratings_upper_constraints_file: /path/to/upper_constraints_file # Environment variables for the OpenStack CLI. By default this is left empty. -# -# ratings_environment: +################### THIS IS NOT NECCESSARY TO CONFIGURE ##################### +#ratings_environment: # - name: ENV_VAR_NAME # value: ENV_VAR_VALUE @@ -118,44 +120,23 @@ # Example of the mappings and their fields can be found below, # however for more information please refer to the README.md file. # -ratings_hashmap_field_mappings: - - service: instance - name: flavor_id - mappings: - - value: '1' #tiny - cost: 1.0 - group: instance_uptime_flavor_id - type: flat - - value: '2' #small - cost: 2.0 - group: instance_uptime_flavor_id - type: flat - - value: '3' #medium - cost: 3.0 - group: instance_uptime_flavor_id - type: flat - - value: '4' #large - cost: 4.0 - group: instance_uptime_flavor_id - type: flat - - value: '5' #xlarge - cost: 5.0 - group: instance_uptime_flavor_id - type: flat - - value: '6' #tiny 2 - cost: 2.0 - group: instance_uptime_flavor_id - type: flat - +#ratings_hashmap_field_mappings: +# - service: SERVICE_NAME +# name: FIELD_NAME +# mappings: +# - value: MAPPING_VALUE +# cost: MAPPING_COST +# group: MAPPING_GROUP +# type: MAPPING_TYPE # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. # -# ratings_hashmap_service_mappings: -# - service: image.size -# cost: 0.1 -# group: image_size -# type: flat +#ratings_hashmap_service_mappings: +# - service: SERVICE_NAME +# cost: MAPPING_COST +# group: MAPPING_GROUP +# type: MAPPING_TYPE ############################################################################### # Dummy variable to allow Ansible to accept this file. diff --git a/etc/openstack-config/openstack-config_template.yml b/etc/openstack-config/openstack-config_template.yml deleted file mode 100644 index b2b2e3c..0000000 --- a/etc/openstack-config/openstack-config_template.yml +++ /dev/null @@ -1,143 +0,0 @@ ---- -############################################################################### -# Configuration of OpenStack projects and users user environment. - -# List of OpenStack domains. Format is as required by the stackhpc.os-projects -# role. -#openstack_domains: - -# List of OpenStack projects. Format is as required by the stackhpc.os-projects -# role. -#openstack_projects: - -############################################################################### -# Configuration of networks, subnets and routers. - -# List of networks in the openstack system. Format is as required by the -# stackhpc.os-networks role. -#openstack_networks: - -# List of routers in the openstack project. Format is as required by the -# stackhpc.os-networks role. -#openstack_routers: - -# List of security groups in the openstack project. -# Format is as required by the stackhpc.os-networks role. -#openstack_security_groups: - -# List of RBAC definitions in the openstack projct. Format is as required by the -# stackhpc.os-networks role. -#openstack_networks_rbac: - -############################################################################### -# Configuration of nova flavors. - -# List of nova flavors in the openstack project. Format is as required by the -# stackhpc.os-flavors role. -#openstack_flavors: - -############################################################################### -# Configuration of nova host aggregates. - -# List of nova host aggregates. Format is as required by the -# stackhpc.os_host_aggregates role. -#openstack_host_aggregates: - -############################################################################### -# Configuration of Glance software images. - -# List of Glance images. Format is as required by the stackhpc.os-images role. -#openstack_images: - -# List of Diskimage Builder (DIB) elements paths to include in image builds. -#openstack_image_elements: - -# List of Diskimage Builder (DIB) elements Git repositories to use in image -# builds. -#openstack_image_git_elements: - -############################################################################### -# Configuration of Magnum container clusters. - -# List of magnum cluster templates. Format is as required by the -# stackhpc.os-container-clusters role. -#openstack_container_clusters_templates: - -############################################################################### -# Configuration variables for generating new Magnum cluster template config. - -# These variables must be defined before using the generating new cluster -# templates - see repo README for more details. - -# Must have at least 2 CPUs, 4GB RAM and 20GB disk -# magnum_default_master_flavor_name: -# magnum_default_worker_flavor_name: - -# Network to create tenant cluster FIPs on -# magnum_external_net_name: - -# Provider for cluster loadbalancers (e.g. 'ovn') -# magnum_loadbalancer_provider: - -# Kubernetes CNI to use for cluster templates (defaults to 'calico') -# Must be one of the options supported by capi-helm-charts, see -# https://github.com/stackhpc/capi-helm-charts/tree/main/charts/cluster-addons#container-network-interface-cni-plugins -# magnum_default_network_driver: - -# Whether to create a master nodes loadbalancer for cluster templates (defaults to 'True') -# magnum_master_lb_enabled: - -# Whether to add a floating IP to the loadbalancer for cluster templates (defaults to 'True') -# magnum_cluster_floating_ip_enabled: - -# List of nameservers to use for cluster templates -# magnum_cluster_default_dns_nameservers: - -# Whether generated cluster templates should be public by default (defaults to 'True') -# magnum_cluster_templates_public: - -############################################################################### -# Configuration variables for a Cloudkitty ratings service deployment. - -# # ### ####### ##### IN ORDER TO SUCCESSFULLY DEPLOY CLOUDKITTY -# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE -# # # # # # ### PROVIDED ALONGSIDE THE FOLLOWING CONFIG. -# # # # # # # MORE INFO CAN BE FOUND IN THE README.md -# # ### # ##### 'stackhpc-kayobe-config' DOCS. - -# File path or URL containing Python upper constraints. -# -#ratings_upper_constraints_file: /path/to/upper_constraints_file - -# Environment variables for the OpenStack CLI. By default this is left empty. -# -#ratings_environment: -# - name: ENV_VAR_NAME -# value: ENV_VAR_VALUE - -# A list where each item is a dictionary mapping the associated fields, -# with the 'mappings' field also being a list of dictionaries. -# Example of the mappings and their fields can be found below, -# however for more information please refer to the README.md file. -# -#ratings_hashmap_field_mappings: -# - service: SERVICE_NAME -# name: FIELD_NAME -# mappings: -# - value: MAPPING_VALUE -# cost: MAPPING_COST -# group: MAPPING_GROUP -# type: MAPPING_TYPE - -# Much like the field mappings above, the service mappings are a list of -# dictionaries, however these are not associated with a field. -# -#ratings_hashmap_service_mappings: -# - service: SERVICE_NAME -# cost: MAPPING_COST -# group: MAPPING_GROUP -# type: MAPPING_TYPE - -############################################################################### -# Dummy variable to allow Ansible to accept this file. -workaround_ansible_issue_8743: yes diff --git a/examples/ratings.yml b/examples/ratings.yml index e39cc63..b6d85e7 100644 --- a/examples/ratings.yml +++ b/examples/ratings.yml @@ -2,34 +2,81 @@ ############################################################################### # Configuration of cloudkitty for openstack. -# Example playbook for configuring and registering Cloudkitty fields. -# Included is registration for two different Nova flavor mappings and +# Example configuration for registering Cloudkitty fields. +# Included is mapping for various different compute flavors & # a service mapping based on the stored image size in Glance. -- name: Ensure Cloudkitty ratings are registered - hosts: localhost - tasks: - - import_role: - name: stackhpc.openstack.os_ratings - vars: - os_ratings_venv: "{{ openstack_venv }}" - os_ratings_environment: - OS_AUTH_URL: "{{ lookup('env', 'OS_AUTH_URL') }}" - os_ratings_hashmap_field_mappings: - - service: instance - name: flavor_id - mappings: - - value: small - cost: 1.0 - group: instance_uptime_flavor_id - type: flat - - value: large - cost: 2.0 - group: instance_uptime_flavor_id - type: flat - os_ratings_hashmap_service_mappings: - - service: image.size - cost: 0.1 - group: volume_ceph - type: flat +ratings_hashmap_field_mappings: + - service: instance + name: flavor_id + mappings: + - value: '1' #tiny + cost: 1.0 + group: instance_uptime_flavor_id + type: flat + - value: '2' #small + cost: 2.0 + group: instance_uptime_flavor_id + type: flat + - value: '3' #medium + cost: 3.0 + group: instance_uptime_flavor_id + type: flat + - value: '4' #large + cost: 4.0 + group: instance_uptime_flavor_id + type: flat + - value: '5' #xlarge + cost: 5.0 + group: instance_uptime_flavor_id + type: flat + - value: '6' #tiny 2 + cost: 2.0 + group: instance_uptime_flavor_id + type: flat +ratings_hashmap_service_mappings: + - service: image.size + cost: 0.1 + group: image_size + type: flat + +# # ### ####### ##### THIS CONFIGURATION FILE ONLY WORKS IF +# # # # # # # 'cloudkitty.conf' & 'metrics.yml' ARE +# # # # # # ### CONFIGURED AS SHOWN BELOW. MORE INFO CAN +# # # # # # # BE FOUND IN THE 'stackhpc-kayobe-config' +# # ### # ##### DOCS. + + +# CORRESPONDING cloudkitty.conf +# +# [collect] +# period = 120 +# scope_key = tenant_id + +# CORRESPONDING metrics.yml +# +# metrics: +# openstack_nova_server_status: +# alt_name: instance +# unit: instance +# mutate: MAP +# mutate_map: +# 0.0: 1.0 # ACTIVE +# 11.0: 1.0 # SHUTOFF +# 12.0: 1.0 # SUSPENDED +# 16.0: 1.0 # PAUSED +# groupby: +# - user_id +# - tenant_id +# - uuid +# metadata: +# - flavor_id +# - name +# openstack_glance_image_bytes: +# alt_name: image.size +# factor: 1/1073741824 # image.size measurements are in B +# unit: GiB +# groupby: +# - resource_id +# - project_id \ No newline at end of file From 5f39695fdda024171ec2671bdbee7be125f8ae97 Mon Sep 17 00:00:00 2001 From: Massimiliano Favaro-Bedford <78351765+MaxBed4d@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:43:34 +0100 Subject: [PATCH 15/45] Tidy up group_vars Tidy up. --- ansible/group_vars/all/openstack | 24 +++++------------------ ansible/openstack-ratings.yml | 8 ++++---- ansible/openstack.yml | 2 +- etc/openstack-config/openstack-config.yml | 10 +++++----- examples/ratings.yml | 22 ++++++++++----------- 5 files changed, 26 insertions(+), 40 deletions(-) diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index c2ef4e0..16a3b3f 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -49,41 +49,27 @@ openstack_image_elements: [] # List of diskimage-builder element git repos to pull openstack_image_git_elements: [] ############################################################################### -# Configuration variables for a Cloudkitty ratings service deployment. +# Configuration variables for a CloudKitty ratings service deployment. # File path or URL containing Python upper constraints. # -ratings_upper_constraints_file: [] +openstack_ratings_upper_constraints_file: [] # Environment variables for the OpenStack CLI. By default this is left empty. # -ratings_environment: [] -# - name: ENV_VAR_NAME -# value: ENV_VAR_VALUE +openstack_ratings_environment: [] # A list where each item is a dictionary mapping the associated fields, # with the 'mappings' field also being a list of dictionaries. # Example of the mappings and their fields can be found below, # however for more information please refer to the README.md file. # -ratings_hashmap_field_mappings: [] -# - service: SERVICE_NAME -# name: FIELD_NAME -# mappings: -# - value: MAPPING_VALUE -# cost: MAPPING_COST -# group: MAPPING_GROUP -# type: MAPPING_TYPE +openstack_ratings_hashmap_field_mappings: [] # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. # -ratings_hashmap_service_mappings: [] -# - service: SERVICE_NAME -# cost: MAPPING_COST -# group: MAPPING_GROUP -# type: MAPPING_TYPE - +openstack_ratings_hashmap_service_mappings: [] ############################################################################### # Configuration of nova host aggregates for OpenStack. diff --git a/ansible/openstack-ratings.yml b/ansible/openstack-ratings.yml index 2d02d2d..1960f44 100644 --- a/ansible/openstack-ratings.yml +++ b/ansible/openstack-ratings.yml @@ -5,8 +5,8 @@ - ratings roles: - role: stackhpc.openstack.os_ratings - os_ratings_hashmap_field_mappings: "{{ ratings_hashmap_field_mappings }}" - os_ratings_hashmap_service_mappings: "{{ ratings_hashmap_service_mappings }}" + os_ratings_hashmap_field_mappings: "{{ openstack_ratings_hashmap_field_mappings }}" + os_ratings_hashmap_service_mappings: "{{ openstack_ratings_hashmap_service_mappings }}" os_ratings_venv: "{{ openstack_venv }}" - os_ratings_upper_constraints_file: "{{ ratings_upper_constraints_file }}" - os_ratings_environment: "{{ ratings_environment }}" \ No newline at end of file + os_ratings_upper_constraints_file: "{{ openstack_ratings_upper_constraints_file }}" + os_ratings_environment: "{{ openstack_ratings_environment }}" diff --git a/ansible/openstack.yml b/ansible/openstack.yml index ab167a4..a937d8f 100644 --- a/ansible/openstack.yml +++ b/ansible/openstack.yml @@ -6,4 +6,4 @@ - import_playbook: openstack-images.yml - import_playbook: openstack-host-aggregates.yml - import_playbook: openstack-container-clusters.yml -- import_playbook: openstack-ratings.yml \ No newline at end of file +- import_playbook: openstack-ratings.yml diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index cb5c950..a798bb4 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -97,7 +97,7 @@ # magnum_cluster_templates_public: ############################################################################### -# Configuration variables for a Cloudkitty ratings service deployment. +# Configuration variables for a CloudKitty ratings service deployment. # # ### ####### ##### IN ORDER TO SUCCESSFULLY DEPLOY CLOUDKITTY # # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE @@ -107,11 +107,11 @@ # File path or URL containing Python upper constraints. ####### THIS IS NOT NECCESSARY TO CONFIGURE ########### -#ratings_upper_constraints_file: /path/to/upper_constraints_file +#openstack_ratings_upper_constraints_file: /path/to/upper_constraints_file # Environment variables for the OpenStack CLI. By default this is left empty. ################### THIS IS NOT NECCESSARY TO CONFIGURE ##################### -#ratings_environment: +#openstack_ratings_environment: # - name: ENV_VAR_NAME # value: ENV_VAR_VALUE @@ -120,7 +120,7 @@ # Example of the mappings and their fields can be found below, # however for more information please refer to the README.md file. # -#ratings_hashmap_field_mappings: +#openstack_ratings_hashmap_field_mappings: # - service: SERVICE_NAME # name: FIELD_NAME # mappings: @@ -132,7 +132,7 @@ # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. # -#ratings_hashmap_service_mappings: +#openstack_ratings_hashmap_service_mappings: # - service: SERVICE_NAME # cost: MAPPING_COST # group: MAPPING_GROUP diff --git a/examples/ratings.yml b/examples/ratings.yml index b6d85e7..6fdd697 100644 --- a/examples/ratings.yml +++ b/examples/ratings.yml @@ -1,41 +1,41 @@ --- ############################################################################### -# Configuration of cloudkitty for openstack. +# Configuration of CloudKitty for openstack. -# Example configuration for registering Cloudkitty fields. +# Example configuration for registering CloudKitty fields. # Included is mapping for various different compute flavors & # a service mapping based on the stored image size in Glance. -ratings_hashmap_field_mappings: +openstack_ratings_hashmap_field_mappings: - service: instance name: flavor_id mappings: - - value: '1' #tiny + - value: '1' #tiny compute flavour with an OpenStack flavor ID of 1 cost: 1.0 group: instance_uptime_flavor_id type: flat - - value: '2' #small + - value: '2' #small compute flavour with an OpenStack flavor ID of 2 cost: 2.0 group: instance_uptime_flavor_id type: flat - - value: '3' #medium + - value: '3' #medium compute flavour with an OpenStack flavor ID of 3 cost: 3.0 group: instance_uptime_flavor_id type: flat - - value: '4' #large + - value: '4' #large compute flavour with an OpenStack flavor ID of 4 cost: 4.0 group: instance_uptime_flavor_id type: flat - - value: '5' #xlarge + - value: '5' #xlarge compute flavour with an OpenStack flavor ID of 5 cost: 5.0 group: instance_uptime_flavor_id type: flat - - value: '6' #tiny 2 + - value: '6' #tiny 2 compute flavour with an OpenStack flavor ID of 6 cost: 2.0 group: instance_uptime_flavor_id type: flat -ratings_hashmap_service_mappings: +openstack_ratings_hashmap_service_mappings: - service: image.size cost: 0.1 group: image_size @@ -79,4 +79,4 @@ ratings_hashmap_service_mappings: # unit: GiB # groupby: # - resource_id -# - project_id \ No newline at end of file +# - project_id From 71c59136a9ccdd96ae1b05fde0459290b495ac9a Mon Sep 17 00:00:00 2001 From: MaxBed4d Date: Wed, 10 Apr 2024 13:03:34 +0000 Subject: [PATCH 16/45] Pointing to the now merged CloudKitty Ansible role. --- ansible/group_vars/all/openstack | 35 +++++++++-------------- ansible/openstack-ratings.yml | 2 -- etc/openstack-config/openstack-config.yml | 23 +++++---------- examples/ratings.yml | 35 +---------------------- requirements.yml | 7 ++--- 5 files changed, 24 insertions(+), 78 deletions(-) diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index 16a3b3f..267d22b 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -48,16 +48,23 @@ openstack_image_elements: [] # List of diskimage-builder element git repos to pull openstack_image_git_elements: [] + ############################################################################### -# Configuration variables for a CloudKitty ratings service deployment. +# Configuration of nova host aggregates for OpenStack. -# File path or URL containing Python upper constraints. -# -openstack_ratings_upper_constraints_file: [] +# List of host aggregates in the openstack project. +# Format is as required by the stackhpc.os_host_aggregates role. +openstack_host_aggregates: [] -# Environment variables for the OpenStack CLI. By default this is left empty. -# -openstack_ratings_environment: [] +############################################################################### +# Configuration of container clusters templates for OpenStack. + +# List of clusters templates in the openstack project. Format is as required by the +# stackhpc.os-container-clusters role. +openstack_container_clusters_templates: [] + +############################################################################### +# Configuration variables for a CloudKitty ratings service deployment. # A list where each item is a dictionary mapping the associated fields, # with the 'mappings' field also being a list of dictionaries. @@ -70,17 +77,3 @@ openstack_ratings_hashmap_field_mappings: [] # dictionaries, however these are not associated with a field. # openstack_ratings_hashmap_service_mappings: [] - -############################################################################### -# Configuration of nova host aggregates for OpenStack. - -# List of host aggregates in the openstack project. -# Format is as required by the stackhpc.os_host_aggregates role. -openstack_host_aggregates: [] - -############################################################################### -# Configuration of container clusters templates for OpenStack. - -# List of clusters templates in the openstack project. Format is as required by the -# stackhpc.os-container-clusters role. -openstack_container_clusters_templates: [] diff --git a/ansible/openstack-ratings.yml b/ansible/openstack-ratings.yml index 1960f44..bef3713 100644 --- a/ansible/openstack-ratings.yml +++ b/ansible/openstack-ratings.yml @@ -8,5 +8,3 @@ os_ratings_hashmap_field_mappings: "{{ openstack_ratings_hashmap_field_mappings }}" os_ratings_hashmap_service_mappings: "{{ openstack_ratings_hashmap_service_mappings }}" os_ratings_venv: "{{ openstack_venv }}" - os_ratings_upper_constraints_file: "{{ openstack_ratings_upper_constraints_file }}" - os_ratings_environment: "{{ openstack_ratings_environment }}" diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index a798bb4..9a2d951 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -105,29 +105,20 @@ # # # # # # # MORE INFO CAN BE FOUND IN THE README.md # # ### # ##### 'stackhpc-kayobe-config' DOCS. -# File path or URL containing Python upper constraints. -####### THIS IS NOT NECCESSARY TO CONFIGURE ########### -#openstack_ratings_upper_constraints_file: /path/to/upper_constraints_file - -# Environment variables for the OpenStack CLI. By default this is left empty. -################### THIS IS NOT NECCESSARY TO CONFIGURE ##################### -#openstack_ratings_environment: -# - name: ENV_VAR_NAME -# value: ENV_VAR_VALUE # A list where each item is a dictionary mapping the associated fields, -# with the 'mappings' field also being a list of dictionaries. -# Example of the mappings and their fields can be found below, -# however for more information please refer to the README.md file. +# with the 'mappings' field also being a list of dictionaries. Example +# of the mappings and their fields can be found below, however for more +# information please refer to the stackhpc.openstack.os_ratings role docs. # #openstack_ratings_hashmap_field_mappings: # - service: SERVICE_NAME -# name: FIELD_NAME -# mappings: +# name: FIELD_NAME +# mappings: # - value: MAPPING_VALUE # cost: MAPPING_COST -# group: MAPPING_GROUP # type: MAPPING_TYPE +# group: MAPPING_GROUP <---THIS IS OPTIONAL--- # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. @@ -135,8 +126,8 @@ #openstack_ratings_hashmap_service_mappings: # - service: SERVICE_NAME # cost: MAPPING_COST -# group: MAPPING_GROUP # type: MAPPING_TYPE +# group: MAPPING_GROUP <---THIS IS OPTIONAL--- ############################################################################### # Dummy variable to allow Ansible to accept this file. diff --git a/examples/ratings.yml b/examples/ratings.yml index 6fdd697..19d7e3c 100644 --- a/examples/ratings.yml +++ b/examples/ratings.yml @@ -43,40 +43,7 @@ openstack_ratings_hashmap_service_mappings: # # ### ####### ##### THIS CONFIGURATION FILE ONLY WORKS IF # # # # # # # 'cloudkitty.conf' & 'metrics.yml' ARE -# # # # # # ### CONFIGURED AS SHOWN BELOW. MORE INFO CAN +# # # # # # ### CONFIGURED CORRECTLY. MORE INFO CAN # # # # # # # BE FOUND IN THE 'stackhpc-kayobe-config' # # ### # ##### DOCS. - -# CORRESPONDING cloudkitty.conf -# -# [collect] -# period = 120 -# scope_key = tenant_id - -# CORRESPONDING metrics.yml -# -# metrics: -# openstack_nova_server_status: -# alt_name: instance -# unit: instance -# mutate: MAP -# mutate_map: -# 0.0: 1.0 # ACTIVE -# 11.0: 1.0 # SHUTOFF -# 12.0: 1.0 # SUSPENDED -# 16.0: 1.0 # PAUSED -# groupby: -# - user_id -# - tenant_id -# - uuid -# metadata: -# - flavor_id -# - name -# openstack_glance_image_bytes: -# alt_name: image.size -# factor: 1/1073741824 # image.size measurements are in B -# unit: GiB -# groupby: -# - resource_id -# - project_id diff --git a/requirements.yml b/requirements.yml index b509ca4..8a2a754 100644 --- a/requirements.yml +++ b/requirements.yml @@ -2,8 +2,5 @@ collections: - name: openstack.cloud version: 2.1.0 - - name: https://github.com/stackhpc/ansible-collection-openstack.git - type: git - version: cloudkitty - # - name: stackhpc.openstack - # version: 0.1.1 + - name: stackhpc.openstack + version: 0.2.0 From cea418ab68a7cec4bf432f72600b172931cf41e2 Mon Sep 17 00:00:00 2001 From: sd109 Date: Fri, 12 Apr 2024 15:27:40 +0100 Subject: [PATCH 17/45] Allow extra labels in generated cluster templates --- README.rst | 14 ++++++++++---- ansible/templates/magnum-capi-templates.j2 | 3 +++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index f1f7b5d..d115514 100644 --- a/README.rst +++ b/README.rst @@ -88,10 +88,16 @@ variables in `etc/openstack-config.yml` .. code-block:: yaml - magnum_default_master_flavor_name: # Chosen flavor on target cloud - magnum_default_worker_flavor_name: # Chosen flavor on target cloud - magnum_external_net_name: # External network - magnum_loadbalancer_provider: # Octavia provider (e.g. 'ovn') + # Chosen flavor on target cloud + magnum_default_master_flavor_name: + # Chosen flavor on target cloud + magnum_default_worker_flavor_name: + # External network to use for load balancers etc. + magnum_external_net_name: + # Octavia provider (e.g. 'ovn') + magnum_loadbalancer_provider: + # Optional list of extra labels to add to all generated cluster templates + magnum_template_extra_labels: then run the provided playbook with diff --git a/ansible/templates/magnum-capi-templates.j2 b/ansible/templates/magnum-capi-templates.j2 index 65c5c7a..31f4130 100644 --- a/ansible/templates/magnum-capi-templates.j2 +++ b/ansible/templates/magnum-capi-templates.j2 @@ -16,6 +16,9 @@ keystone_auth_enabled: "false" capi_helm_chart_version: "{{ capi_helm_chart_release_data.json.tag_name }}" octavia_provider: {{ magnum_loadbalancer_provider }} +{% if magnum_template_extra_labels is defined %} + {{ magnum_template_extra_labels | to_nice_yaml | indent(4) -}} +{% endif %} external_network_id: {{ magnum_external_net_name }} master_flavor: {{ magnum_default_master_flavor_name }} flavor: {{ magnum_default_worker_flavor_name }} From 7ab4335756fa9bd86acb66b8564073c8fc118deb Mon Sep 17 00:00:00 2001 From: sd109 Date: Tue, 16 Apr 2024 14:30:22 +0100 Subject: [PATCH 18/45] Improve handling of empty extra labels variable --- ansible/templates/magnum-capi-templates.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/templates/magnum-capi-templates.j2 b/ansible/templates/magnum-capi-templates.j2 index 31f4130..a555b1d 100644 --- a/ansible/templates/magnum-capi-templates.j2 +++ b/ansible/templates/magnum-capi-templates.j2 @@ -16,7 +16,7 @@ keystone_auth_enabled: "false" capi_helm_chart_version: "{{ capi_helm_chart_release_data.json.tag_name }}" octavia_provider: {{ magnum_loadbalancer_provider }} -{% if magnum_template_extra_labels is defined %} +{% if magnum_template_extra_labels is defined and magnum_template_extra_labels is not none %} {{ magnum_template_extra_labels | to_nice_yaml | indent(4) -}} {% endif %} external_network_id: {{ magnum_external_net_name }} @@ -31,4 +31,4 @@ dns_nameserver: "{{ (magnum_cluster_default_dns_nameservers | default(['1.1.1.1', '8.8.8.8', '8.8.4.4'])) | join(',') }}" public: "{{ magnum_cluster_templates_public | default('True') }}" -{% endfor %} \ No newline at end of file +{% endfor %} From a545002b46fbb078611043f298732077808678a6 Mon Sep 17 00:00:00 2001 From: sd109 Date: Tue, 16 Apr 2024 14:35:39 +0100 Subject: [PATCH 19/45] Ensure required Magnum images are public --- ansible/templates/magnum-capi-images.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/templates/magnum-capi-images.j2 b/ansible/templates/magnum-capi-images.j2 index 2e5e7e2..adfb2ad 100644 --- a/ansible/templates/magnum-capi-images.j2 +++ b/ansible/templates/magnum-capi-images.j2 @@ -15,7 +15,7 @@ name: "{{ item.value.name }}" type: qcow2 image_url: "{{ item.value.url }}" - visibility: "community" + visibility: "public" properties: os_distro: "ubuntu" os_version: "20.04" From 7801226e11eea23852b212b35b3e0dd22d79b120 Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Mon, 22 Apr 2024 10:13:14 +0100 Subject: [PATCH 20/45] Update readme python venv instructions --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index d115514..9398569 100644 --- a/README.rst +++ b/README.rst @@ -10,13 +10,13 @@ Preparation =========== Ensure that Ansible is installed, either via the system package manager or pip. -If required, use a virtualenv to avoid interference with the system python -packages. For example: +It is recommended that you use a python virtual environment to avoid +interference with the system python packages. For example: .. code-block:: - $ virtualenv venv - $ source venv/bin/activate + $ python3 -m venv openstack-venv + $ source openstack-venv/bin/activate $ python -m pip install --upgrade pip $ pip install -r requirements.txt From 3d085a4272bbe012e6119dd03092b2e92da1600e Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Tue, 7 May 2024 21:45:18 +0200 Subject: [PATCH 21/45] Allow unlimited server groups for Octavia This is necessary to avoid reaching quota limits when Octavia is configured with enable_anti_affinity=True. --- examples/projects-octavia.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/projects-octavia.yml b/examples/projects-octavia.yml index f116b18..af40422 100644 --- a/examples/projects-octavia.yml +++ b/examples/projects-octavia.yml @@ -27,3 +27,4 @@ openstack_octavia_unlimited_quotas: ram: -1 security_group: -1 security_group_rule: -1 + server-groups: -1 From 7f0e0701a2333ba56b71c0b0fe3f846af2be7cda Mon Sep 17 00:00:00 2001 From: Rafal Lewandowski Date: Mon, 3 Jun 2024 15:10:34 +0200 Subject: [PATCH 22/45] removed mention of Yoga --- README.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 9398569..a520786 100644 --- a/README.rst +++ b/README.rst @@ -3,8 +3,7 @@ OpenStack Configuration ============================================= This project contains Ansible playbooks and configuration of infrastructure on -an existing OpenStack cloud for the OpenStack system. (Supported up to Yoga -release.) +an existing OpenStack cloud for the OpenStack system. Preparation =========== From 1fd68c8d8c7b190a4d9d8313d5f341c81d656797 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 8 Jul 2024 10:17:02 +0100 Subject: [PATCH 23/45] Rework example security group to avoid SSH and ICMP in default secgroup The recent RegreSSHion CVE highlighted the need to opt into opening SSH. --- examples/networks.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/networks.yml b/examples/networks.yml index f6e6c12..38e769c 100644 --- a/examples/networks.yml +++ b/examples/networks.yml @@ -125,12 +125,16 @@ openstack_router_demo: # List of security groups in the openstack demo project. # Format is as required by the stackhpc.os-networks role. openstack_security_groups: - # Default security group for the openstack demo project. - - name: default + # ICMP security group for the openstack demo project. + - name: ICMP project: demo rules: # Allow ICMP (for ping, etc.). - protocol: icmp + # SSH security group for the openstack demo project. + - name: SSH + project: demo + rules: # Allow SSH. - protocol: tcp port_range_min: 22 From 54668be7702c8a5c9bbbeaa0c94820305dfc255f Mon Sep 17 00:00:00 2001 From: Piotr Parczewski Date: Wed, 14 Aug 2024 12:08:43 +0200 Subject: [PATCH 24/45] Add ansible.cfg --- ansible.cfg | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ansible.cfg diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..09460fd --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,4 @@ +[defaults] +bin_ansible_callbacks = True +callbacks_enabled = ansible.posix.profile_tasks +stdout_callback = yaml From 2b631710236063062216dc4c7e6eb6ab5cbe7b0b Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 14 Aug 2024 16:20:13 +0100 Subject: [PATCH 25/45] Bump stackhpc.openstack collection to 0.2.2 --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 8a2a754..adbc938 100644 --- a/requirements.yml +++ b/requirements.yml @@ -3,4 +3,4 @@ collections: - name: openstack.cloud version: 2.1.0 - name: stackhpc.openstack - version: 0.2.0 + version: 0.2.2 From 602136da8c0c33de58ea97ed687e8a33931611a1 Mon Sep 17 00:00:00 2001 From: Piotr Parczewski Date: Thu, 26 Sep 2024 12:27:31 +0200 Subject: [PATCH 26/45] Fix Azimuth artefact URLs --- ansible/generate-magnum-capi-templates.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/generate-magnum-capi-templates.yml b/ansible/generate-magnum-capi-templates.yml index ccbb574..0aa0016 100644 --- a/ansible/generate-magnum-capi-templates.yml +++ b/ansible/generate-magnum-capi-templates.yml @@ -15,12 +15,12 @@ - name: Fetch capi-helm-charts release information ansible.builtin.uri: - url: https://api.github.com/repos/stackhpc/capi-helm-charts/releases/latest + url: https://api.github.com/repos/azimuth-cloud/capi-helm-charts/releases/latest register: capi_helm_chart_release_data - name: Fetch dependencies.json for capi-helm-charts release ansible.builtin.uri: - url: https://raw.githubusercontent.com/stackhpc/capi-helm-charts/{{ capi_helm_chart_release_data.json.tag_name }}/dependencies.json + url: https://raw.githubusercontent.com/azimuth-cloud/capi-helm-charts/{{ capi_helm_chart_release_data.json.tag_name }}/dependencies.json register: dependencies_response - name: Ensure wget packages is installed @@ -31,10 +31,10 @@ - name: Fetch manifest.json for capi-helm-charts images # ansible.builtin.uri: - # url: https://raw.githubusercontent.com/stackhpc/azimuth-images/{{ dependencies_response.json['azimuth-images'] }}/manifest.json + # url: https://raw.githubusercontent.com/azimuth-cloud/azimuth-images/{{ dependencies_response.json['azimuth-images'] }}/manifest.json # Above URL returns 404 even though similar URL for capi-helm-charts repo works fine # Not sure why but fall back to wget + JSON parsing for now. - shell: "wget -O - https://github.com/stackhpc/azimuth-images/releases/download/{{ dependencies_response.json['azimuth-images'] }}/manifest.json" + shell: "wget -O - https://github.com/azimuth-cloud/azimuth-images/releases/download/{{ dependencies_response.json['azimuth-images'] }}/manifest.json" register: manifest_response changed_when: false From 6a15739aa28ab214dc88ac1e2a8341837a43ed63 Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Mon, 14 Oct 2024 15:13:37 +0100 Subject: [PATCH 27/45] Use 22.04 in magnum-capi-images.j2 --- ansible/templates/magnum-capi-images.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/templates/magnum-capi-images.j2 b/ansible/templates/magnum-capi-images.j2 index adfb2ad..366b299 100644 --- a/ansible/templates/magnum-capi-images.j2 +++ b/ansible/templates/magnum-capi-images.j2 @@ -18,7 +18,7 @@ visibility: "public" properties: os_distro: "ubuntu" - os_version: "20.04" + os_version: "22.04" kube_version: "{{ item.value.kubernetes_version }}" {% endfor %} From 6e1884818351266cc1bda37ad2a4b7e7f6da6fde Mon Sep 17 00:00:00 2001 From: Piotr Parczewski Date: Wed, 6 Nov 2024 11:40:20 +0100 Subject: [PATCH 28/45] Use the latest collection --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index adbc938..eea2802 100644 --- a/requirements.yml +++ b/requirements.yml @@ -3,4 +3,4 @@ collections: - name: openstack.cloud version: 2.1.0 - name: stackhpc.openstack - version: 0.2.2 + version: 0.2.4 From 07e05c1a7a5839df54f7440d9d45e8aad0f66969 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Tue, 10 Dec 2024 14:06:25 +0100 Subject: [PATCH 29/45] Support configuring Cinder volume types This includes an example to configure volume types for a Ceph cluster with multiple storage classes, assuming the Cinder backends are called `replicated-hdd` and `replicated-ssd`. --- ansible/openstack-volume-types.yml | 12 ++++++++++++ ansible/openstack.yml | 1 + examples/volume-types.yml | 21 +++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 ansible/openstack-volume-types.yml create mode 100644 examples/volume-types.yml diff --git a/ansible/openstack-volume-types.yml b/ansible/openstack-volume-types.yml new file mode 100644 index 0000000..be1248a --- /dev/null +++ b/ansible/openstack-volume-types.yml @@ -0,0 +1,12 @@ +--- +- name: Ensure OpenStack volume types exist + hosts: localhost + tags: + - volume-types + roles: + - role: stackhpc.openstack.os_volumes + os_volumes_venv: "{{ openstack_venv }}" + os_volumes_auth_type: "{{ openstack_auth_type }}" + os_volumes_auth: "{{ openstack_auth }}" + os_volumes_cacert: "{{ openstack_cacert }}" + os_volumes_types: "{{ openstack_volumes_types }}" diff --git a/ansible/openstack.yml b/ansible/openstack.yml index a937d8f..2438f9d 100644 --- a/ansible/openstack.yml +++ b/ansible/openstack.yml @@ -5,5 +5,6 @@ - import_playbook: openstack-flavors.yml - import_playbook: openstack-images.yml - import_playbook: openstack-host-aggregates.yml +- import_playbook: openstack-volume-types.yml - import_playbook: openstack-container-clusters.yml - import_playbook: openstack-ratings.yml diff --git a/examples/volume-types.yml b/examples/volume-types.yml new file mode 100644 index 0000000..704e7ae --- /dev/null +++ b/examples/volume-types.yml @@ -0,0 +1,21 @@ +--- +############################################################################### +# Configuration of volume types for openstack. + +# List of volume types. Format is as required by the stackhpc.os-volumes role. +openstack_volumes_types: + - "{{ openstack_volume_type_ceph_hdd }}" + - "{{ openstack_volume_type_ceph_ssd }}" + +# Volume types +openstack_volume_type_ceph_hdd: + name: "ceph-hdd" + description: "Ceph HDD pool" + extra_specs: + volume_backend_name: "replicated-hdd" + +openstack_volume_type_ceph_ssd: + name: "ceph-ssd" + description: "Ceph SSD pool" + extra_specs: + volume_backend_name: "replicated-ssd" From 2251c3ca16968424b7771ce3843c9a58843fbadb Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Tue, 10 Dec 2024 14:09:38 +0100 Subject: [PATCH 30/45] Remove duplicate OpenStack word --- ansible/openstack-flavors.yml | 2 +- ansible/openstack-host-aggregates.yml | 2 +- ansible/openstack-networks.yml | 2 +- ansible/openstack-project.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/openstack-flavors.yml b/ansible/openstack-flavors.yml index 69b94f2..622ae71 100644 --- a/ansible/openstack-flavors.yml +++ b/ansible/openstack-flavors.yml @@ -1,5 +1,5 @@ --- -- name: Ensure OpenStack OpenStack nova flavors exist +- name: Ensure OpenStack nova flavors exist hosts: localhost tags: - flavors diff --git a/ansible/openstack-host-aggregates.yml b/ansible/openstack-host-aggregates.yml index f37449e..6762edd 100644 --- a/ansible/openstack-host-aggregates.yml +++ b/ansible/openstack-host-aggregates.yml @@ -1,5 +1,5 @@ --- -- name: Ensure OpenStack OpenStack nova host aggregates exist +- name: Ensure OpenStack nova host aggregates exist hosts: localhost tags: - host_aggregates diff --git a/ansible/openstack-networks.yml b/ansible/openstack-networks.yml index 5f175d0..8fae258 100644 --- a/ansible/openstack-networks.yml +++ b/ansible/openstack-networks.yml @@ -1,5 +1,5 @@ --- -- name: Ensure OpenStack OpenStack networks exist +- name: Ensure OpenStack networks exist hosts: localhost tags: - networks diff --git a/ansible/openstack-project.yml b/ansible/openstack-project.yml index 2de1fb9..454e69c 100644 --- a/ansible/openstack-project.yml +++ b/ansible/openstack-project.yml @@ -1,5 +1,5 @@ --- -- name: Ensure OpenStack OpenStack projects exist +- name: Ensure OpenStack projects exist hosts: localhost tags: - project From 2074767a11a86ec7a760cf8e8ff1a413f8d5f5d9 Mon Sep 17 00:00:00 2001 From: Grzegorz Bialas Date: Wed, 22 Jan 2025 14:11:54 +0100 Subject: [PATCH 31/45] bump openstack.cloud version --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index eea2802..c58c0ae 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,6 +1,6 @@ --- collections: - name: openstack.cloud - version: 2.1.0 + version: 2.4.1 - name: stackhpc.openstack version: 0.2.4 From 0a3a55863fa1eec4178802e50884134f0379b3c9 Mon Sep 17 00:00:00 2001 From: Rafal Lewandowski Date: Wed, 29 Jan 2025 13:08:36 +0100 Subject: [PATCH 32/45] add default var definition for openstack_volumes_types --- ansible/group_vars/all/openstack | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index 267d22b..c749f3c 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -66,9 +66,9 @@ openstack_container_clusters_templates: [] ############################################################################### # Configuration variables for a CloudKitty ratings service deployment. -# A list where each item is a dictionary mapping the associated fields, -# with the 'mappings' field also being a list of dictionaries. -# Example of the mappings and their fields can be found below, +# A list where each item is a dictionary mapping the associated fields, +# with the 'mappings' field also being a list of dictionaries. +# Example of the mappings and their fields can be found below, # however for more information please refer to the README.md file. # openstack_ratings_hashmap_field_mappings: [] @@ -77,3 +77,7 @@ openstack_ratings_hashmap_field_mappings: [] # dictionaries, however these are not associated with a field. # openstack_ratings_hashmap_service_mappings: [] + +############################################################################### +# Configuration of volumes for OpenStack. +openstack_volumes_types: [] From 85765538a8eea00e35e025cd74ffe585b0cec74c Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Wed, 29 Jan 2025 13:18:12 +0100 Subject: [PATCH 33/45] CI: Add ansible-lint --- .github/workflows/pull-request.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..89f3b24 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,33 @@ +--- +name: Pull request +'on': + pull_request: +jobs: + lint: + runs-on: ubuntu-22.04 + permissions: {} + strategy: + fail-fast: false + matrix: + include: + # NOTE(upgrade): Keep these in sync with Kayobe's supported Ansible and Python versions (see release notes). + - ansible: "2.16" + python: "3.12" + name: Ansible ${{ matrix.ansible }} lint with Python ${{ matrix.python }} + steps: + - name: GitHub Checkout ๐Ÿ›Ž + uses: actions/checkout@v4 + + - name: Setup Python ${{ matrix.python-version }} ๐Ÿ + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies ๐Ÿ“ฆ + run: | + python -m pip install --upgrade pip + pip install ansible-core==${{ matrix.ansible }}.* ansible-lint + + - name: Linting code ๐Ÿงช + run: | + ansible-lint -v --force-color From abe8e80be0ad930ad2f486fe1d12dec96b212c2b Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Wed, 29 Jan 2025 13:49:52 +0100 Subject: [PATCH 34/45] Fix all ansible-lint issues --- .github/workflows/pull-request.yml | 2 +- ansible/generate-magnum-capi-templates.yml | 102 +++++++++++---------- ansible/openstack.yml | 17 ++-- etc/openstack-config/openstack-config.yml | 58 ++++++------ examples/container-clusters.yml | 2 +- examples/images.yml | 8 +- examples/ratings.yml | 21 ++--- 7 files changed, 105 insertions(+), 105 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 89f3b24..1cf307a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,6 +1,6 @@ --- name: Pull request -'on': +"on": pull_request: jobs: lint: diff --git a/ansible/generate-magnum-capi-templates.yml b/ansible/generate-magnum-capi-templates.yml index 0aa0016..45deec7 100644 --- a/ansible/generate-magnum-capi-templates.yml +++ b/ansible/generate-magnum-capi-templates.yml @@ -4,57 +4,59 @@ vars: root_dir: ../ tasks: - - - name: Check that required variables are defined - assert: - that: - - magnum_default_master_flavor_name is defined - - magnum_default_worker_flavor_name is defined - - magnum_external_net_name is defined - - magnum_loadbalancer_provider is defined - - - name: Fetch capi-helm-charts release information - ansible.builtin.uri: - url: https://api.github.com/repos/azimuth-cloud/capi-helm-charts/releases/latest - register: capi_helm_chart_release_data - - - name: Fetch dependencies.json for capi-helm-charts release - ansible.builtin.uri: - url: https://raw.githubusercontent.com/azimuth-cloud/capi-helm-charts/{{ capi_helm_chart_release_data.json.tag_name }}/dependencies.json - register: dependencies_response - - - name: Ensure wget packages is installed - become: true - package: - name: wget - state: present - - - name: Fetch manifest.json for capi-helm-charts images + - name: Check that required variables are defined + ansible.builtin.assert: + that: + - magnum_default_master_flavor_name is defined + - magnum_default_worker_flavor_name is defined + - magnum_external_net_name is defined + - magnum_loadbalancer_provider is defined + + - name: Fetch capi-helm-charts release information + ansible.builtin.uri: + url: https://api.github.com/repos/azimuth-cloud/capi-helm-charts/releases/latest + register: capi_helm_chart_release_data + + - name: Fetch dependencies.json for capi-helm-charts release + ansible.builtin.uri: + url: https://raw.githubusercontent.com/azimuth-cloud/capi-helm-charts/{{ capi_helm_chart_release_data.json.tag_name }}/dependencies.json + register: dependencies_response + + - name: Ensure wget packages is installed + become: true + ansible.builtin.package: + name: wget + state: present + + - name: Fetch manifest.json for capi-helm-charts images # noqa command-instead-of-module # ansible.builtin.uri: # url: https://raw.githubusercontent.com/azimuth-cloud/azimuth-images/{{ dependencies_response.json['azimuth-images'] }}/manifest.json # Above URL returns 404 even though similar URL for capi-helm-charts repo works fine # Not sure why but fall back to wget + JSON parsing for now. - shell: "wget -O - https://github.com/azimuth-cloud/azimuth-images/releases/download/{{ dependencies_response.json['azimuth-images'] }}/manifest.json" - register: manifest_response - changed_when: false - - - name: Parse JSON response - set_fact: - new_template_data: "{{ manifest_response.stdout | from_json | dict2items | selectattr('key', 'match', 'kubernetes*') | list }}" - - - name: Ensure output dir exists - ansible.builtin.file: - path: "{{ [root_dir, 'generated-magnum-snippets', now(utc=true,fmt='%Y-%m-%d-T%H-%M-%S')] | path_join }}" - state: directory - mode: '0755' - register: output_dir - - - name: Write new image config to file - template: - src: "magnum-capi-images.j2" - dest: "{{ output_dir.path }}/images.yml" - - - name: Write new cluster template config to file - template: - src: "magnum-capi-templates.j2" - dest: "{{ output_dir.path }}/templates.yml" + ansible.builtin.command: >- + wget -O - https://github.com/azimuth-cloud/azimuth-images/releases/download/{{ dependencies_response.json['azimuth-images'] }}/manifest.json + register: manifest_response + changed_when: false + + - name: Parse JSON response + ansible.builtin.set_fact: + new_template_data: "{{ manifest_response.stdout | from_json | dict2items | selectattr('key', 'match', 'kubernetes*') | list }}" + + - name: Ensure output dir exists + ansible.builtin.file: + path: "{{ [root_dir, 'generated-magnum-snippets', now(utc=true, fmt='%Y-%m-%d-T%H-%M-%S')] | path_join }}" + state: directory + mode: "0755" + register: output_dir + + - name: Write new image config to file + ansible.builtin.template: + src: "magnum-capi-images.j2" + dest: "{{ output_dir.path }}/images.yml" + mode: "0644" + + - name: Write new cluster template config to file + ansible.builtin.template: + src: "magnum-capi-templates.j2" + dest: "{{ output_dir.path }}/templates.yml" + mode: "0644" diff --git a/ansible/openstack.yml b/ansible/openstack.yml index 2438f9d..e07e441 100644 --- a/ansible/openstack.yml +++ b/ansible/openstack.yml @@ -1,10 +1,11 @@ --- # Top level playbook that includes all others. -- import_playbook: openstack-project.yml -- import_playbook: openstack-networks.yml -- import_playbook: openstack-flavors.yml -- import_playbook: openstack-images.yml -- import_playbook: openstack-host-aggregates.yml -- import_playbook: openstack-volume-types.yml -- import_playbook: openstack-container-clusters.yml -- import_playbook: openstack-ratings.yml + +- import_playbook: openstack-project.yml # noqa name[play] +- import_playbook: openstack-networks.yml # noqa name[play] +- import_playbook: openstack-flavors.yml # noqa name[play] +- import_playbook: openstack-images.yml # noqa name[play] +- import_playbook: openstack-host-aggregates.yml # noqa name[play] +- import_playbook: openstack-volume-types.yml # noqa name[play] +- import_playbook: openstack-container-clusters.yml # noqa name[play] +- import_playbook: openstack-ratings.yml # noqa name[play] diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index 9a2d951..83d2cf2 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -4,64 +4,64 @@ # List of OpenStack domains. Format is as required by the stackhpc.os-projects # role. -#openstack_domains: +# openstack_domains: # List of OpenStack projects. Format is as required by the stackhpc.os-projects # role. -#openstack_projects: +# openstack_projects: ############################################################################### # Configuration of networks, subnets and routers. # List of networks in the openstack system. Format is as required by the # stackhpc.os-networks role. -#openstack_networks: +# openstack_networks: # List of routers in the openstack project. Format is as required by the # stackhpc.os-networks role. -#openstack_routers: +# openstack_routers: # List of security groups in the openstack project. # Format is as required by the stackhpc.os-networks role. -#openstack_security_groups: +# openstack_security_groups: # List of RBAC definitions in the openstack projct. Format is as required by the # stackhpc.os-networks role. -#openstack_networks_rbac: +# openstack_networks_rbac: ############################################################################### # Configuration of nova flavors. # List of nova flavors in the openstack project. Format is as required by the # stackhpc.os-flavors role. -#openstack_flavors: +# openstack_flavors: ############################################################################### # Configuration of nova host aggregates. # List of nova host aggregates. Format is as required by the # stackhpc.os_host_aggregates role. -#openstack_host_aggregates: +# openstack_host_aggregates: ############################################################################### # Configuration of Glance software images. # List of Glance images. Format is as required by the stackhpc.os-images role. -#openstack_images: +# openstack_images: # List of Diskimage Builder (DIB) elements paths to include in image builds. -#openstack_image_elements: +# openstack_image_elements: # List of Diskimage Builder (DIB) elements Git repositories to use in image # builds. -#openstack_image_git_elements: +# openstack_image_git_elements: ############################################################################### # Configuration of Magnum container clusters. # List of magnum cluster templates. Format is as required by the # stackhpc.os-container-clusters role. -#openstack_container_clusters_templates: +# openstack_container_clusters_templates: ############################################################################### # Configuration variables for generating new Magnum cluster template config. @@ -100,35 +100,33 @@ # Configuration variables for a CloudKitty ratings service deployment. # # ### ####### ##### IN ORDER TO SUCCESSFULLY DEPLOY CLOUDKITTY -# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE +# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE # # # # # # ### PROVIDED ALONGSIDE THE FOLLOWING CONFIG. # # # # # # # MORE INFO CAN BE FOUND IN THE README.md # # ### # ##### 'stackhpc-kayobe-config' DOCS. - - -# A list where each item is a dictionary mapping the associated fields, +# A list where each item is a dictionary mapping the associated fields, # with the 'mappings' field also being a list of dictionaries. Example # of the mappings and their fields can be found below, however for more # information please refer to the stackhpc.openstack.os_ratings role docs. # -#openstack_ratings_hashmap_field_mappings: -# - service: SERVICE_NAME -# name: FIELD_NAME -# mappings: -# - value: MAPPING_VALUE -# cost: MAPPING_COST -# type: MAPPING_TYPE -# group: MAPPING_GROUP <---THIS IS OPTIONAL--- +# openstack_ratings_hashmap_field_mappings: +# - service: SERVICE_NAME +# name: FIELD_NAME +# mappings: +# - value: MAPPING_VALUE +# cost: MAPPING_COST +# type: MAPPING_TYPE +# group: MAPPING_GROUP <---THIS IS OPTIONAL--- # Much like the field mappings above, the service mappings are a list of # dictionaries, however these are not associated with a field. # -#openstack_ratings_hashmap_service_mappings: -# - service: SERVICE_NAME -# cost: MAPPING_COST -# type: MAPPING_TYPE -# group: MAPPING_GROUP <---THIS IS OPTIONAL--- +# openstack_ratings_hashmap_service_mappings: +# - service: SERVICE_NAME +# cost: MAPPING_COST +# type: MAPPING_TYPE +# group: MAPPING_GROUP <---THIS IS OPTIONAL--- ############################################################################### # Dummy variable to allow Ansible to accept this file. -workaround_ansible_issue_8743: yes +workaround_ansible_issue_8743: true diff --git a/examples/container-clusters.yml b/examples/container-clusters.yml index 4d85d20..a4af4aa 100644 --- a/examples/container-clusters.yml +++ b/examples/container-clusters.yml @@ -9,7 +9,7 @@ openstack_container_clusters_templates: # Kubernetes magnum cluster template. openstack_container_clusters_template_k8s_fedora_coreos: - labels: "heat_container_agent_tag=ussuri-stable-1,kube_tag=v1.18.9,cloud_provider_tag=v1.18.2,monitoring_enabled=true,auto_scaling_enabled=true,auto_healing_enabled=true,auto_healing_controller=magnum-auto-healer,magnum_auto_healer_tag=latest,master_lb_floating_ip_enabled=true,cinder_csi_enabled=true,ingress_controller=octavia" + labels: "heat_container_agent_tag=ussuri-stable-1,kube_tag=v1.18.9,cloud_provider_tag=v1.18.2,monitoring_enabled=true,auto_scaling_enabled=true,auto_healing_enabled=true,auto_healing_controller=magnum-auto-healer,magnum_auto_healer_tag=latest,master_lb_floating_ip_enabled=true,cinder_csi_enabled=true,ingress_controller=octavia" # noqa yaml[line-length] external-network: "external" master-flavor: "m1.medium" flavor: "m1.medium" diff --git a/examples/images.yml b/examples/images.yml index 925406c..88ace2d 100644 --- a/examples/images.yml +++ b/examples/images.yml @@ -34,7 +34,7 @@ openstack_image_centos_stream8: - "vm" - "grub2" - "stable-interface-names" - is_public: True + is_public: true env: YUM: dnf DIB_RELEASE: "8-stream" @@ -55,7 +55,7 @@ openstack_image_cirros_0_6_0: type: qcow2 image_url: "https://github.com/cirros-dev/cirros/releases/download/0.6.0/cirros-0.6.0-x86_64-disk.img" checksum: "md5:f4027b89e99e238184e13089a3155b74" - is_public: True + is_public: true properties: os_type: "linux" os_distro: "cirros" @@ -78,7 +78,7 @@ openstack_image_rocky8: - "grub2" - "stable-interface-names" - "openssh-server" - is_public: True + is_public: true packages: - "bash-completion" - "vim-enhanced" @@ -101,7 +101,7 @@ openstack_image_rocky8: openstack_image_ubuntu_focal: name: "Ubuntu-20.04" type: raw - is_public: True + is_public: true elements: # Required for UEFI mode: - "block-device-efi" diff --git a/examples/ratings.yml b/examples/ratings.yml index 19d7e3c..9a1d35a 100644 --- a/examples/ratings.yml +++ b/examples/ratings.yml @@ -3,34 +3,34 @@ # Configuration of CloudKitty for openstack. # Example configuration for registering CloudKitty fields. -# Included is mapping for various different compute flavors & -# a service mapping based on the stored image size in Glance. +# Included is mapping for various different compute flavors & +# a service mapping based on the stored image size in Glance. openstack_ratings_hashmap_field_mappings: - service: instance name: flavor_id mappings: - - value: '1' #tiny compute flavour with an OpenStack flavor ID of 1 + - value: "1" # tiny compute flavour with an OpenStack flavor ID of 1 cost: 1.0 group: instance_uptime_flavor_id type: flat - - value: '2' #small compute flavour with an OpenStack flavor ID of 2 + - value: "2" # small compute flavour with an OpenStack flavor ID of 2 cost: 2.0 group: instance_uptime_flavor_id type: flat - - value: '3' #medium compute flavour with an OpenStack flavor ID of 3 + - value: "3" # medium compute flavour with an OpenStack flavor ID of 3 cost: 3.0 group: instance_uptime_flavor_id type: flat - - value: '4' #large compute flavour with an OpenStack flavor ID of 4 + - value: "4" # large compute flavour with an OpenStack flavor ID of 4 cost: 4.0 group: instance_uptime_flavor_id type: flat - - value: '5' #xlarge compute flavour with an OpenStack flavor ID of 5 + - value: "5" # xlarge compute flavour with an OpenStack flavor ID of 5 cost: 5.0 group: instance_uptime_flavor_id type: flat - - value: '6' #tiny 2 compute flavour with an OpenStack flavor ID of 6 + - value: "6" # tiny 2 compute flavour with an OpenStack flavor ID of 6 cost: 2.0 group: instance_uptime_flavor_id type: flat @@ -42,8 +42,7 @@ openstack_ratings_hashmap_service_mappings: type: flat # # ### ####### ##### THIS CONFIGURATION FILE ONLY WORKS IF -# # # # # # # 'cloudkitty.conf' & 'metrics.yml' ARE +# # # # # # # 'cloudkitty.conf' & 'metrics.yml' ARE # # # # # # ### CONFIGURED CORRECTLY. MORE INFO CAN -# # # # # # # BE FOUND IN THE 'stackhpc-kayobe-config' +# # # # # # # BE FOUND IN THE 'stackhpc-kayobe-config' # # ### # ##### DOCS. - From 521f00b5df9d11693bcada8c5031b86d386069a7 Mon Sep 17 00:00:00 2001 From: Rafal Lewandowski Date: Wed, 29 Jan 2025 14:21:39 +0100 Subject: [PATCH 35/45] make cloudkitty playbooks optional --- ansible/group_vars/all/openstack | 4 ++++ ansible/openstack.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/ansible/group_vars/all/openstack b/ansible/group_vars/all/openstack index c749f3c..3d9cb8d 100644 --- a/ansible/group_vars/all/openstack +++ b/ansible/group_vars/all/openstack @@ -81,3 +81,7 @@ openstack_ratings_hashmap_service_mappings: [] ############################################################################### # Configuration of volumes for OpenStack. openstack_volumes_types: [] + +############################################################################### +# Configuration of Cloudkitty for OpenStack. +openstack_cloudkitty_enable: false diff --git a/ansible/openstack.yml b/ansible/openstack.yml index e07e441..3afbc6f 100644 --- a/ansible/openstack.yml +++ b/ansible/openstack.yml @@ -9,3 +9,4 @@ - import_playbook: openstack-volume-types.yml # noqa name[play] - import_playbook: openstack-container-clusters.yml # noqa name[play] - import_playbook: openstack-ratings.yml # noqa name[play] + when: openstack_cloudkitty_enable | bool \ No newline at end of file From 6233dd7c3faf4550b0421777aceb7e9f6c099515 Mon Sep 17 00:00:00 2001 From: Rafal Lewandowski Date: Wed, 29 Jan 2025 14:23:43 +0100 Subject: [PATCH 36/45] new line --- ansible/openstack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/openstack.yml b/ansible/openstack.yml index 3afbc6f..56beb10 100644 --- a/ansible/openstack.yml +++ b/ansible/openstack.yml @@ -9,4 +9,4 @@ - import_playbook: openstack-volume-types.yml # noqa name[play] - import_playbook: openstack-container-clusters.yml # noqa name[play] - import_playbook: openstack-ratings.yml # noqa name[play] - when: openstack_cloudkitty_enable | bool \ No newline at end of file + when: openstack_cloudkitty_enable | bool From 4c36b5ec72633a8d148a961ff06327c64191f2c4 Mon Sep 17 00:00:00 2001 From: Rafal Lewandowski Date: Tue, 18 Feb 2025 09:56:13 +0100 Subject: [PATCH 37/45] set GRUB vars in example file --- examples/images.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/images.yml b/examples/images.yml index 88ace2d..1baf7a5 100644 --- a/examples/images.yml +++ b/examples/images.yml @@ -20,6 +20,11 @@ openstack_images: - "{{ openstack_image_rocky8 }}" - "{{ openstack_image_ubuntu_focal }}" +# Common GRUB settings for VM images +openstack_grub_env_common: + DIB_GRUB_TIMEOUT: 0 + DIB_GRUB_TIMEOUT_STYLE: hidden + # CentOS Stream 8. openstack_image_centos_stream8: name: "CentOS-stream8" From 964f80a027d9290ab8e3286013b481d8da1348cd Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Wed, 19 Feb 2025 11:53:10 +0000 Subject: [PATCH 38/45] Docs: Magnum templates are tied to Azimuth release --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index a520786..b018355 100644 --- a/README.rst +++ b/README.rst @@ -112,3 +112,7 @@ be sure to run the ``openstack-images.yml`` playbook *before* running the ``openstack-container-clusters.yml`` playbook, otherwise the Magnum API will return an error referencing an invalid cluster type with image ``None``. This is handled automatically if running the full ``openstack.yml`` playbook. + +Note that these templates are a tested set against the specific CAPI management +cluster release. As such, you should make sure to update your CAPI management +cluster to the latest release before updating to the latest templates. From 381bd89b23bbcee7ce03cc50403ccdc2d0ba704e Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Thu, 27 Feb 2025 10:10:13 +0000 Subject: [PATCH 39/45] Update example images to new versions Rocky 9 and Ubuntu Jammy are our standard versions now. --- examples/images.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/images.yml b/examples/images.yml index 1baf7a5..dbacc0f 100644 --- a/examples/images.yml +++ b/examples/images.yml @@ -17,8 +17,8 @@ os_images_force_rebuild: false openstack_images: - "{{ openstack_image_centos_stream8 }}" - "{{ openstack_image_cirros_0_6_0 }}" - - "{{ openstack_image_rocky8 }}" - - "{{ openstack_image_ubuntu_focal }}" + - "{{ openstack_image_rocky9 }}" + - "{{ openstack_image_ubuntu_jammy }}" # Common GRUB settings for VM images openstack_grub_env_common: @@ -67,9 +67,9 @@ openstack_image_cirros_0_6_0: os_version: "0.6.0" hw_rng_model: "virtio" -# Rocky Linux 8. -openstack_image_rocky8: - name: "Rocky8" +# Rocky Linux 9. +openstack_image_rocky9: + name: "Rocky9" type: raw elements: # Required for UEFI mode: @@ -95,16 +95,16 @@ openstack_image_rocky8: YUM: dnf DIB_CONTAINERFILE_RUNTIME: docker DIB_CONTAINERFILE_RUNTIME_ROOT: 1 - DIB_RELEASE: "8" + DIB_RELEASE: "9" properties: os_type: "linux" os_distro: "rocky" - os_version: "8" + os_version: "9" hw_rng_model: "virtio" -# Ubuntu Focal 20.04. -openstack_image_ubuntu_focal: - name: "Ubuntu-20.04" +# Ubuntu Jammy 22.04. +openstack_image_ubuntu_jammy: + name: "Ubuntu-22.04" type: raw is_public: true elements: @@ -124,8 +124,8 @@ openstack_image_ubuntu_focal: properties: os_type: "linux" os_distro: "ubuntu" - os_version: "focal" + os_version: "jammy" hw_rng_model: "virtio" env: - DIB_RELEASE: "focal" + DIB_RELEASE: "jammy" DIB_CLOUD_INIT_DATASOURCES: "ConfigDrive" From 80516bcbea6ae8284758b1f8bb71426ea314e969 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Tue, 18 Mar 2025 11:56:48 +0000 Subject: [PATCH 40/45] Add newer version of ansible for later python --- requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0c0c0b4..e4abdb9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ # Use Ansible 5 for consistent Rocky 9 behaviour when available, otherwise use # Ansible 4 ansible>=4,<5; python_version<"3.7" -ansible>=5,<6; python_version>="3.7" +ansible>=5,<6; python_version>="3.7" and python_version<"3.9" +ansible>=8,<10; python_version>="3.9" and python_version<"3.12" +ansible>=10,<11; python_version>="3.12" From f8c32fcba88589d4332450bd3269b1e7a9dd35b0 Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Mon, 19 May 2025 10:46:02 +0100 Subject: [PATCH 41/45] Magnum: default to OVN load balanacer provider --- README.rst | 11 ++++++++--- ansible/templates/magnum-capi-templates.j2 | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index b018355..3ba2e13 100644 --- a/README.rst +++ b/README.rst @@ -93,12 +93,17 @@ variables in `etc/openstack-config.yml` magnum_default_worker_flavor_name: # External network to use for load balancers etc. magnum_external_net_name: - # Octavia provider (e.g. 'ovn') - magnum_loadbalancer_provider: # Optional list of extra labels to add to all generated cluster templates magnum_template_extra_labels: -then run the provided playbook with +The load balancer provider defaults to OVN. This can be changed to Amphora, but you +should only do this if OVN load balancers are unavailable. + +.. code-block:: yaml + + magnum_loadbalancer_provider: amphora + +Then run the provided playbook with .. code-block:: bash diff --git a/ansible/templates/magnum-capi-templates.j2 b/ansible/templates/magnum-capi-templates.j2 index a555b1d..2476997 100644 --- a/ansible/templates/magnum-capi-templates.j2 +++ b/ansible/templates/magnum-capi-templates.j2 @@ -15,7 +15,7 @@ kube_dashboard_enabled: "true" keystone_auth_enabled: "false" capi_helm_chart_version: "{{ capi_helm_chart_release_data.json.tag_name }}" - octavia_provider: {{ magnum_loadbalancer_provider }} + octavia_provider: {{ magnum_loadbalancer_provider | default('ovn') }} {% if magnum_template_extra_labels is defined and magnum_template_extra_labels is not none %} {{ magnum_template_extra_labels | to_nice_yaml | indent(4) -}} {% endif %} From 044fb620af4c6aed0e56981e7b33d69c01df8211 Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Fri, 23 May 2025 12:41:31 +0100 Subject: [PATCH 42/45] Increase stackhpc.openstack to 0.5.2 --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index c58c0ae..27a0c3d 100644 --- a/requirements.yml +++ b/requirements.yml @@ -3,4 +3,4 @@ collections: - name: openstack.cloud version: 2.4.1 - name: stackhpc.openstack - version: 0.2.4 + version: 0.5.2 From 8273a5d5002e658bc7cf9715144b29e8c35ec078 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Thu, 5 Jun 2025 17:16:19 +0100 Subject: [PATCH 43/45] CI: Run only in stackhpc repository --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1cf307a..b7e9022 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -4,6 +4,7 @@ name: Pull request pull_request: jobs: lint: + if: github.repository == 'stackhpc/openstack-config' runs-on: ubuntu-22.04 permissions: {} strategy: From fc01794fd352c968ebacc46ad955768121930322 Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Tue, 17 Jun 2025 10:47:09 +0100 Subject: [PATCH 44/45] Fix helm chart release version download --- ansible/generate-magnum-capi-templates.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible/generate-magnum-capi-templates.yml b/ansible/generate-magnum-capi-templates.yml index 45deec7..664af42 100644 --- a/ansible/generate-magnum-capi-templates.yml +++ b/ansible/generate-magnum-capi-templates.yml @@ -20,6 +20,7 @@ - name: Fetch dependencies.json for capi-helm-charts release ansible.builtin.uri: url: https://raw.githubusercontent.com/azimuth-cloud/capi-helm-charts/{{ capi_helm_chart_release_data.json.tag_name }}/dependencies.json + return_content: true register: dependencies_response - name: Ensure wget packages is installed @@ -29,12 +30,14 @@ state: present - name: Fetch manifest.json for capi-helm-charts images # noqa command-instead-of-module + vars: + dependencies: "{{ dependencies_response.content }}" # ansible.builtin.uri: # url: https://raw.githubusercontent.com/azimuth-cloud/azimuth-images/{{ dependencies_response.json['azimuth-images'] }}/manifest.json # Above URL returns 404 even though similar URL for capi-helm-charts repo works fine # Not sure why but fall back to wget + JSON parsing for now. ansible.builtin.command: >- - wget -O - https://github.com/azimuth-cloud/azimuth-images/releases/download/{{ dependencies_response.json['azimuth-images'] }}/manifest.json + wget -O - https://github.com/azimuth-cloud/azimuth-images/releases/download/{{ dependencies['azimuth-images'] }}/manifest.json register: manifest_response changed_when: false From 502d534faf050a52333c289cc2deda874be77616 Mon Sep 17 00:00:00 2001 From: Matt Crees Date: Tue, 29 Jul 2025 14:40:13 +0000 Subject: [PATCH 45/45] Define new volume types --- etc/openstack-config/openstack-config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/etc/openstack-config/openstack-config.yml b/etc/openstack-config/openstack-config.yml index 471cb69..7221a9f 100644 --- a/etc/openstack-config/openstack-config.yml +++ b/etc/openstack-config/openstack-config.yml @@ -135,6 +135,21 @@ openstack_unlimited_quotas: snapshots: -1 volumes: -1 +############################################################################### +# Configuration of volume types. + +# List of volume types in the openstack system. Format is ad required by +# the stackhpc.openstack.os_volumes role. +openstack_volumes_types: + - name: capacity + public: true + extra_specs: + volume_backend_name: 'capacity' + - name: iops + public: true + extra_specs: + volume_backend_name: 'iops' + ############################################################################### # Configuration of networks, subnets and routers.