-
Feature Request
-
Resolution: Unresolved
-
Undefined
-
None
-
2.4
-
False
-
-
False
Feature Overview
We are receiving requests from customers regarding Case 03367506.
Background, and strategic fit
In Case 03367506, the customer needs to disassociate hosts from groups frequently so they need that function in ansible.controller.group module.
Currently, we have a workaround which uses ansible.builtin.uri module. The following is an example.
- name: Example of disassociate hosts from groups ansible.builtin.uri: url: https://<CONTROLLER_URL>/api/v2/groups/N/hosts/ method: POST url_username: USERNAME url_password: PASSWORD force_basic_auth: yes status_code: 204 headers: Content-Type: application/json body: "{{ lookup('ansible.builtin.file','issue.json') }}" body_format: json validate_certs: false
issue.json
{"disassociate": "1", "id": N} # N is a host ID
But if we need to disassociate multiple hosts from groups, it needs to implement the complicated playbook.
I'm assuming the new feature is like the following:
- name: Example of disassociate hosts from groups ansible.controller.group: inventory: "inventory test" name: "test group" disassociate_hosts: # <<=== new feature - test1 - test2 validate_certs: no