CASMTRIAGE-7301: Ansible play to create iscsi-sbps-targets should not… #305
+13
−3
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.
Summary and Scope
One of the tasks of role csm.sbps.dns_srv_records was failing when running in CFS environment when compared to running with standard ansible-playbook command. This was due to the reason of "delegate_to: localhost" where the tasks were delegated to run inside the CFS k8s job (in non CFS case "delegate_to: localhost" would be the master node where plays are getting executed) and failing with kubectl command not found error. Two specific tasks under this role are supposed to be run either on master node or on one of the worker nodes instead of running locally inside the CFS k8s job.
Fixed these two specific tasks to run on the 1st worker from the host inventory group (Management_Worker) and that is the best fix is what I see as we can't run these tasks on master node (original intention) in CFS environment with current _delegate_to: "{{ play_hosts | first }}"_fix when inventory is "Management_Worker". Here it will now update the file "/tmp/hsn_nmn_info.txt" on the first worker as well as invoke creation of the DNS SRV and S records on the same worker referring to "/tmp/hsn_nmn_info.txt" that should solve the purpose.
Issues and Related PRs
List and characterize relationship to Jira/Github issues and other pull requests. Be sure to list dependencies.
<insert branch name here>
<insert PR URL here>
Testing
Tested on bare metal systems: starlord and surtur
Tested on:
Tested on bare metal systems: starlord and surtur
Test description:
Verified the fix by running the ansible plays with CFS session/ config. Observed that all the tasks have been completed
successfully in CFS environment without any fail and also the DNS SRV and A records are created (tasks where the fix is actually applied).
...
_PLAY RECAP *********************************************************************
x3000c0s11b0n0 : ok=10 changed=5 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
x3000c0s26b0n0 : ok=9 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
x3000c0s7b0n0 : ok=9 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
x3000c0s9b0n0 : ok=9 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
All playbooks completed successfully_
Risks and Mitigations
None
Pull Request Checklist