Repository navigation
Fix ATTACK_RANGE_LOCAL_ROLES: stage local roles by copying instead of ansible-galaxy - #1456
Open
stacypurcell-collab wants to merge 2 commits into
Open
stacypurcell-collab wants to merge 2 commits into
stacypurcell-collab wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1455
ansible-galaxy install "," can't install from a local directory, so every local role override failed. For local overrides, this calls the existing _stage_role_copy() instead. It validates the role and copies it into terraform/ansible/roles/, replacing any existing copy. Galaxy installs for roles without an override are unchanged.
Tested: a full splunk_ad_gcp build on GCP with three local role overrides. Each role logs "Staged local role", and the build completes with failed=0.
Updated tests/test_ansible_manager_local_roles.py: the local-override test now checks that the role is copied and ansible-galaxy isn't called, and I added tests for replacing a stale copy and rejecting an invalid role. All 13 tests pass. The two main tests fail on the old code.