Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ♻️ installation cert-manager via helm chart #69

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions roles/cert-manager/filter_plugins/custom_cert_manager.py

This file was deleted.

48 changes: 22 additions & 26 deletions roles/cert-manager/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
- name: Check cert-manager deployment
kubernetes.core.k8s_info:
kind: Deployment
namespace: cert-manager
name: cert-manager-webhook
register: cert_manager_webhook
- name: Add cert-manager helm repo
kubernetes.core.helm_repository:
name: jetstack
repo_url: https://charts.jetstack.io

- name: Download cert-manager
ansible.builtin.uri:
url: "https://github.com/cert-manager/cert-manager/releases/download/{{ dsc.certmanager.version }}/cert-manager.yaml"
return_content: true
register: cert_manifest
# Installation des CRDs indépendamment du chart helm.
# Recommandé en production.
# Voir : https://cert-manager.io/docs/installation/helm
- name: Apply CRDs
kubernetes.core.k8s:
state: present
src: "https://github.com/cert-manager/cert-manager/releases/download/{{ dsc.certmanager.chartVersion }}/cert-manager.crds.yaml"

- name: Edit manifest
- name: Set cert-manager helm values
ansible.builtin.set_fact:
manifest: "{{ cert_manifest.content | from_yaml_all | custom_cert_manager(envs) }}"
vars:
envs:
- name: http_proxy
value: "{{ dsc.proxy.http_proxy }}"
- name: https_proxy
value: "{{ dsc.proxy.https_proxy }}"
- name: no_proxy
value: "{{ dsc.proxy.no_proxy }}"
when: dsc.proxy.enabled
cm_values: "{{ lookup('template', 'values.yaml.j2') | from_yaml }}"

- name: Apply cert-manager
kubernetes.core.k8s:
state: present
definition: "{{ manifest | default(cert_manifest.content | from_yaml_all) }}"
- name: Deploy helm
kubernetes.core.helm:
# force: true
name: cert-manager
chart_ref: jetstack/cert-manager
chart_version: "{{ dsc.certmanager.chartVersion }}"
release_namespace: cert-manager
create_namespace: true
values: "{{ cm_values }}"

- name: Wait cert-manager to initialize
kubernetes.core.k8s_info:
Expand Down
Loading