role_k8s_metallb_deploy/tasks/main.yml

44 lines
1.3 KiB
YAML

---
#####################################################################
#
# 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."
- name: Retrieve the metallb 'metallb-native.yaml' manifest
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/metallb/metallb/{{ metallb_ver }}/config/manifests/metallb-native.yaml"
dest: "/tmp/metallb-native.yaml"
mode: '0644'
- name: Apply metallb 'metallb-native.yaml' manifest
kubernetes.core.k8s:
state: present
src: "/tmp/metallb-native.yaml"
- name: Delete retrieved 'metallb-native.yaml' manifest file
ansible.builtin.file:
path: "/tmp/metallb-native.yaml"
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
- name: Create metallb IPAddressPool object
kubernetes.core.k8s:
state: present
namespace: metallb-system
src: "{{ devpath }}/k8s_metallb/metallb_ipaddresspool.yml"
# EOF