Commit Graph
100 Commits
Author SHA1 Message Date
Jeff Bradberry 9ecceb4a1e Merge pull request #11639 from jbradberry/fix-updater-script
Deal properly with comments in requirements_git.txt
2022-01-30 10:16:22 -05:00
Jeff Bradberry c5c83a4240 Deal properly with comments in requirements_git.txt
The updater.sh script was expecting that _every_ line in this file was
a repo reference.
2022-01-28 17:30:42 -05:00
Jeff Bradberry 627bde9e9e Merge pull request #11614 from jbradberry/register_peers_warn_2cycles
Only do a warning on 2-cycles for the register_peers command
2022-01-27 10:25:19 -05:00
Jeff Bradberry fdbf3ed279 Only do a warning on 2-cycles for the register_peers command
It has no way of knowing whether a later command will fix the
situation, and this will come up in the installer.  Let's just trust
the pre-flight checks.
2022-01-26 11:50:57 -05:00
Jeff Bradberry 709c439afc Merge pull request #11591 from ansible/enable-hop-nodes-endpoints
Turn off the filtering of hop nodes from the Instance endpoints
2022-01-25 12:03:23 -05:00
Jeff Bradberry 7c550a76a5 Make sure to filter out control-plane nodes in inspect_execution_nodes
Also, make sure that the cluster host doesn't get marked as lost by
this machinery.
2022-01-25 11:06:20 -05:00
Jeff Bradberry fd9c28c960 Adjust register_queue command to not allow hop nodes to be added 2022-01-24 17:40:55 -05:00
Jeff Bradberry fa9ee96f7f Adjust the list_instances command to show hop nodes
with appropriate attributes removed or added.
2022-01-24 17:22:12 -05:00
Jeff Bradberry 334c33ca07 Handle receptorctl advertisements for hop nodes
counting it towards their heartbeat.  Also, leave off the link to the
health check endpoint from hop node Instances.
2022-01-24 16:51:45 -05:00
Jeff Bradberry 56f8f8d3f4 Turn off the filtering of hop nodes from the Instance endpoints
except for the health check.
2022-01-21 15:19:59 -05:00
Jeff Bradberry 6e030fd62f Merge pull request #11546 from jbradberry/remove-instance-activecount
Remove the Instance.objects.active_count() method
2022-01-14 16:46:01 -05:00
Jeff Bradberry bb14a95076 Remove the Instance.objects.active_count() method
Literally nothing uses it.  The similar Host.objects.active_count()
method seems to be what is actually important for licensing.
2022-01-14 16:21:41 -05:00
Jeff Bradberry b76029fac3 Merge pull request #11538 from jbradberry/fix-exact-removals-for-register-peers
Fix the logic for register_peers --exact
2022-01-14 09:42:51 -05:00
Jeff Bradberry ade00c70e5 Merge pull request #11537 from jbradberry/enhancements-for-meshviz-endpoint
Enhancements for meshviz endpoint
2022-01-13 16:42:21 -05:00
Jeff Bradberry 82dca5336d Fix the logic for register_peers --exact
- correctly calculate the extraneous peers
- allow --exact to take an empty set of arguments, to remove all peers
2022-01-13 15:41:45 -05:00
Jeff Bradberry 8c33d0ecbd Add the mesh_visualizer resource to awxkit 2022-01-13 15:01:54 -05:00
Jeff Bradberry dea5fd1a9d Fix a problem with IsSystemAdminOrAuditor for anonymous users
It was raising an error, but should really show the message about not
being authenticated.
2022-01-13 14:44:50 -05:00
Jeff Bradberry 6a131f70f0 Require System Admin or Auditor permissions to access the mesh visualizer 2022-01-13 14:13:17 -05:00
Jeff Bradberry 7e6cb7ecc9 Merge pull request #11533 from jbradberry/fix-register-peers-exact-typo
Fix the loop variable name for the register_peers --exact flag
2022-01-13 11:28:15 -05:00
Jeff Bradberry 807c58dc36 Fix the loop variable name for the register_peers --exact flag 2022-01-13 11:05:26 -05:00
Jeff Bradberry 1ff52bab56 Merge pull request #11520 from jbradberry/fix-register-peers
In register_peers, only check non-empty flags for the 1-cycle check
2022-01-11 16:52:53 -05:00
Jeff Bradberry 7a9fca7f77 In register_peers, only check non-empty flags for the 1-cycle check 2022-01-11 16:16:33 -05:00
Jeff Bradberry db999b82ed Merge pull request #11431 from jbradberry/receptor-mesh-models
Modify Instance and introduce InstanceLink
2022-01-11 10:55:54 -05:00
Jeff Bradberry 9c9c1b4d3b register_peers will now raise errors if you attempt to reverse or loop 2022-01-10 15:48:17 -05:00
Jeff Bradberry 5ffe91f069 Add a new --exact parameter to register_peers 2022-01-10 15:12:04 -05:00
Jeff Bradberry 63867518ee Add a new parameter --disconnect to register_peers
To allow links between Receptor nodes to be removed from the database.
2022-01-10 14:15:58 -05:00
Jeff Bradberry 37907ad348 Register the hop & execution nodes and all node links 2022-01-10 11:37:19 -05:00
Jeff Bradberry 386aa898ec Remove the make init target
we want to fold that in to bootstrap_environment.sh.
2022-01-10 11:37:19 -05:00
Jeff Bradberry f1c5da7026 Remove the auto-discovery feature 2022-01-10 11:37:19 -05:00
Jeff Bradberry fc2a5224ef Add error messages to the new register_peers command 2022-01-10 11:37:19 -05:00
Jeff Bradberry ce5aefd3d8 Capture hop nodes and links in the automatic discovery machinery
Also, make sure that the control service is turned on in the dev
environment's hop node, so that it shows up in the Advertisements
list.
2022-01-10 11:37:13 -05:00
Jeff Bradberry 1747a844fc Merge pull request #11485 from jbradberry/fix-broken-events-analytics
Fix a problem with the events_table analytics collectors
2022-01-04 11:30:26 -05:00
Jeff Bradberry 2ed246cb61 Fix a problem with the events_table analytics collectors
The switch to using jsonb objects instead of json broke the use of
json_to_record in the raw sql in the _events_table function.
2021-12-20 14:03:24 -05:00
Jeff Bradberry 4449555abe Add a new register_peers management command
and alter provision_instance to accept hop nodes.
2021-12-20 09:56:48 -05:00
Jeff Bradberry f340f491dc Control the visibility and use of hop node Instances
- the list, detail, and health check API views should not include them
- the Instance-InstanceGroup association views should not allow them
  to be changed
