diff --git a/README.md b/README.md index f688497..5e34b31 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,8 @@ -# deploy then delete: +# deploy: $ SECRETS_ARCHIVE_PASSPHRASE=XXXXXX ansible-playbook -e target_name=host.domain -e SECRET_HOST=host2.domain2 deploy_ovh_instance.yml -# only delete: -$ SECRETS_ARCHIVE_PASSPHRASE=XXXXXX ansible-playbook -e target_name=host.domain -e SECRET_HOST=host2.domain2 -t delete deploy_ovh_instance.yml - -# deploy and do not delete: -$ SECRETS_ARCHIVE_PASSPHRASE=XXXXXX ansible-playbook -e target_name=host.domain -e SECRET_HOST=host2.domain2 -e delete=False deploy_ovh_instance.yml +# delete: +$ SECRETS_ARCHIVE_PASSPHRASE=XXXXXX ansible-playbook -e target_name=host.domain -e SECRET_HOST=host2.domain2 delete_ovh_instance.yml library directory contains Ansible modules from https://github.com/gheesh/ansible-ovh-dns diff --git a/delete_ovh_instance.yml b/delete_ovh_instance.yml new file mode 100644 index 0000000..2991cd7 --- /dev/null +++ b/delete_ovh_instance.yml @@ -0,0 +1,15 @@ +- name: delete OVH instance + hosts: localhost + connection: local + vars_files: + - vars/main.yml + tasks: + - name: Retrieve secrets + ansible.builtin.include_tasks: "tasks/retrieve_secret_vars.yml" + + - name: Include OVH application credentials + ansible.builtin.include_vars: "{{ remote_workdir }}/OVH_APPLICATION.yml" + + - name: include role_delete_openstack_instance + ansible.builtin.include_role: + name: role_delete_openstack_instance diff --git a/deploy_ovh_instance.yml b/deploy_ovh_instance.yml index a48523b..a680d91 100644 --- a/deploy_ovh_instance.yml +++ b/deploy_ovh_instance.yml @@ -171,23 +171,3 @@ apply: tags: deploy_openvpn-server tags: deploy_openvpn-server - -- name: delete OVH instance - hosts: localhost - connection: local - tags: delete - vars_files: - - vars/main.yml - tasks: - - name: Retrieve secrets - ansible.builtin.include_tasks: "tasks/retrieve_secret_vars.yml" - when: delete | default(True) | bool - - - name: Include OVH application credentials - ansible.builtin.include_vars: "{{ remote_workdir }}/OVH_APPLICATION.yml" - when: delete | default(True) | bool - - - name: include role_delete_openstack_instance - ansible.builtin.include_role: - name: role_delete_openstack_instance - when: delete | default(True) | bool