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

Prerequisites

Ansible is installed on Linux with pip3 and configured.

Procedure

  1. Create a file named get_vpc.yml and open it in the visual editor.
    vi get_vpc.yml
  2. In 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