I’ve to take away particuar customers i get as a listing from a monitoring instrument(Splunk). The monitoring instrument will give customers record and software identify record which the person is utilizing. I’ve to delete the customers from the record. Since I gave the content material like this in Copy module, it’s not creating the txt file as anticipated.
duties:
- identify: Create a file as check.txt
file:
path: /house/person/home windows/check.txt
state: contact
- stat:
path: /house/person/home windows/check.txt
register: file_path
- debug:
msg: File exists
when: file_path.stat.exists == true
- copy:
content material: REVOKE {{person}} {{software}}
dest: /house/person/home windows/check.txt
when: file_path.stat.exists == true
What i anticipate is:
REVOKE user1 app1
REVOKE user2 app2
REVOKE user3 app3
what it’s storing in txt file is:
REVOKE user1 app1
user2 app2
user3 app3
as soon as this txt file is created and that i restart the respective service. All of the customers talked about within the txt file might be deleted from server. From Splunk the customers and software record might be despatched to Ansible tower the place this Job template is current to delete customers. Does anybody have any concept how one can obtain this anticipated end result