Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Davidson committed Mar 6, 2024
1 parent fb00a1f commit 494e39b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ variables in `etc/openstack-config.yml`

.. code-block:: yaml
magnum_default_flavor_name: # Chosen flavor on target cloud
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')
Expand Down
14 changes: 14 additions & 0 deletions ansible/generate-magnum-capi-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
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/stackhpc/capi-helm-charts/releases/latest
Expand All @@ -15,6 +23,12 @@
url: https://raw.githubusercontent.com/stackhpc/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
# ansible.builtin.uri:
# url: https://raw.githubusercontent.com/stackhpc/azimuth-images/{{ dependencies_response.json['azimuth-images'] }}/manifest.json
Expand Down
14 changes: 7 additions & 7 deletions ansible/templates/magnum-capi-templates.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
capi_helm_chart_version: "{{ capi_helm_chart_release_data.json.tag_name }}"
octavia_provider: {{ magnum_loadbalancer_provider }}
external_network_id: {{ magnum_external_net_name }}
master_flavor: {{ magnum_default_flavor_name }}
flavor: {{ magnum_default_flavor_name }}
master_flavor: {{ magnum_default_master_flavor_name }}
flavor: {{ magnum_default_worker_flavor_name }}
image: "{{ item.value.name }}"
name: "{{ item.key }}"
coe: "kubernetes"
network_driver: "calico"
master_lb_enabled: "True"
floating_ip_enabled: "True"
dns_nameserver: "1.1.1.1,8.8.8.8,8.8.4.4"
public: True
network_driver: "{{ magnum_default_network_driver | default('calico') }}"
master_lb_enabled: "{{ magnum_master_lb_enabled | default('True') }}"
floating_ip_enabled: "{{ magnum_cluster_floating_ip_enabled | default('True') }}"
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 %}
31 changes: 31 additions & 0 deletions etc/openstack-config/openstack-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,37 @@
# stackhpc.os-container-clusters role.
#openstack_container_clusters_templates:

# Configuration variables for generating new 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:

###############################################################################
# Dummy variable to allow Ansible to accept this file.
workaround_ansible_issue_8743: yes

0 comments on commit 494e39b

Please sign in to comment.