AnsibleDscModuleGenerator icon indicating copy to clipboard operation
AnsibleDscModuleGenerator copied to clipboard

Implement reusable descriptions of modules

Open it-praktyk opened this issue 8 years ago • 5 comments

The parts of descriptions for known modules (e.g. published in DSC Resource Kit) can be fullfiled from previously prepared data files what can be part of module.

    $MetaString =  @'
module: <TARGETMODULENAME>
version_added: <ANSIBLEVERSIONADDED>
short_description: <SHORTDESCRIPTION>
description:
     - <LONGDESCRIPTION>
options:
'@

What do you think?

it-praktyk avatar Sep 11 '16 20:09 it-praktyk

Hm, not sure I understand. What do you propose?

trondhindenes avatar Oct 06 '16 21:10 trondhindenes

The amount of DSC resources is limited. For known resources the module AnsibleDscModuleGenerator can contains e.g. psd1 files - (considered can be also other formats https://ramblingcookiemonster.github.io/PowerShell-Configuration-Data/ ) containing data to fullfil informaiton for Ansible modules. I'll try prepare proposed implementation soon.

it-praktyk avatar Oct 07 '16 10:10 it-praktyk

Great, thanks. Still not sure what exactly you mean, but always open for suggestions!

trondhindenes avatar Oct 07 '16 12:10 trondhindenes

Example of descriptions can be stored with names like DSCModuleName

Name1, Name2 they are DSCResourceNames

{

    Name1: {
        "AnsibleVersion":"1.0.0",
        "ShortDescription":"This is short description used for that DSCResourceName in Ansible module",
        "LongDescription":"This is long description used for thatDSCResourceName in Ansible module"
    },

    Name2: {
        "AnsibleVersion":"1.0.0",
        "ShortDescription":"This is short description used for that DSCResourceName in Ansible module",
        "LongDescription":"This is long description used for thatDSCResourceName in Ansible module"
    }

}

Data stored in the file can be read

PS > ConvertFrom-Json -InputObject (Get-Content -Path DSCModuleName.json -Raw ) | select -ExpandProperty name1 | fl

AnsibleVersion   : 1.0.0
ShortDescription : This is short description used for that DSCResourceName in Ansible module
LongDescription  : This is long description used for thatDSCResourceName in Ansible module

Files with descriptions can be part of your module.

it-praktyk avatar Nov 06 '16 23:11 it-praktyk

Please check my fork.

In the next step I'll implement the rest of code marked now as ParameterSetName= "DescByParameters".

Do you use any automat to prepare values to HelpObject ?

it-praktyk avatar Nov 06 '16 23:11 it-praktyk