---
- name: OVH CLOUD DEPROVISIONING
  hosts: localhost
  connection: local
  tags: [ 'never', 'force-delete' ]
  vars:
    ovh_prefix: cloud
  tasks:
    - name: list all server in cloud project
      os_server_info:
        availability_zone: nova
        server: "{{ ovh_prefix }}-*"
        filters:
          vm_state: active
      register: result_json

    - name: register variable for futures uses
      set_fact:
        current_servers: "{{ result_json.openstack_servers }}"
        current_server_inventory: "{{ query('inventory_hostnames', 'all:!localhost') | flatten(1) }}"

    - name: delete server from inventory
      os_server:
        state: absent
        name: "{{ item.name }}"
      when:
        - item.name not in current_server_inventory
      loop: "{{ current_servers }}"

...
