role_k8s_metallb_deploy/tasks/main.yml

44 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2021-10-19 20:15:55 -04:00
---
#####################################################################
#
# metallb_deploy role
#
# - requires that the 'devpath' and 'metallb_ver' variables be set
#
#####################################################################
# tasks file for metallb_deploy role
- debug: msg="Deploying metallb load-balancer."
2023-04-02 21:23:50 -04:00
- name: Retrieve the metallb 'metallb-native.yaml' manifest
2021-10-19 20:15:55 -04:00
ansible.builtin.get_url:
2023-04-02 21:23:50 -04:00
url: "https://raw.githubusercontent.com/metallb/metallb/{{ metallb_ver }}/config/manifests/metallb-native.yaml"
dest: "/tmp/metallb-native.yaml"
2021-10-19 20:15:55 -04:00
mode: '0644'
2023-04-02 21:23:50 -04:00
- name: Apply metallb 'metallb-native.yaml' manifest
kubernetes.core.k8s:
2021-10-19 20:15:55 -04:00
state: present
2023-04-02 21:23:50 -04:00
src: "/tmp/metallb-native.yaml"
2021-10-19 20:15:55 -04:00
2023-04-02 21:23:50 -04:00
- name: Delete retrieved 'metallb-native.yaml' manifest file
2021-10-19 20:15:55 -04:00
ansible.builtin.file:
2023-04-02 21:23:50 -04:00
path: "/tmp/metallb-native.yaml"
2021-10-19 20:15:55 -04:00
state: absent
#######################################################
- debug: msg="Waiting 90 seconds to allow metallb to fully deploy"
#######################################################
- name: Wait 90 seconds to allow metallb to fully deploy
wait_for:
timeout: 90
2023-04-02 21:23:50 -04:00
- name: Create metallb IPAddressPool object
kubernetes.core.k8s:
2021-10-19 20:15:55 -04:00
state: present
namespace: metallb-system
2023-04-02 21:23:50 -04:00
src: "{{ devpath }}/k8s_metallb/metallb_ipaddresspool.yml"
2021-10-19 20:15:55 -04:00
# EOF