- the ping view excludes them
- list_instances management command excludes them
- Instance.set_capacity_value sets hop nodes to 0 capacity
- TaskManager will exclude them from the nodes available for job execution
- TaskManager.reap_jobs_from_orphaned_instances will consider hop nodes
  to be an orphaned instance
- The apply_cluster_membership_policies task will not manipulate hop nodes
- get_broadcast_hosts will ignore hop nodes
- active_count also will ignore hop nodes
2021-12-17 14:30:28 -05:00
Jeff Bradberry c8f1e714e1 Capture hop nodes and the peer links between nodes 2021-12-17 14:30:18 -05:00
Jeff Bradberry 3414cae677 Merge pull request #11471 from jbradberry/failure-notification-fallback-explanation
Only update the job_explanation on error if there wasn't already one
2021-12-16 11:10:38 -05:00
Jeff Bradberry de0561dcc2 Only update the job_explanation on error if there wasn't already one 2021-12-15 15:24:04 -05:00
Jeff Bradberry b195f9da44 Merge pull request #11384 from jbradberry/failure-notification-on-error
Make sure to fire off failure notifications on error
2021-12-15 13:47:10 -05:00
Jeff Bradberry c9c198b54b Fix the problems with the api-schema tests against Tower
- add the appropriate release branch to the branches list
- add a fallback to the `docker pull` command
2021-12-08 15:57:08 -05:00
Jeff Bradberry c419969253 Make sure to fire off failure notifications on error
where the error is unrelated to Ansible, thus is not caught by the
usual methods.
2021-11-23 13:25:08 -05:00
Jeff Bradberry d3c695b853 Clean up some scar tissue left behind
by the initial use of the black code formatter.
2021-11-10 08:50:15 +08:00
Jeff Bradberry 010c3ab0b8 Fix a typo in inventory_import
ExecutionEnvironment.credential got shortened to .cred.
2021-11-10 08:50:15 +08:00
Jeff Bradberry a9636426b8 Make the inventory_import command respect the default EE and credential 2021-11-10 08:50:14 +08:00
Jeff Bradberry 056247a34a Adjust Instance-InstanceGroup tests to show that the ActivityStream is captured 2021-11-10 08:50:12 +08:00
Jeff Bradberry 7010015e8a Change the ActivityStream registration for InstanceGroups
to include the m2m fields.  Also to avoid spamminess, disable the
activity stream on the apply_cluster_membership_policies task.
2021-11-10 08:50:12 +08:00
Jeff Bradberry 62d50d27be Update a couple of the existing tests 2021-11-10 08:50:12 +08:00
Jeff Bradberry 1e5231d68b Enable ActivityStream capture for Instances 2021-11-10 08:50:12 +08:00
Jeff Bradberry 7d0bbd0a4c Merge pull request #11225 from jbradberry/revert-iso-group-removal
Revert removing the old isolated groups
2021-10-08 12:38:03 -04:00
Jeff Bradberry 15fd22681d Revert removing the old isolated groups
In 4.1+ / AAP 2.1+, isolated groups should be converted into plain
instance groups, and it's desirable for the old ones to stick around
since they'll likely be tied to a bunch of job templates.  We do not
want to make the users have to reconstruct those relationships.
2021-10-08 11:53:21 -04:00
Jeff Bradberry 81fe39f060 Merge pull request #10929 from ansible/validate-control-only-nodes
Validate that control-only Instance nodes cannot change IG membership
2021-09-01 09:24:40 -04:00
Jeff Bradberry a2b984a1a5 Validate that control-only Instance nodes cannot change IG membership 2021-08-30 16:00:23 -04:00
Jeff Bradberry b0c511a7a2 Make non-polymorphic refs that slip through still work with our SET_NULL 2021-07-13 13:41:44 -04:00
Jeff Bradberry d0d9266dd1 Revert "Null iso IG jobs before deleting (#5122)"
This reverts commit 1831b2591a.
2021-07-13 13:41:36 -04:00
Jeff Bradberry 7d97ad021f Revert "Development of patch for inventory source migration error"
This reverts commit 8772ca2e3a.
2021-07-13 13:40:44 -04:00
Jeff Bradberry 40f5ff362c Bump ansible-runner to 2.0.0.0rc3 2021-06-28 10:51:06 -04:00
Jeff Bradberry d5deedc822 Make sure that validation of managed EEs makes sense
- missing fields in a patch request should be ignored
- compare the organization pks, if present
2021-06-28 10:51:05 -04:00
Jeff Bradberry 3be29d54ad Bump ansible-runner to 2.0.0.0rc2 and receptorctl to 1.0.0.0rc1 2021-06-28 10:51:04 -04:00
Jeff Bradberry 493e6cc527 Make the isolated removal migration non-atomic
We are apparently running into problems with pending triggers under
some circumstances.
2021-06-22 10:49:37 -04:00
Jeff Bradberry 6c1ba03235 Remove EE from the workflow job template collection module 2021-06-16 15:41:09 -04:00
Jeff Bradberry 85bb4e976f Execution environments are meaningless for workflows
so, remove them from the API endpoints for workflows.  Also, tear out
the WFJT.execution_environment step in the resolver.  If we want that
to be a thing, it ought to be a .default_environment instead.
2021-06-16 15:41:09 -04:00
Jeff Bradberry 93e90228a2 Remove isolated instances and groups
before we remove the fields that allow us to correctly identify them.
2021-06-15 17:36:26 -04:00
Jeff Bradberry 486bcd80f8 Make sure that the delete capability isn't hardcoded to be the same as edit 2021-06-09 15:45:02 -04:00
Jeff Bradberry 2d1a859719 Remove unused import 2021-06-09 13:48:23 -04:00
Jeff Bradberry 7a16782ebf Fix a problem with using PrimaryKeyRelatedField in our settings registry
DRF, when using this field, short-circuits the call to
.to_representation() when the value is None, since clearly you aren't
going to be able to get the .pk attribute off of it in that case.  We
were previously unconditionally calling .to_representation() which
throws an error when we try to clear the value of
DEFAULT_EXECUTION_ENVIRONMENT.
2021-06-09 13:48:23 -04:00
Jeff Bradberry 8ede74a7f6 Deal with the possibility of get_default_pod_spec not finding an EE 2021-06-09 13:48:23 -04:00
Jeff Bradberry 19da9955ce Make sure that managed EEs can't be deleted 2021-06-09 13:48:23 -04:00
Jeff Bradberry e6e1f97048 Add a signal handler to remove the default EE if it gets deleted 2021-06-09 13:48:16 -04:00
Jeff Bradberry 9f1e8a1ae2 Allow sysadmins to be able to change the pull field for managed EEs 2021-06-09 11:11:56 -04:00
Jeff Bradberry 9aa56b1247 Update the EE resolver logic
so that the control plane managed EE is kept separate.
2021-06-09 10:03:35 -04:00
Jeff Bradberry d4d21a1511 Remove the managed flag from all existing EEs
This flag henceforth is going to be used only for the "control plane"
execution environments, which sysadmins will not be allowed to alter.
2021-06-09 10:03:35 -04:00
Jeff Bradberry d0991bab9e Expose the EE resolver to the job template detail API endpoints 2021-06-03 16:35:50 -04:00
Jeff Bradberry d3cc439fa8 Include the EE set on a workflow template in the resolver hierarchy
This step comes immediately after checking the actual job/template for
an explicitly set EE.

