You can use the ali_ros_stack_info module to query information about a stack by writing Ansible playbook code. This topic describes how to use the ali_ros_stack_info module to query information about a stack. VPC query is used as an example.

Prerequisites

Ansible is installed and configured on Linux.

Procedure

  1. Create a file named get_vpc.yml and open it in the visual editor.
    vi get_vpc.yml
  2. In the edit mode, copy the following playbook code to the get_vpc.yml file:
    Note For more information about the ali_ros_stack_info module parameters, see Parameters.
    - hosts: localhost
      remote_user: root
      tasks:
      - name: Get ROS Stack Info By ids
        ali_ros_stack_info:
            stack_ids:
              - f83226ec-b0f2-4c78-8139-99fe24f3****
              - 0d87e1b4-c54f-4f3e-abed-2678e661****
    
      - name: Get ROS Stack Info By name_prefix
        ali_ros_stack_info:
            name_prefix: kong_stack
  3. Save the file and exit the edit mode.
  4. Run the Ansible playbook to query information about a VPC.
    ansible-playbook get_vpc.yml -v