initial checkin

This commit is contained in:
Radar231 2021-10-19 20:15:55 -04:00
commit d084bc8f4e
3 changed files with 68 additions and 0 deletions

8
README.md Normal file
View File

@ -0,0 +1,8 @@
# Ansible Role: k8s_metallb_deploy
## Introduction
This role will deploy the metallb load-balancer.
This role requires that the 'devpath' variable be set.

9
meta/main.yml Normal file
View File

@ -0,0 +1,9 @@
galaxy_info:
author: radar231
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
galaxy_tags: []
dependencies: []
# EOF

51
tasks/main.yml Normal file
View File

@ -0,0 +1,51 @@
---
#####################################################################
#
# 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 'namespace.yaml' manifest
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/metallb/metallb/{{ metallb_ver }}/manifests/namespace.yaml"
dest: "/tmp/namespace.yaml"
mode: '0644'
- name: Apply metallb 'namespace.yaml' manifest
community.kubernetes.k8s:
state: present
src: "/tmp/namespace.yaml"
- name: Delete retrieved 'namespace.yaml' manifest file
ansible.builtin.file:
path: "/tmp/namespace.yaml"
state: absent
- name: Retrieve the metallb 'metallb.yaml' manifest
ansible.builtin.get_url:
url: "https://raw.githubusercontent.com/metallb/metallb/{{ metallb_ver }}/manifests/metallb.yaml"
dest: "/tmp/metallb.yaml"
mode: '0644'
- name: Apply metallb 'metallb.yaml' manifest
community.kubernetes.k8s:
state: present
src: "/tmp/metallb.yaml"
- name: Delete retrieved 'metallb.yaml' manifest file
ansible.builtin.file:
path: "/tmp/metallb.yaml"
state: absent
- name: Create metallb configmap object
community.kubernetes.k8s:
state: present
namespace: metallb-system
src: "{{ devpath }}/k8s_metallb/metallb_configmap.yml"
# EOF