Note that now, because of how jobs are spawned off of workflow nodes,
the call to .resolve_execution_environment() no longer happens in
.create_unified_job().  The job instance within .create_unified_job()
doesn't yet have access to the node that it will be attached to,
making it impossible to use this information in the resolver if called
there.
2021-05-27 15:22:44 -04:00
Jeff Bradberry 2aa3fe756e Remove the remote user existence validation
since we are going to do a confirmation modal dialog instead.
2021-05-19 10:27:51 -04:00
Jeff Bradberry c887f84a05 Add a check for the existence of pre-commit.sh
so that you don't get stuck when working on branches that don't have this yet.
2021-05-18 13:20:55 -04:00
Jeff Bradberry bcf93810ad Add an nginx location directive for the favicon
so that the rewrite rule that adds slashes to the ends of requested
urls doesn't get to it.
2021-05-14 14:00:57 -04:00
Jeff Bradberry 6f4c41a8d3 Add validation checks
that prevent the setting from being turned on if remote auth systems
and users are not already present.
2021-05-13 13:57:33 -04:00
Jeff Bradberry 81de931711 Add a new middleware to force-logout local-only users
when the DISABLE_LOCAL_AUTH setting is set.  This avoids the ugliness
of getting a SuspiciousOperation error for any request/response cycles
that are in flight when a user gets bounced.
2021-05-13 13:55:44 -04:00
Jeff Bradberry 9e7f004ca6 Add a signal handler to invalidate sessions and tokens for local users
when this setting gets turned on.
2021-05-13 13:55:44 -04:00
Jeff Bradberry 5c664eadf9 Write a thin wrapper around the standard Django auth backend 2021-05-13 13:55:44 -04:00
Jeff Bradberry 26b7e9de40 Add a new setting, DISABLE_LOCAL_AUTH
and expose it in the settings UI.
2021-05-13 13:55:44 -04:00
Jeff Bradberry d07887bd91 Remove the shebang line from pre-commit.sh
since bash isn't available by default on OS X.
2021-05-13 10:49:24 -04:00
Jeff Bradberry 1e5a0dc7c5 Break out the pre-commit hook into an explicit script
This means that

