kubernetes and all, test to cron playbook

This commit is contained in:
2023-10-01 17:39:11 +02:00
parent 1d51266e6b
commit 8df61ab3dc
4 changed files with 243 additions and 15 deletions

View File

@@ -77,7 +77,7 @@
- "{{ kubernetes_tree_base_dir | last }}"
- "{{ kubernetes_tree_base_dir | last }}/{{ kubernetes_service }}"
tags:
- git
- test
#kubectl label node <node name> node-role.kubernetes.io/<role name>=<key
@@ -91,27 +91,35 @@
# need pip kubernetes to use k8s module
- name: Create all k8s namespace
kubernetes.core.k8s:
name: argocd
name: "{{ item.namespace }}"
api_version: v1
kind: Namespace
state: present
loop: "{{ kubernetes_namespaces }}"
when: kubernetes_role == 'control_plane'
tags:
- test
# Download and apply manifest
- name: Download all manifest to the cluster.
- name: Download all manifests to the cluster.
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
dest: "{{ kubernetes_tree_base_dir | last }}/{{ kubernetes_service }}/install.yaml"
url: "{{ item.url| default(omit) }}"
dest: "{{ kubernetes_tree_base_dir | last }}/{{ kubernetes_service }}/{{ item.namespace }}_{{ item.file }}.yaml"
mode: '0664'
loop: "{{ kubernetes_namespaces }}"
when:
- kubernetes_role == 'control_plane'
tags:
- test
- name: Apply argocd manifest to the cluster.
- name: Apply all manifests to the cluster.
kubernetes.core.k8s:
state: present
namespace: argocd
src: "{{ kubernetes_tree_base_dir | last }}/{{ kubernetes_service }}/install.yaml"
namespace: "{{ item.namespace }}"
src: "{{ kubernetes_tree_base_dir | last }}/{{ kubernetes_service }}/{{ item.namespace }}_{{ item.file }}.yaml"
loop: "{{ kubernetes_namespaces }}"
when:
- kubernetes_role == 'control_plane'
tags:
- test
@@ -126,7 +134,7 @@
kind: "{{ item.kind }}"
definition: "{{ item.definition }}"
state: present
loop: "{{ kubernetes_argocd_objects }}"
loop: "{{ kubernetes_traefik_objects }}"
tags:
- test
- last