Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

make playbook (tested for debians) compatible with the mode #539

Merged

Conversation

grzegorznowak
Copy link
Contributor

Hey guys,

it was impossible to run the --check mode on top of the role.
(Please refer to the Ansible docs for details at: https://docs.ansible.com/ansible/latest/user_guide/playbooks_checkmode.html)

The PR adds a micro tweak to properly register variables when in the check_mode.

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

Copy link
Contributor

@Crazybus Crazybus left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding this in :)

@Crazybus
Copy link
Contributor

jenkins test this please

@grzegorznowak
Copy link
Contributor Author

thanks @Crazybus , over the course of time I've found at least one more instance where the check mode was failing due to the same reason.
I think it would make no difference to any of the role's properties/working if we just added the same check_mode: no attribute to any instruction that registers a variable.
Let me know if you think that's not a good idea, otherwise I can issue PR that mass-changes that in one go throughout.

@Crazybus
Copy link
Contributor

I think it would make no difference to any of the role's properties/working if we just added the same check_mode: no attribute to any instruction that registers a variable. Let me know if you think that's not a good idea

It sounds sane to me as long as the shell command is not modifying state.

otherwise I can issue PR that mass-changes that in one go throughout.

Go for it! I'll review it extra carefully :)

@grzegorznowak
Copy link
Contributor Author

ok that is now done in #542 @Crazybus .
Not too much of what could be added, and as per my comment in that PR, I think for this role to be up to the current devops expectations, it has to get rid of all the registers anyway.
From what I remember, there are some easy ones that can be redone into notify handlers. And the rest probably could use a custom module or other means if necessary.

@grzegorznowak grzegorznowak deleted the compatibility-with-check-mode branch March 14, 2019 08:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants