Add custom cleanup.
This commit is contained in:
parent
9239f0a83b
commit
c1e8693547
@ -3,23 +3,17 @@
|
||||
hosts: all
|
||||
become: true
|
||||
vars:
|
||||
dns_container_name: "cloudflare-dns"
|
||||
dns_image_version: "latest"
|
||||
dns_volume_config: "/tmp"
|
||||
dns_domains:
|
||||
auth:
|
||||
scopedToken: ${MOLECULE_CF_TOKEN:-}
|
||||
scopedToken: "${MOLECULE_CF_TOKEN:-}"
|
||||
domains:
|
||||
- name: foo.example.com
|
||||
- name: "${MOLECULE_CF_DOMAIN_NAME:-}"
|
||||
type: A
|
||||
proxied: true
|
||||
create: true
|
||||
zoneId: ${MOLECULE_CF_ZONEID:-}
|
||||
zoneId: "${MOLECULE_CF_ZONE_ID:-}"
|
||||
|
||||
pre_tasks:
|
||||
- name: create default directory
|
||||
file:
|
||||
path: "{{ swag_data }}/nginx/site-confs"
|
||||
state: directory
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
@ -29,3 +23,7 @@
|
||||
- requests
|
||||
roles:
|
||||
- role: laurivan.cloudflare_ddns
|
||||
post_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=yes cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
@ -17,6 +17,7 @@ provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
||||
cleanup: ../shared/cleanup.yml
|
||||
verifier:
|
||||
name: ansible
|
||||
lint: |
|
||||
|
10
molecule/shared/cleanup.yml
Normal file
10
molecule/shared/cleanup.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: Destroy created docker image
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: "destroy the docker container"
|
||||
community.docker.docker_container:
|
||||
name: "cloudflare-dns"
|
||||
state: absent
|
@ -12,7 +12,7 @@
|
||||
- configuration
|
||||
|
||||
- name: Create the Dynamic DNS container
|
||||
docker_container:
|
||||
community.docker.docker_container:
|
||||
name: "{{ dns_container_name }}"
|
||||
image: "joshava/cloudflare-ddns:{{ dns_image_version }}"
|
||||
recreate: yes
|
||||
|
Loading…
Reference in New Issue
Block a user