You can use the ali_ros_stack module to delete a stack by writing Ansible playbook code. This topic describes how to use the ali_ros_stack module to delete a stack. VPC deletion is used as an example.
Ansible is installed and configured on Linux.
- Create a file named delete_vpc.yml and open it in the visual editor.
- In the edit mode, copy the following playbook code to the delete_vpc.yml file:
Note For more information about the ali_ros_stack module parameters, see Parameters.
- hosts: localhost remote_user: root tasks: - name: Changed. Delete Ros Stack ali_ros_stack: state: absent stack_name: vpc_2020-04-08_test
- Save the file and exit the edit mode.
- Run the Ansible playbook to delete a VPC.
ansible-playbook delete_vpc.yml -v