--- # tasks file for create cluster k8s via terraform - name: Create directory {{ project_terraform }} file: path: "{{ project_backend }}" state: directory - name: Copy backend k8s yaml template: src: "{{ item }}.yaml.j2" dest: "{{ project_backend }}/{{ item }}.yaml" with_items: "{{ backend_yaml }}" - name: Create a k8s namespace kubernetes.core.k8s: name: testing api_version: v1 kind: Namespace state: present - name: Apply deployment kubernetes.core.k8s: src: "{{ project_backend }}/backend-deployment.yaml" state: present - name: Apply services kubernetes.core.k8s: src: "{{ project_backend }}/backend-service.yaml" state: present - name: Apply configmap kubernetes.core.k8s: src: "{{ project_backend }}/env-configmap.yaml" state: present - name: Apply secret kubernetes.core.k8s: src: "{{ project_backend }}/secret.yaml" state: present