Adding an external module

Hi,
Lately i have started to use Ansible, And i still trying to figure out how some things works.

I need to edit yaml file. I didn’t find any core model which i can use easily, So i had to find an external module which can do so.
Can someone tell me what should i do in order to use this module?

I have tried to place the py file under …/ansible/lib/ansible/modules/extras, but i get an error when i run my playbook:

`
The error appears to have been in ‘/etc/ansible/config/test.yml’: line 39, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  • name: edit some yaml
    ^ here

`

I didn’t install this server, and it might be that the configuration is not by the book. Anyway, i could write and run playbooks with no issues so far.

  1. I would appreciate any help regarding using the external module.
  2. If anyone familiar with any other easy module, which can edit a yaml file, i would like to know.

Thanks

In the same directory you have you playbook create a directory called library. Copy the file yedit.py in the library directory.

For more information see
https://docs.ansible.com/ansible/intro_configuration.html#library