# how to use extends\_documentation\_fragment. getting error while using it

**URL:** <https://forum.ansible.com/t/how-to-use-extends-documentation-fragment-getting-error-while-using-it/32978>\
**Category:** Ansible Project\
**Created:** [May 20, 2020, 7:21am UTC](https://forum.ansible.com/t/how-to-use-extends-documentation-fragment-getting-error-while-using-it/32978 "2020-05-20T07:21:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alok\_ranjan](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@alok\_ranjan](https://forum.ansible.com/u/alok_ranjan)\
**Post date:** [May 20, 2020, 7:21am UTC](https://forum.ansible.com/t/how-to-use-extends-documentation-fragment-getting-error-while-using-it/32978/1 "2020-05-20T07:21:55Z")

</div>

Hi ,

I am new to ansible and this is my first ansible project. I am writing my own ansible modules which shares the same document acroos multiple modules which i need to develop.  
As per the ansible website [https://docs.ansible.com/ansible/latest/dev\_guide/developing\_modules\_documenting.html](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html) we can use **extends\_documentation\_fragment**.

After going through the web link this is what i did on my centos (ansible controller)

**i create a new doc file (alokdoc.py) with below content**.

class ModuleDocFragment(object):

DOCUMENTATION = r’‘’  
array\_ip:  
description:

- “The storage system IP address.”  
required: True  
array\_password:  
description:
- “The storage system password.”  
required: True  
array\_username:  
description:
- “The storage system user name.”  
required: True  
‘’’

I saved this under the following directory “/usr/lib/python3.6/site-packages/ansible/plugins/doc\_fragments” as “alokdoc.py”

Now in my ansible module ,namely, alok\_module1.py, located under /etc/ansible/library/modules , i wrote the below

DOCUMENTATION = r’‘’

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [May 21, 2020, 3:27am UTC](https://forum.ansible.com/t/how-to-use-extends-documentation-fragment-getting-error-while-using-it/32978/2 "2020-05-21T03:27:36Z")

</div>

you are missing `options:` in your fragment, you are listing them  
directly at top level which won't be understood.

```auto
class ModuleDocFragment(object):

    DOCUMENTATION = r'''
options:
    array_ip:
      description:
      - "The storage system IP address."
      required: True
    array_password:
      description:
      - "The storage system password."
      required: True
    array_username:
      description:
      - "The storage system user name."
      required: True
    '''

```
