刪除我們的例項
要刪除我們的例項,請重複使用帶有所有身份驗證資訊的 os_server 命令,然後將’state:present’替換為’state:absent’。
$vi stop_compute.yml
- name: launch a compute instance
hosts: localhost
gather_facts: False
tasks:
- name: Create and launch the VM
os_server:
auth:
auth_url: https://openstack-identity.mygroup/v2.0
username: "{{ AuthUserName }}"
password: "{{ AuthPassword }}"
project_name: "{{ ProjectName }}"
state: absent
validate_certs: False
name: "{{ TPUser }}"
timeout: 200