Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document common return values with examples #71046

Merged
merged 4 commits into from Aug 3, 2020
Merged

Document common return values with examples #71046

merged 4 commits into from Aug 3, 2020

Conversation

trydydd
Copy link
Contributor

@trydydd trydydd commented Aug 2, 2020

SUMMARY

Related Issue: #65062

Change:

ISSUE TYPE
  • Docs Pull Request

Resolves #65062

@trydydd trydydd changed the title adding return value examples Document common return values with examples Aug 2, 2020
@ansibot
Copy link
Contributor

ansibot commented Aug 2, 2020

The test ansible-test sanity --test docs-build [explain] failed with 13 errors:

docs/docsite/rst/index.rst:23:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:32:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:39:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:59:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:67:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:100:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:108:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:116:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:227:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:237:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:247:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:259:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.
docs/docsite/rst/index.rst:269:0: literal-block-lex-error: Could not lex literal_block as "JSON". Highlighting skipped.

click here for bot help

@ansibot ansibot added affects_2.11 docs This issue/PR relates to or includes documentation. has_issue needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 2, 2020
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Aug 2, 2020
Comment on lines 235 to 236


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra lines

Comment on lines 257 to 258


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra lines

stdout_lines
````````````
When `stdout` is returned, Ansible always provides a list of strings, each containing one item per line from the original output.



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Extra Lines

Comment on lines 138 to 164
"attributes": null,
"backrefs": false,
"backup": true,
"content": null,
"create": false,
"delimiter": null,
"directory_mode": null,
"firstmatch": false,
"follow": false,
"force": null,
"group": null,
"insertafter": null,
"insertbefore": null,
"line": "foo",
"mode": null,
"owner": null,
"path": "foo.txt",
"regexp": null,
"remote_src": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": null,
"state": "present",
"unsafe_writes": null,
"validate": null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to add a shorter invocation example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback!

Copy link
Contributor

@acozine acozine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you @terciero for putting these together! I found one small thing to change - if you can update the PR I will merge it. Ping me on the ansible-docs channel of freenode IRC with any questions. Thanks again!

"after_header": "foo.txt (file attributes)",
"before_header": "foo.txt (file attributes)"
}

Information on differences between the previous and current state. Often a dictionary with entries ``before`` and ``after``, which will then be formatted by the callback plugin to a diff view.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put this sentence above the sample codeblock, so all the entries follow the same pattern (Title, description, example).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @acozine!

@acozine acozine removed the needs_triage Needs a first human triage before being processed. label Aug 3, 2020
@acozine
Copy link
Contributor

acozine commented Aug 3, 2020

Thanks @terciero for the PR and @imjoseangel for the review!

@acozine acozine merged commit 864573a into ansible:devel Aug 3, 2020
samccann pushed a commit to samccann/ansible that referenced this pull request Aug 6, 2020
* adding return value examples
* shift to console code blocks
* cleaning up whitespace and shortening invocation example
* reordering diff section

(cherry picked from commit 864573a)
acozine added a commit that referenced this pull request Aug 7, 2020
* Misc typo fixes (#71089)

(cherry picked from commit 504ef60)

* Add some documentation for the format of meta/runtime.yml (#71035)

* Document the format of meta/runtime.yml

* Document multiple Ansible versions

Clarify difference between deprecation and tombstone fields

* add note

(cherry picked from commit a9eb8b0)

* add note to uninstall older versions of ansible for pip (#71023)

* add note to uninstall older versions of ansible for pip

* combine with the other PR

(cherry picked from commit 72d3d44)

* VMware: Inventory scenario guide for hostnames (#71055)

Added a scenario guide for ``hostnames`` parameter
for vmware_vm_inventory.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 0055673)

* Document string tests a bit more (#71049)

- Explain how `regex` differs from `match` and `search`.
- Document `multiline` and `ignorecase`.

Signed-off-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit 701c638)

* docs: Add a note about package requirements for fact gathering (#70796)

Fixes: #26148

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit a6725d6)

* added note about fakeroot (#71018)

see #70895

(cherry picked from commit 11a31e9)

* Update documentation of httpapi's handle_httperror method for clarity (#70991)

(cherry picked from commit a0523e5)

* DOCS: add 2.10 collections roadmap (#70975)

* draft of 2.10 collections roadmap

* incorporates feedback from felixfontein

* gundalow and samccann feedback, fix link

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
(cherry picked from commit 9879da8)

* updates changelog types; some updates for easier translation (#71027)

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4f4436c)

* Document common return values with examples (#71046)

* adding return value examples
* shift to console code blocks
* cleaning up whitespace and shortening invocation example
* reordering diff section

(cherry picked from commit 864573a)

* Update intro_getting_started.rst (#71039)

Added two additional learning resources in the See also: section- forgot closing backticks

(cherry picked from commit 9850915)

* Guide users to use ansible-runner (#71063)

Update the docs to guide users to use `ansible-runner` instead of using Python API directly. In many use cases, executing Ansible playbooks are sufficient. In those use cases, `ansible-runner` is easier and much stable to use comparing with Python API, but there is no mention of it.

(cherry picked from commit 0c855dc)

* Porting guides for ansible-base 2.10 and ansible 2.10 (#70891)

* Fix changelog link title.

* Rename Ansible 2.10 and 2.11 porting guides to Ansible-base porting guides.

* Add stub for automatically generated 2.10 porting guide.

* Move things that should not be in the ansible-base porting guide to the ansible porting guide.

* Apply changes to base porting guides.

* Add remark that ansible-base is mainly for developers.

* Ansible Base -> Ansible-base

* Fix link in base porting guide.

* Add generated porting guide.

* Use same header signs as antsibull-changelog's RST builder.

* Update generated porting guide.

(cherry picked from commit 61b36c6)

* Update network platform guides with FQCN (#70699)

* fqcn all the docs things!

(cherry picked from commit 54bee71)

* Document how to upgrade to ansible with pip (#70768)

Fixes #70348

(cherry picked from commit 5019335)

* document how to migrate between collections (#70243)

* document how to migrate between collections
* Apply suggestions from code review

Co-authored-by: John R Barker <john@johnrbarker.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 58145df)

* remove github link from plugins (#70951)

(cherry picked from commit e28b20d)

* Add latest rc from ansible-base (#70974)

* Add latest rc from ansible-base

(cherry picked from commit d62dffa)

* Document to_json will convert to ASCII strings by default (#70954)

... as reported in issue #68702

(cherry picked from commit 8c48366)

* Update the porting guide for ansible-2.10.0a8 (#71141)

(cherry picked from commit 0a9638c)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <shertel@redhat.com>
Co-authored-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Nathaniel Case <ncase@redhat.com>
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-authored-by: Terciero <terciero@users.noreply.github.com>
Co-authored-by: Brendon O'Sullivan <49501251+bjosullivan@users.noreply.github.com>
Co-authored-by: EthanHur <ethan0311@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
zoredache pushed a commit to zoredache/ansible that referenced this pull request Aug 10, 2020
* adding return value examples
* shift to console code blocks
* cleaning up whitespace and shortening invocation example
* reordering diff section
@ansible ansible locked and limited conversation to collaborators Aug 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.11 core_review In order to be merged, this PR must follow the core review workflow. docs This issue/PR relates to or includes documentation. has_issue new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Add examples to common return values page
4 participants