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

Unixy stdout callback: Display name of play and list of play hosts #32810

Merged
merged 1 commit into from
Feb 25, 2019

Conversation

theJohnnyBrown
Copy link
Contributor

Don't display play name if no hosts in play

SUMMARY

Adds some logic to the unixy callback plugin's v2_playbook_on_play_start method to display the list of play hosts along with the play name, only when there are hosts in the play

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

lib/ansible/plugins/callback/unixy.py

ANSIBLE VERSION
ansible 2.5.0 (unixy-playname 1a2e619730) last updated 2017/11/10 16:02:40 (GMT -500)
  config file = /home/jb/src/ansible/ansible.cfg
  configured module search path = [u'/home/jb/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/jb/src/ansible/lib/ansible
  executable location = /home/jb/src/ansible/bin/ansible
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
ADDITIONAL INFORMATION

The suggestion was "don't display play name if no hosts in play", which I took to mean the hosts variable in the play definition. We could possibly use the computed list of hosts (PlaybookExecutor._get_serialized_batches) in this logic but it would require changing the method signature (optional arg?) of v2_playbook_on_play_start

### Before ###
- myplay -
Gathering Facts...
  localhost ok
say hello...
  localhost done | stdout: hello

- Play recap -
  localhost                  : ok=2    changed=1    unreachable=0    failed=0

### After ###
- myplay on hosts: all -
Gathering Facts...
  localhost ok
say hello...
  localhost done | stdout: hello

- Play recap -
  localhost                  : ok=2    changed=1    unreachable=0    failed=0

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 feature_pull_request needs_triage Needs a first human triage before being processed. plugins/callback support:core This issue/PR relates to code supported by the Ansible Engineering Team. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 10, 2017
@bcoca
Copy link
Member

bcoca commented Nov 11, 2017

cc @akatch

@bcoca bcoca added support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. needs_triage Needs a first human triage before being processed. labels Nov 11, 2017
@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed support:community This issue/PR relates to code supported by the Ansible community. labels Nov 11, 2017
@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Nov 19, 2017
@ansibot ansibot added the new_contributor This PR is the first contribution by a new community member. label Feb 6, 2018
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 2, 2018
@theJohnnyBrown
Copy link
Contributor Author

Gonna close this if there's no interest

@akatch
Copy link
Contributor

akatch commented Jul 3, 2018

Wow, I'm so sorry I missed this. I'm testing this now. Thank you for working on it.

@akatch
Copy link
Contributor

akatch commented Jul 3, 2018

:shipit: This looks great, thanks again @theJohnnyBrown.

@ansibot ansibot added the community_review In order to be merged, this PR must follow the community review workflow. label Oct 25, 2018
@theJohnnyBrown
Copy link
Contributor Author

Anybody want to merge this? The completionist in me wants to get it off my PR list

@akatch
Copy link
Contributor

akatch commented Feb 12, 2019

cc @bcoca @nitzmahone ?

Copy link
Contributor

@jamescassell jamescassell left a comment

Choose a reason for hiding this comment

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

LGTM

@bcoca
Copy link
Member

bcoca commented Feb 25, 2019

@akatch just needs a 'shipit' from you, no need to wait for core to merge

@bcoca bcoca merged commit 681082e into ansible:devel Feb 25, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. new_contributor This PR is the first contribution by a new community member. plugins/callback small_patch stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants