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

Add unixy support for check_mode_markers #7179

Merged

Conversation

akatch
Copy link
Contributor

@akatch akatch commented Aug 30, 2023

SUMMARY

Modifies output on playbook start, task start, and handler start when playbook runs in check mode.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

unixy.py

ADDITIONAL INFORMATION
### Before (or with check_mode_markers = false)
Executing playbook test.yml

- localhost on hosts: localhost -
Gathering Facts...
  localhost ok
debug...
  localhost ok: {
    "ansible_default_ipv4": {
        "address": "192.168.1.113",
        "alias": "enp4s0",
        "broadcast": "192.168.1.255",
        "gateway": "192.168.0.1",
        "interface": "enp4s0",
        "macaddress": "d8:bb:c1:dc:29:c7",
        "mtu": 1500,
        "netmask": "255.255.254.0",
        "network": "192.168.0.0",
        "prefix": "23",
        "type": "ether"
    },
    "changed": false
}
dnf...
  localhost failed | msg: Failed to install some of the specified packages
wait_for...
command...
command...

- ganymede on hosts: ganymede -
ERROR! Attempting to decrypt but no vault secrets found

### After (with check_mode_markers = true)
Executing playbook test.yml in check mode

- localhost (in check mode) on hosts: localhost -
Gathering Facts (check mode)...
  localhost ok
debug (check mode)...
  localhost ok: {
    "ansible_default_ipv4": {
        "address": "192.168.1.113",
        "alias": "enp4s0",
        "broadcast": "192.168.1.255",
        "gateway": "192.168.0.1",
        "interface": "enp4s0",
        "macaddress": "d8:bb:c1:dc:29:c7",
        "mtu": 1500,
        "netmask": "255.255.254.0",
        "network": "192.168.0.0",
        "prefix": "23",
        "type": "ether"
    },
    "changed": false
}
dnf (check mode)...
  localhost failed | msg: Failed to install some of the specified packages
wait_for (check mode)...
command (check mode)...
command (check mode)...

- ganymede (in check mode) on hosts: ganymede -
ERROR! Attempting to decrypt but no vault secrets found

Modifies output on playbook start, task start, and handler start when
playbook runs in check mode.
@ansibullbot ansibullbot added WIP Work in progress callback callback plugin feature This issue/PR relates to a feature request new_contributor Help guide this first time contributor plugins plugin (any type) labels Aug 30, 2023
@akatch akatch marked this pull request as ready for review August 30, 2023 23:44
@ansibullbot ansibullbot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed WIP Work in progress labels Aug 30, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-7 labels Aug 31, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

You might also want to update v2_playbook_on_play_start, the default callback also adds markers in there (using play.check_mode). (Whether it makes sense for this plugin I cannot say, I've never used it.)

@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Aug 31, 2023
@akatch
Copy link
Contributor Author

akatch commented Aug 31, 2023

Thanks for the suggestions and for taking the time to review my PR. I'll push up another commit with these changes later today.

@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Aug 31, 2023
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Sep 1, 2023
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@felixfontein felixfontein merged commit 631d215 into ansible-collections:main Sep 3, 2023
@patchback
Copy link

patchback bot commented Sep 3, 2023

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/631d215fe8b2a853d9440b15d8f8d9906fb049f0/pr-7179

Backported as #7201

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Sep 3, 2023
patchback bot pushed a commit that referenced this pull request Sep 3, 2023
* Add unixy support for check_mode_markers

Modifies output on playbook start, task start, and handler start when
playbook runs in check mode.

* changelog fragment

* Address feedback

* Oops

(cherry picked from commit 631d215)
@felixfontein
Copy link
Collaborator

@akatch thanks again for your contribution!

felixfontein pushed a commit that referenced this pull request Sep 3, 2023
…de_markers (#7201)

Add unixy support for check_mode_markers (#7179)

* Add unixy support for check_mode_markers

Modifies output on playbook start, task start, and handler start when
playbook runs in check mode.

* changelog fragment

* Address feedback

* Oops

(cherry picked from commit 631d215)

Co-authored-by: akatch <akatch@users.noreply.github.com>
etrombly pushed a commit to etrombly/community.general that referenced this pull request Oct 25, 2023
* Add unixy support for check_mode_markers

Modifies output on playbook start, task start, and handler start when
playbook runs in check mode.

* changelog fragment

* Address feedback

* Oops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callback callback plugin feature This issue/PR relates to a feature request new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants