37 Commits

Author SHA1 Message Date
Chris Meyers
dbdbc7635a Redirect user to platform supported collection
* AAP 2.5 Controller 4.6 Org, User, and Team endpoints are restricted.
  When the user performs a restricted operation via the Controller
  collection, kindly notify them that they should be using the platform
  collection instead.
2024-10-17 11:02:19 -04:00
Harshith u
776b661fb3
use optional api prefix in collection if set as environ vairable (#15205)
* use optional api prefix if set as environ variable

* Different default depending on collection type
2024-05-29 11:54:05 -04:00
Seth Foster
0d4f653794
Fix up ansible-test sanity checks due to ansible 2.17 release (#15208)
* Fix up ansible sanity checks

* Fix awx-collection test failure

* Add ignore for ansible-test 2.17 

---------

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
Co-authored-by: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com>
2024-05-21 15:05:59 -04:00
Seth Foster
4754819a09
awx modules wait on event processing finished (#15152)
This change makes "wait: true" for jobs and syncs
look at the event_processing_finished instead of
finished field.

Right now there is a race condition where
a module might try to delete an inventory, but the events
for an inventory sync have not yet finished. We have a
RelatedJobsPreventDeleteMixin that checks for this condition.

bulk jobs don't have event_processing_finished so we just
use finished field in that case.
2024-04-26 17:33:34 -04:00
Seth Foster
3bb559dd09 AWX Collections for DAB RBAC
Adds new modules for CRUD operations on the
following endpoints:

- api/v2/role_definitions
- api/v2/role_user_assignments
- api/v2/role_team_assignments

Note: assignment is Create or Delete only

Additional changes:
- Currently DAB endpoints do not have "type"
field on the resource list items. So this modifies
the create_or_update_if_needed to allow manually
specifying item type.

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
2024-04-11 14:59:09 -04:00
Seth Foster
69102cf265 Remove receptor_address module from collection
After removing CRUD from receptor addresses, we need
to remove the module.

- remove receptor_address module
- Add listener_port to instance module
- Add peers_from_control_nodes to instance module

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
2024-02-02 10:37:41 -05:00
Seth Foster
04cbbbccfa Update awx_collection to support ReceptorAddress
- Add receptor_address module which allows
users to create addresses for instances

- Update awx_collection functional and integration
tests to support new peering design

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
2024-02-02 10:37:41 -05:00
Alan Rominger
b6b167627c
Fix Boolean values defaulting to False in collection (#14493)
* Fix Boolean values defaulting to False in collection

* Remove null values in other cases, fix null handling for WFJT nodes

* Only remove null values if it is a boolean field

* Reset changes to WFJT node field processing

* Use test content from sean-m-sullivan to fix lookups in assert
2023-10-24 14:29:16 -04:00
Sean Sullivan
abc56305cc
Add Request time out option for collection (#14157)
Co-authored-by: Jessica Steurer <70719005+jay-steurer@users.noreply.github.com>
2023-08-03 15:06:04 -03:00
John Westcott IV
5a63533967
Added support to collection for named urls (#14205) 2023-07-27 10:22:41 -03:00
Christian Adams
b549ae1efa
Only show the product version header when the requester is authenticated (#14135) 2023-07-26 18:38:05 -04:00
John Westcott IV
8ddc19a927
Changing how associations work in awx collection (#13626)
Co-authored-by: Alan Rominger <arominge@redhat.com>
Co-authored-by: Jessica Steurer <70719005+jay-steurer@users.noreply.github.com>
2023-07-17 14:16:55 -03:00
Baptiste Agasse
8957a84738
Related #13336 - DNS resolution is preventing awx_collection to work with http[s]_proxy (#13524)
Co-authored-by: Seth Foster <fosterseth@users.noreply.github.com>
2023-05-24 20:00:07 +00:00
John Westcott IV
7f020052db
Make state exists universal in collection (#13890)
Make state: exists available for all API modules

Make state:exists return the ID just like it would if it created the resource
2023-05-10 09:05:29 -03:00
sean-m-sullivan
0fb334e372 collection, allow roles to be added to multiple teams and users 2023-05-02 07:34:38 -04:00
Alan Rominger
ac8cff75ce
Run collection sanity tests in CI (#13356)
* Run collection sanity tests in CI

This requires adding a Makefile install of ansible-core

Fake the version to make semver check happy

* Fixes from ansible-test sanity failures

* Exclude the export module due to awxkit requirement

* Fix broken ansible-test rule exceptions

remove Ansible 2.14 exclusions that make ansible-test ERROR, saying they are not needed
2022-12-20 16:06:25 -05:00
Rick Elrod
7d645c8ff6 [collection] Add 'instance' module
Signed-off-by: Rick Elrod <rick@elrod.me>
2022-09-23 09:46:16 -04:00
Yuki Yamashita
dba33f9ef5
Replace gethostbyname to getaddrinfo for plugins ipv6 support related #11450 (#12561)
Co-authored-by: yukiy <yyamashi@redhat.com>
2022-08-22 11:07:10 -03:00
sean-m-sullivan
df649e2c56 update awx collection wait interval to 2 2022-05-18 09:57:40 -04:00
Shane McDonald
bd5c304a50 Make our collection work with prefixed API endpoints
I caught this when trying to add test coverage for https://github.com/ansible/awx/pull/11342
2022-03-08 12:05:50 -05:00
Nico Ohnezat
815ef4c9c9 related #11229 consider previous set json_output changed in
controller_api

job_template module sets self.json_output['changed'] to true before calling create_or_update_if_needed.

Signed-off-by: Nico Ohnezat <nico@no-12.net>
2021-10-08 23:59:12 +02:00
sean-m-ssullivan
5b28e7b397 simplify module utils files 2021-09-28 11:43:28 -04:00
sean-m-ssullivan
dd4943310d simplify module utils files 2021-09-27 19:35:22 -04:00
beeankha
9b66bda8b9 Fix pep8 error 2021-09-10 09:20:44 -04:00
John Westcott IV
515c3450c2 Fixing linting issue 2021-09-10 08:46:41 -04:00
John Westcott IV
5607c350cd Removing parens 2021-09-10 08:46:41 -04:00
John Westcott IV
aad432aaa3 Changing to Version instead of Type 2021-09-10 08:46:41 -04:00
John Westcott IV
d4971eb7b7 Preventing error if we were unable to get an API version 2021-09-10 08:46:41 -04:00
beeankha
bc365e2d01 Point to the correct name for AAP within collections 2021-08-06 10:13:06 -04:00
Seth Foster
5da02690c1
Fix copy_from warning message
- warn() does not take keyword 'msg'
- add testing around the copy_from parameter for project creation
2021-06-26 01:28:02 -04:00
sean-m-ssullivan
214c27a5cf add job data to filed wait jobs 2021-06-11 09:45:28 -04:00
Seth Foster
4bd910493a
sanity tests 2021-06-08 14:33:28 -04:00
Sarabraj Singh
25ca8d22d6
added collection name to module.deprecate() calls; fixed pep8 linting issues 2021-06-08 14:33:27 -04:00
Seth Foster
39b26c8f0e
Added env variable CONTROLLER_HOST, et al. Add awx.awx namespace to the runtime.yml redirects, and added templating task to change to ansible.controller 2021-06-08 14:33:24 -04:00
Seth Foster
82c5803e59
mostly includes renaming non-syntax references to tower 2021-06-08 14:33:24 -04:00
Seth Foster
7a63785255
more rename, mostly in test 2021-06-08 14:33:23 -04:00
Seth Foster
44fed1d7c1
pycharm refactor rename files and class, linux rename tower_ controller_ 2021-06-08 14:33:22 -04:00