Hello,


I wrote a new module for AWS to gather codedeploy facts.  When I submitted 
the pull 
request, https://github.com/ansible/ansible-modules-extras/pull/1445, 
travis failed the build.  Below is the comment I added to the PR for why it 
is failing. I'm hoping that someone can help me write a correct RETURN 
documentation block for a module that returns different data depending on 
what facts you ask the module to get.  I'm guessing more eyes will see this 
than a pull request.


Thanks!


After a lot of digging, I see that ansible-validate-modules is complaining 
that there is no RETURN documentation block. This wasn't immediately 
obvious to a new module author. Especially when almost all the existing 
modules are missing it.

$ ../ansible/hacking/test-module -m cloud/amazon/codedeploy_facts.py -a 
"query=list_applications"* including generated source, if any, saving to: 
/home/czeeb/.ansible_module_generated* this may offset any line numbers in 
tracebacks/debuggers!***********************************
RAW OUTPUT
{"applications": ["TestApplication"], "changed": false, "ResponseMetadata": 
{"HTTPStatusCode": 200, "RequestId": "03717d2c-b0d5-11e5-b101-e1a0e3fb23ac"}}

***********************************
PARSED OUTPUT
{
    "ResponseMetadata": {
        "HTTPStatusCode": 200, 
        "RequestId": "03717d2c-b0d5-11e5-b101-e1a0e3fb23ac"
    }, 
    "applications": [
        "TestApplication"
    ], 
    "changed": false
}

$ ../ansible/hacking/test-module -m cloud/amazon/codedeploy_facts.py -a 
"query=list_deployments application_name=TestApplication 
deployment_group_name=Production"* including generated source, if any, saving 
to: /home/czeeb/.ansible_module_generated* this may offset any line numbers in 
tracebacks/debuggers!***********************************
RAW OUTPUT
{"changed": false, "ResponseMetadata": {"HTTPStatusCode": 200, "RequestId": 
"72531c13-b0d5-11e5-89e2-873c8c0b03be"}, "deployments": ["d-74Y1HLWZC", 
"d-L0MIOT00D", "d-UB2OEGXZC", "d-1BEUEMXZC", "d-UW5VQU00D", "d-CVWS8K10D", 
"d-UAO4EI60D", "d-Q6HMEI30D", "d-XWDF2AZZC", "d-C98D50XZC", "d-IY542U70D", 
"d-XC4GOZ20D"]}

***********************************
PARSED OUTPUT
{
    "ResponseMetadata": {
        "HTTPStatusCode": 200, 
        "RequestId": "72531c13-b0d5-11e5-89e2-873c8c0b03be"
    }, 
    "changed": false, 
    "deployments": [
        "d-74Y1HLWZC", 
        "d-L0MIOT00D", 
        "d-UB2OEGXZC", 
        "d-1BEUEMXZC", 
        "d-UW5VQU00D", 
        "d-CVWS8K10D", 
        "d-UAO4EI60D", 
        "d-Q6HMEI30D", 
        "d-XWDF2AZZC", 
        "d-C98D50XZC", 
        "d-IY542U70D", 
        "d-XC4GOZ20D"
    ]
}

Given the above example output for two of the query types for the 
codedeploy_facts module is the following a correct RETURN block? Each query 
type returns different output, which is the part I'm not too sure on how to 
put in the documentation. There aren't any other _facts modules that have a 
RETURN block that I can use as an example to work from.

applications:
  description: List of applications
  returned: success
  type: list
  sample:
    [
      "TestApplication",
      "AnotherTestApplication"
    ]
deployments:
  description: List of deployments
  returned: success
  type: list
  sample:
    [
      "d-74Y1HLWZC", 
      "d-XC4GOZ20D"
    ]

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d8b82296-2557-40a3-ad7f-26f62d2ec7ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to