Skip to content

Commit

Permalink
Improve use of Ansible roles variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaiacs committed Jan 3, 2025
1 parent 26aec89 commit 60d4e61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ansible/gesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
gather_facts: false
become: true
roles:
- k8s-control-panel
- role: k8s-control-panel
vars:
k8s_control_panel_addresses_begin: '{{ K8S_INGRESS }}'
k8s_control_panel_addresses_end: '{{ K8S_INGRESS }}'
- name: Configure Kubernetes workers
hosts: kubernetes_workers
gather_facts: false
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/k8s-control-panel/tasks/metallb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
spec:
addresses:
# TODO Use Jinja filter to automate this.
- "{{ K8S_INGRESS }}-{{ K8S_INGRESS }}"
- "{{ k8s_control_panel_addresses_begin }}-{{ k8s_control_panel_addresses_end }}"
- name: Configure L2 Advertisement for MetalLB
kubernetes.core.k8s:
state: present
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/k8s-control-panel/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ k8s_control_panel_cidr: "10.244.0.0/16"
k8s_control_panel_metallb_version: 0.14.9
k8s_control_panel_metallb_ip_address_pool_name: "gesis"
k8s_control_panel_ingress_nginx_version: 4.12.0
k8s_control_panel_addresses_begin: 0.0.0.0
k8s_control_panel_addresses_end: 0.0.0.0

0 comments on commit 60d4e61

Please sign in to comment.