ansible-role-sonarqube/molecule/default/destroy.yml

28 lines
739 B
YAML
Raw Permalink Normal View History

2023-04-28 00:32:36 +02:00
---
2023-04-29 20:48:33 +02:00
- name: "Destroy"
hosts: "localhost"
connection: "local"
2023-04-28 00:32:36 +02:00
gather_facts: false
no_log: "{{ molecule_no_log }}"
tasks:
# Developer must implement.
2023-04-29 20:48:33 +02:00
- name: "Remove the docker image"
2023-04-28 00:32:36 +02:00
community.docker.docker_container:
2023-04-29 20:48:33 +02:00
name: "sonarqube"
state: "absent"
2023-04-28 00:32:36 +02:00
# Mandatory configuration for Molecule to function.
2023-04-29 20:48:33 +02:00
- name: "Populate instance config"
2023-04-28 00:32:36 +02:00
ansible.builtin.set_fact:
instance_conf: {}
2023-04-29 20:48:33 +02:00
- name: "Dump instance config"
2023-04-28 00:32:36 +02:00
ansible.builtin.copy:
content: |
# Molecule managed
{{ instance_conf | to_json | from_json | to_yaml }}
dest: "{{ molecule_instance_config }}"
mode: 0600
2023-04-29 20:48:33 +02:00
when: "server.changed | default(false) | bool"