mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
---
|
|
- name: kube_lego | Templating manifests
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "/tmp/{{ item | regex_replace('.j2', '') }}"
|
|
with_items:
|
|
- lego-sa.yml.j2
|
|
- lego-clusterolebinding.yml.j2
|
|
- lego-clusterole.yml.j2
|
|
- lego-configmap.yml.j2
|
|
- lego-controller.yml.j2
|
|
when: inventory_hostname == initial_master
|
|
|
|
- name: kube_lego | Deploying kube-lego
|
|
kube:
|
|
name: "{{ item.name }}"
|
|
resource: "{{ item.type }}"
|
|
filename: "{{ item.file }}"
|
|
state: latest
|
|
with_items:
|
|
- { 'name': 'kube-lego', 'type': 'sa', 'file': '/tmp/lego-sa.yml' }
|
|
- { 'name': 'kube-lego', 'type': 'clusterrolebingind', 'file': '/tmp/lego-clusterolebinding.yml' }
|
|
- { 'name': 'kube-lego', 'type': 'clusterrole', 'file': '/tmp/lego-clusterole.yml' }
|
|
- { 'name': 'kube-lego', 'type': 'configmap', 'file': '/tmp/lego-configmap.yml' }
|
|
- { 'name': 'kube-lego', 'type': 'deploy', 'file': '/tmp/lego-controller.yml' }
|
|
when: inventory_hostname == initial_master
|
|
|
|
- name: kube_lego | Removing manifest
|
|
file:
|
|
path: "/tmp/{{ item }}"
|
|
state: absent
|
|
with_items:
|
|
- lego-namespace.yml
|
|
- lego-sa.yml
|
|
- lego-clusterolebinding.yml
|
|
- lego-clusterole.yml
|
|
- lego-configmap.yml
|
|
- lego-controller.yml
|
|
when: inventory_hostname == initial_master
|
|
|