-
Notifications
You must be signed in to change notification settings - Fork 313
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
Feature azure rm adapplication info diff #1560
base: dev
Are you sure you want to change the base?
Feature azure rm adapplication info diff #1560
Conversation
app_diff hinzugefügt
Finalizing modified: tests/integration/targets/azure_rm_adapplication/tasks/main.yml Add tests for app_diff
modify doc for sentry test
documentation modify examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheNotorioursRMM Please take a look, Small change request! Thanks!
|
||
- name: Assert the difference | ||
ansible.builtin.assert: | ||
that: diff_output.app_diff[0].app_display_name == "{{ display_name }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation: expected 6 but found 8
@@ -94,4 +104,4 @@ | |||
- name: Assert there is no application | |||
ansible.builtin.assert: | |||
that: | |||
- output.applications | length == 0 | |||
- output.applications | length == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line character at the end of file
@@ -149,7 +229,8 @@ def __init__(self): | |||
app_id=dict(type='str'), | |||
object_id=dict(type='str'), | |||
identifier_uri=dict(type='str'), | |||
app_display_name=dict(type='str') | |||
app_display_name=dict(type='str'), | |||
app_diff=dict(type='list', elements='dict') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If defined this way, it will be easier to understand!
app_diff=dict(type='list', elements='dict') | |
app_diff=dict(type='list', | |
elements='dict', | |
options=dict( | |
app_id=dict(type='str'), | |
app_display_name=dict(type='str') | |
) | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I have the configuration of my adapps in a YAML or JSON file, I don't want to edit it additionally. I want to provide it directly to the plugin, not just the "app_display_name" or the "app_id". However, if I provide this as an option, I have to filter the YAML or JSON for these two options, which means another Ansible task in the playbook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But your code only handles these two fields and no other fields?
if app.get("app_id") == diff.get("app_id") or app.get("app_display_name") == diff.get("app_display_name"): | ||
found = True | ||
break | ||
if not found: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a definition error? Add to 'app_diff' if it should be True! Thank you!
if not found: | |
if found: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that is correct. It compares the provided list with the production Azure data, and if something is not present in the production environment, the status "absent" is added. This way, you can immediately reuse the return to delete the adapps that do not belong in the production environment using "plugins/modules/azure_rm_adapplication.py".
This allows you to first add adapps with "plugins/modules/azure_rm_adapplication.py" and then use "plugins/modules/azure_rm_adapplication_info.py" (option diff) to identify the adapps that should not be in the live environment and subsequently delete them with "plugins/modules/azure_rm_adapplication.py".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, please fix the following error, and make a detailed definition of the parameter definition. Thank you!
kindly ping! |
….yml Fix: No new line character at the end of file
@TheNotoriousRMM Please help solve the conflicts I will review and push forward the merger as soon as possible. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small change request!
- name: get ad app diff ---- by display name | ||
azure_rm_adapplication_info: | ||
app_diff: | ||
- app_display_name: "{{ display_name }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation: expected 6 but found 8
azure_rm_adapplication_info: | ||
app_diff: | ||
- app_display_name: "{{ display_name }}" | ||
- app_id: "{{ app_id }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation: expected 6 but found 8
if app.get("app_id") == diff.get("app_id") or app.get("app_display_name") == diff.get("app_display_name"): | ||
found = True | ||
break | ||
if not found: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, please fix the following error, and make a detailed definition of the parameter definition. Thank you!
SUMMARY
azure_rm_adapplication_info add option "app_diff" #1559
ISSUE TYPE
COMPONENT NAME
azure_rm_adapplication_info.py
test targets > azure_rm_adapplication > tasks: main
ADDITIONAL INFORMATION