This topic describes how to use the ali_ros_stack module to delete a stack by writing Ansible playbook code. A VPC is used in the example.
Ansible is installed on Linux with pip3 and configured.
- Create a file named delete_vpc.yml and open it in the visual editor.
- In 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