- we don't have to be always updating the underlying .git/hooks/pre-commit file
- updates to the logic will just work automatically
- the logic of the black logic has been fixed so that AWX_IGNORE_BLACK=1 should work right now
2021-05-12 11:54:17 -04:00
Jeff Bradberry 7b47d7e7f6 Data migration to remove the isolated instances from the database 2021-05-11 15:46:39 -04:00
Jeff Bradberry 204083fcdc Fix projects to use the utility function get_default_execution_environment 2021-05-03 14:00:19 -04:00
Jeff Bradberry 686d750ad9 Make the check_migrations command a direct alias of makemigration
It already more or less was, but it previously did some machinations
around copying and modifying the database settings.  These on-the-fly
changes to the database connection no longer work after the
rearrangement of settings files, so let's just get rid of it.
2021-05-03 11:01:52 -04:00
Jeff Bradberry 39f26fe576 Revert the code that prevents sysadmins from changing managed EEs
ref #10078
2021-05-03 10:25:18 -04:00
Jeff Bradberry 584fda5178 Add some unit tests around the analytics interval calculations 2021-04-26 16:21:25 -04:00
Jeff Bradberry 4857c5edcb Break out the main interval trimming calculation into a new function 2021-04-26 13:31:05 -04:00
Jeff Bradberry f4d848e596 Log adjustments made to the analytics interval due to the 4-week limit 2021-04-26 13:31:05 -04:00
Jeff Bradberry 65cee65fad Update the docs to remove references to isolated nodes 2021-04-22 10:20:11 -04:00
Jeff Bradberry 17e3279f1c Remove isolated nodes from the API views and serializers 2021-04-22 10:20:11 -04:00
Jeff Bradberry a17c34f041 Remove the isolation-specific settings
- AWX_ISOLATED_PUBLIC_KEY
- AWX_ISOLATED_PRIVATE_KEY
- AWX_ISOLATED_KEY_GENERATION
- AWX_ISOLATED_HOST_KEY_CHECKING
- AWX_ISOLATED_USERNAME
- AWX_ISOLATED_CONNECTION_TIMEOUT
- AWX_ISOLATED_LAUNCH_TIMEOUT
- AWX_ISOLATED_PERIODIC_CHECK
- AWX_ISOLATED_CHECK_INTERVAL
2021-04-22 10:20:11 -04:00
Jeff Bradberry 1819a7963a Make the necessary changes to the models
- remove InstanceGroup.controller
- remove Instance.last_isolated_check
- remove .is_isolated and .is_controller methods/properties
- remove .choose_online_controller_node() method
- remove .supports_isolation() and replace with .can_run_containerized
- simplify .can_run_containerized
2021-04-22 10:17:02 -04:00
Jeff Bradberry 6a599695db Remove the IsolatedManager and its associated playbooks and plugins 2021-04-22 10:17:02 -04:00
Jeff Bradberry b0cdfe7625 Clean up the management commands 2021-04-22 10:11:27 -04:00
Jeff Bradberry efabc05270 Chop out the dev environment isolated node 2021-04-22 10:11:27 -04:00
Jeff Bradberry b9389208dd Add in the missing dry-run check for csv analytics collectors 2021-04-20 09:36:29 -04:00
Jeff Bradberry 2793b5b01e Always overwrite the contents of .git/hooks/pre-commit 2021-04-15 14:21:53 -04:00
Jeff Bradberry 62c7554ec4 Adjust datetimes to be aware when using awx-manage gather_analytics
Also, make sure that an explicit `since` parameter will win over
default `until=now()` when calculating the 4-week data limit.
2021-04-06 15:59:54 -04:00