trondhindenes / AnsibleDscModuleGenerator

Scripts for generating Ansible modules from PowerShell DSC resources
MIT License
31 stars 2 forks source link

Implement reusable descriptions of modules #7

Open it-praktyk opened 8 years ago

it-praktyk commented 8 years ago

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?

trondhindenes commented 8 years ago

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

it-praktyk commented 8 years ago

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.

trondhindenes commented 8 years ago

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

it-praktyk commented 8 years ago

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 commented 8 years ago

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 ?