destroy cluster and rename terraform to create-cluster

This commit is contained in:
Valentin CZERYBA 2022-10-09 13:04:02 +02:00
parent bbb3e03651
commit a30ab86b4f
3 changed files with 19 additions and 6 deletions

View File

@ -12,10 +12,6 @@
dest: "{{ project_terraform }}/main.tf"
- name: display plan terraform
debug:
var: output
- name: Create cluster scaleway
community.general.terraform:
project_path: '{{ project_terraform }}'

View File

@ -0,0 +1,13 @@
- name: "Destroy cluster via terraform"
community.general.terraform:
project_path: '{{ project_terraform }}'
state: absent
environment:
SCW_ACCESS_KEY: "{{ scw_access_key }}"
SCW_SECRET_KEY: "{{ scw_secret_key }}"
register: output
- name: Remove directory
file:
path: '{{ project_terraform }}'
state: absent

View File

@ -1,7 +1,11 @@
- name: Create cluster k8s scaleway via terraform
ansible.builtin.import_tasks: terraform.yml
ansible.builtin.import_tasks: create-cluster.yml
tags: ["create-cluster"]
- name: Get id Cluster
ansible.builtin.import_tasks: k8s.yml
tags: ["create-cluster", "api"]
- name: Destroy cluster k8s scaleway via terraform
ansible.builtin.import_tasks: destroy-cluster.yml
tags: ["destroy-cluster"]