-
Notifications
You must be signed in to change notification settings - Fork 34
[AAP-91390] Add inventory, host, inventory_source, inventory_source_update, schedule, job_launch modules #248
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
Open
jessicamack
wants to merge
9
commits into
ansible:devel
Choose a base branch
from
jessicamack:migration-batch-1
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7dc8e65
Add inventory module migrated from awx.awx/ansible.controller (AAP-91…
jessicamack 30e8475
Add host module migrated from awx.awx/ansible.controller (AAP-91390)
jessicamack 6abfd40
Add inventory_source module migrated from awx.awx/ansible.controller …
jessicamack 1a56b2b
Add inventory_source_update module migrated from awx.awx/ansible.cont…
jessicamack 18e02f1
Add schedule module migrated from awx.awx/ansible.controller (AAP-91390)
jessicamack a4da28b
Add job_launch module migrated from awx.awx/ansible.controller (AAP-9…
jessicamack 18f4439
Fix ansible-lint failure: exclude new scenarios' inventory.yml files
jessicamack e58ad8b
Address pr-review skill findings: test and document the new SDK methods
jessicamack 5688898
Address CodeRabbit review: association safety, check_mode, FK lookup …
jessicamack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| minor_changes: | ||
| - host - add module migrated from awx.awx/ansible.controller | ||
| (https://issues.redhat.com/browse/AAP-91390). | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| minor_changes: | ||
| - inventory - add module migrated from awx.awx/ansible.controller, including copy_from, | ||
| instance_groups/input_inventories associations, and constructed inventory support | ||
| (https://issues.redhat.com/browse/AAP-91390). |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| minor_changes: | ||
| - inventory_source - add module migrated from awx.awx/ansible.controller, including | ||
| notification_templates_started/success/error associations | ||
| (https://issues.redhat.com/browse/AAP-91390). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Add the required YAML document end markers. YAMLlint reports
🧰 Tools🪛 YAMLlint (1.37.1)[error] 4-4: missing document end "..." (document-end) 📍 Affects 3 files
🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
10 changes: 10 additions & 0 deletions
10
changelogs/fragments/aap_91390_inventory_source_update.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| minor_changes: | ||
| - inventory_source_update - add module migrated from awx.awx/ansible.controller | ||
| to launch an inventory source update (sync) | ||
| (https://issues.redhat.com/browse/AAP-91390). | ||
| bugfixes: | ||
| - Fix the SDK layer's shared operation executor to actually call the API for | ||
| an endpoint operation intentionally declared with no request-body fields | ||
| (a launch-trigger sub-action), and to resolve any custom path parameter | ||
| name declared on an EndpointOperation instead of only ever substituting | ||
| a param literally named C(id). |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| minor_changes: | ||
| - job_launch - add module migrated from awx.awx/ansible.controller to launch | ||
| an Ansible job template (https://issues.redhat.com/browse/AAP-91390). | ||
| bugfixes: | ||
| - Fix the SDK layer's shared operation executor to still call the API for a | ||
| primary create/launch operation when all of its optional body fields | ||
| happen to be unset (e.g. job_launch with no prompt overrides) — it was | ||
| only correctly distinguishing this from an unused optional secondary | ||
| endpoint (like an association or sub-resource) in one of the two | ||
| connection-mode implementations. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| minor_changes: | ||
| - schedule - add module migrated from awx.awx/ansible.controller, including | ||
| credentials/labels/instance_groups associations | ||
| (https://issues.redhat.com/browse/AAP-91390). |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| --- | ||
| # Cleanup: delete hosts/inventories/organizations created by converge. | ||
| - name: Cleanup — delete host, inventory, organization (mock, connection local) | ||
| hosts: localhost | ||
| connection: local | ||
| gather_facts: false | ||
| vars: | ||
| gateway_hostname: "http://127.0.0.1:8000" | ||
| gateway_username: "mock" | ||
| gateway_password: "testpass" | ||
| gateway_validate_certs: false | ||
| molecule_org_name: "Molecule Test Org Host Local" | ||
| molecule_inv_name: "Molecule Test Inventory Host Local" | ||
| molecule_host_name: "molecule-host-local" | ||
| tasks: | ||
| - name: Delete host (connection local) | ||
| ansible.platform.host: | ||
| name: "{{ molecule_host_name }}" | ||
| inventory: "{{ molecule_inv_name }}" | ||
| state: absent | ||
| register: delete_result_local | ||
| failed_when: false | ||
| vars: | ||
| ansible_connection: local | ||
|
|
||
| - name: Assert host removed or already absent (connection local) | ||
| ansible.builtin.assert: | ||
| that: delete_result_local is not failed | ||
| fail_msg: "Cleanup: failed to delete host {{ molecule_host_name }}." | ||
| vars: | ||
| ansible_connection: local | ||
|
|
||
| - name: Delete inventory (connection local) | ||
| ansible.platform.inventory: | ||
| name: "{{ molecule_inv_name }}" | ||
| organization: "{{ molecule_org_name }}" | ||
| state: absent | ||
| failed_when: false | ||
| vars: | ||
| ansible_connection: local | ||
|
|
||
| - name: Delete organization (connection local) | ||
| ansible.platform.organization: | ||
| name: "{{ molecule_org_name }}" | ||
| state: absent | ||
| failed_when: false | ||
| vars: | ||
| ansible_connection: local | ||
|
|
||
| - name: Remove manager survive flag (signals manager to shut down) | ||
| ansible.builtin.file: | ||
| path: /tmp/ap/.survive | ||
| state: absent | ||
| vars: | ||
| ansible_connection: local | ||
|
|
||
| - name: Cleanup — delete host, inventory, organization (mock, http direct) | ||
| hosts: localhost | ||
| connection: ansible.platform.http | ||
| gather_facts: false | ||
| vars: | ||
| gateway_hostname: "http://127.0.0.1:8000" | ||
| gateway_username: "mock" | ||
| gateway_password: "testpass" | ||
| gateway_validate_certs: false | ||
| ansible_platform_use_persistent_connection: false | ||
| molecule_org_name: "Molecule Test Org Host HTTP Direct" | ||
| molecule_inv_name: "Molecule Test Inventory Host HTTP Direct" | ||
| molecule_host_name: "molecule-host-http-direct" | ||
| tasks: | ||
| - name: Delete host (http direct) | ||
| ansible.platform.host: | ||
| name: "{{ molecule_host_name }}" | ||
| inventory: "{{ molecule_inv_name }}" | ||
| state: absent | ||
| register: delete_result_http_direct | ||
| failed_when: false | ||
|
|
||
| - name: Assert host removed or already absent (http direct) | ||
| ansible.builtin.assert: | ||
| that: delete_result_http_direct is not failed | ||
| fail_msg: "Cleanup: failed to delete host {{ molecule_host_name }}." | ||
|
|
||
| - name: Delete inventory (http direct) | ||
| ansible.platform.inventory: | ||
| name: "{{ molecule_inv_name }}" | ||
| organization: "{{ molecule_org_name }}" | ||
| state: absent | ||
| failed_when: false | ||
|
|
||
| - name: Delete organization (http direct) | ||
| ansible.platform.organization: | ||
| name: "{{ molecule_org_name }}" | ||
| state: absent | ||
| failed_when: false | ||
|
|
||
| - name: Remove manager survive flag (signals manager to shut down) | ||
| ansible.builtin.file: | ||
| path: /tmp/ap/.survive | ||
| state: absent | ||
| vars: | ||
| ansible_connection: local | ||
|
|
||
| - name: Cleanup — delete host, inventory, organization (mock, http persistent) | ||
| hosts: localhost | ||
| connection: ansible.platform.http | ||
| gather_facts: false | ||
| vars: | ||
| gateway_hostname: "http://127.0.0.1:8000" | ||
| gateway_username: "mock" | ||
| gateway_password: "testpass" | ||
| gateway_validate_certs: false | ||
| ansible_platform_use_persistent_connection: true | ||
| molecule_org_name: "Molecule Test Org Host HTTP Persistent" | ||
| molecule_inv_name: "Molecule Test Inventory Host HTTP Persistent" | ||
| molecule_host_name: "molecule-host-http-persistent" | ||
| tasks: | ||
| - name: Delete host (http persistent) | ||
| ansible.platform.host: | ||
| name: "{{ molecule_host_name }}" | ||
| inventory: "{{ molecule_inv_name }}" | ||
| state: absent | ||
| register: delete_result_http_persistent | ||
| failed_when: false | ||
|
|
||
| - name: Assert host removed or already absent (http persistent) | ||
| ansible.builtin.assert: | ||
| that: delete_result_http_persistent is not failed | ||
| fail_msg: "Cleanup: failed to delete host {{ molecule_host_name }}." | ||
|
|
||
| - name: Delete inventory (http persistent) | ||
| ansible.platform.inventory: | ||
| name: "{{ molecule_inv_name }}" | ||
| organization: "{{ molecule_org_name }}" | ||
| state: absent | ||
| failed_when: false | ||
|
|
||
| - name: Delete organization (http persistent) | ||
| ansible.platform.organization: | ||
| name: "{{ molecule_org_name }}" | ||
| state: absent | ||
| failed_when: false | ||
|
|
||
| - name: Remove manager survive flag (signals manager to shut down) | ||
| ansible.builtin.file: | ||
| path: /tmp/ap/.survive | ||
| state: absent | ||
| vars: | ||
| ansible_connection: local | ||
| ... |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add YAML document end markers.
changelogs/fragments/aap_91390_host.yml#L3-L3: add...after the fragment.changelogs/fragments/aap_91390_inventory.yml#L4-L4: add...after the fragment.YAMLlint reports
missing document end "..."for both files.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 3-3: missing document end "..."
(document-end)
📍 Affects 2 files
changelogs/fragments/aap_91390_host.yml#L3-L3(this comment)changelogs/fragments/aap_91390_inventory.yml#L4-L4🤖 Prompt for AI Agents
Source: Linters/SAST tools