Library to clean up Ansible tasks from any Personally Identifiable Information (PII)
- Free software: Apache Software License 2.0
The library can be used to remove the PII from a multi level structure:
$ python3 >>> from ansible_anonymizer import anonymizer >>> example = [{"name": "foo bar", "email": "[email protected]"}] >>> anonymizer.anonymize_struct(example) ['- email: [email protected]\n name: foo bar\n']
But you can also anonymize a block of text:
>>> from ansible_anonymizer import anonymizer >>> some_text = """ ... - name: a task ... a_module: ... secret: foobar ... """ >>> anonymizer.anonymize_text_block(some_text) '\n- name: a task\n a_module:\n secret: {{ }}\n'
You can also use the ansible-anonymizer
command:
ansible-anonymizer my-secret-file