Compare commits

...

1052 Commits

Author SHA1 Message Date
Elijah DeLee
799968460d Fixup conversion of memory and cpu settings to support k8s resource request format (#11725)
fix memory and cpu settings to suport k8s resource request format

* fix conversion of memory setting to bytes

This setting has not been getting set by default, and needed some fixing
up to be compatible with setting the memory in the same way as we set it
in the operator, as well as with other changes from last year which
assume that ansible runner is returning memory in bytes.

This way we can start setting this setting in the operator, and get a
more accurate reflection of how much memory is available to the control
pod in k8s.

On platforms where services are all sharing memory, we deduct a
penalty from the memory available. On k8s we don't need to do this
because the web, redis, and task containers each have memory
allocated to them.

* Support CPU setting expressed in units used by k8s

This setting has not been getting set by default, and needed some fixing
up to be compatible with setting the CPU resource request/limits in the
same way as we set it in the resource requests/limits.

This way we can start setting this setting in the
operator, and get a more accurate reflection of how much cpu is
available to the control pod in k8s.

Because cpu on k8s can be partial cores, migrate cpu field to decimal.

k8s does not allow granularity of less than 100m (equivalent to 0.1 cores), so only
store up to 1 decimal place.

fix analytics to deal with decimal cpu

need to use DjangoJSONEncoder when Decimal fields in data passed to
json.dumps
2022-02-15 14:08:24 -05:00
Amol Gautam
3f08e26881 Merge pull request #11571 from amolgautam25/tasks-refactor-2
Added new class for  Ansible Runner Callbacks
2022-02-15 10:31:32 -05:00
Alex Corey
9af2c92795 Merge pull request #11691 from AlexSCorey/11634-ContaineGroupNameFix
Fixes erroneous disabling of name input field on container and instance group forms
2022-02-14 16:14:32 -05:00
Alex Corey
dabae456d9 Merge pull request #11653 from AlexSCorey/11588-TopLevelInstances
Adds top level instances list
2022-02-14 16:06:55 -05:00
Alex Corey
c40785b6eb Fixes erroneous disabling of name input field on container and instance group forms 2022-02-14 15:47:50 -05:00
Alex Corey
e2e80313ac Refactor the health check button 2022-02-14 15:35:25 -05:00
Alex Corey
14a99a7b9e resolves advanced search button 2022-02-14 15:35:24 -05:00
Alex Corey
50e8c299c6 Adds top level instances list 2022-02-14 15:35:24 -05:00
Alex Corey
326d12382f Adds Inventory labels (#11558)
* Adds inventory labels end point

* Adds label field to inventory form
2022-02-14 15:14:08 -05:00
Kersom
1de9dddd21 Merge pull request #11724 from nixocio/ui_issue_11708
Bump node to LTS version
2022-02-14 13:11:57 -05:00
nixocio
87b1f0d0de Bump node to LTS version
Bump node to LTS version
2022-02-14 12:41:11 -05:00
Kersom
f085afd92f Merge pull request #11592 from nixocio/ui_issue_11017_utils
Modify usage of ansible_facts on advanced search
2022-02-14 10:30:45 -05:00
Elijah DeLee
604cbc1737 Consume control capacity (#11665)
* Select control node before start task

Consume capacity on control nodes for controlling tasks and consider
remainging capacity on control nodes before selecting them.

This depends on the requirement that control and hybrid nodes should all
be in the instance group named 'controlplane'. Many tests do not satisfy that
requirement. I'll update the tests in another commit.

* update tests to use controlplane

We don't start any tasks if we don't have a controlplane instance group

Due to updates to fixtures, update tests to set node type and capacity
explicitly so they get expected result.

* Fixes for accounting of control capacity consumed

Update method is used to account for currently consumed capacity for
instance groups in the in-memory capacity tracking data structure we initialize in
after_lock_init and then update via calculate_capacity_consumed (both in
task_manager.py)

Also update fit_task_to_instance to consider control impact on instances

Trust that these functions do the right thing looking for a
node with capacity, and cut out redundant check for the whole group's
capacity per Alan's reccomendation.

* Refactor now redundant code

Deal with control type tasks before we loop over the preferred instance
groups, which cuts out the need for some redundant logic.

Also, fix a bug where I was missing assigning the execution node in one case!

* set job explanation on tasks that need capacity

move the job explanation for jobs that need capacity to a function
so we can re-use it in the three places we need it.

* project updates always run on the controlplane

Instance group ordering makes no sense on project updates because they
always need to run on the control plane.

Also, since hybrid nodes should always run the control processes for the
jobs running on them as execution nodes, account for this when looking for a
execution node.

* fix misleading message

the variables and wording were both misleading, fix to be more accurate
description in the two different cases where this log may be emitted.

* use settings correctly

use settings.DEFAULT_CONTROL_PLANE_QUEUE_NAME instead of a hardcoded
name
cache the controlplane_ig object during the after lock init to avoid
an uneccesary query
eliminate mistakenly duplicated AWX_CONTROL_PLANE_TASK_IMPACT and use
only AWX_CONTROL_NODE_TASK_IMPACT

* add test for control capacity consumption

add test to verify that when there are 2 jobs and only capacity for one
that one will move into waiting and the other stays in pending

* add test for hybrid node capacity consumption

assert that the hybrid node is used for both control and execution and
capacity is deducted correctly

* add test for task.capacity_type = control

Test that control type tasks have the right capacity consumed and
get assigned to the right instance group

Also fix lint in the tests

* jobs_running not accurate for control nodes

We can either NOT use "idle instances" for control nodes, or we need
to update the jobs_running property on the Instance model to count
jobs where the node is the controller_node.

I didn't do that because it may be an expensive query, and it would be
hard to make it match with jobs_running on the InstanceGroup which
filters on tasks assigned to the instance group.

This change chooses to stop considering "idle" control nodes an option,
since we can't acurrately identify them.

The way things are without any change, is we are continuing to over consume capacity on control nodes
because this method sees all control nodes as "idle" at the beginning
of the task manager run, and then only counts jobs started in that run
in the in-memory tracking. So jobs which last over a number of task
manager runs build up consuming capacity, which is accurately reported
via Instance.consumed_capacity

* Reduce default task impact for control nodes

This is something we can experiment with as far as what users
want at install time, but start with just 1 for now.

* update capacity docs

Describe usage of the new setting and the concept of control impact.

Co-authored-by: Alan Rominger <arominge@redhat.com>
Co-authored-by: Rebeccah <rhunter@redhat.com>
2022-02-14 10:13:22 -05:00
Shane McDonald
60b6faff19 Merge pull request #11655 from ivarmu/devel
Let an organization admin to add new users to it's tower organization
2022-02-12 19:35:51 -05:00
Rebeccah Hunter
b26c1c16b9 Merge pull request #11728 from ansible/node_state_unhealthy_to_error
[mesh viz] change the term unhealthy to error
2022-02-11 16:02:43 -05:00
Rebeccah
c2bf9d94be change the term unhealthy to error 2022-02-11 15:42:33 -05:00
Brandon Sharp
ea09adbbf3 Add await to handleLaunch (#11649)
* Add async to handleLaunch

* Fix package-lock

Co-authored-by: Wambugu  Kironji <wkironji@redhat.com>
2022-02-11 13:40:20 -05:00
Seth Foster
9d0de57fae Merge pull request #11717 from fosterseth/emit_event_detail_metrics
Add metric for number of events emitted over websocket broadcast
2022-02-11 12:52:16 -05:00
nixocio
da733538c4 Modify usage of ansible_facts on advanced search
Modify usage of ansible_facts on advanced search, once `ansible_facts`
key is selected render a text input allowing the user to type special
query expected for ansible_facts.

This change will add more flexibility to the usage of ansible_facts when
creating a smart inventory.

See: https://github.com/ansible/awx/issues/11017
2022-02-11 10:24:04 -05:00
Seth Foster
6db7cea148 variable name changes 2022-02-10 10:57:00 -05:00
Seth Foster
3993aa9524 Add metric for number of events emitted over websocket broadcast 2022-02-09 21:57:01 -05:00
Alex Corey
6f9d4d89cd Adds credential password step to ad hoc commands wizard (#11598) 2022-02-09 15:59:50 -05:00
Amol Gautam
443bdc1234 Decoupled callback functions from BaseTask Class
--- Removed all callback functions from 'jobs.py' and put them in a new file '/awx/main/tasks/callback.py'
--- Modified Unit tests unit moved
--- Moved 'update_model' from jobs.py to /awx/main/utils/update_model.py
2022-02-09 13:46:32 -05:00
Ivan Aragonés Muniesa
9cd43d044e let an organization admin to add new users to it's tower organization 2022-02-09 18:59:53 +01:00
Kersom
f8e680867b Merge pull request #11710 from nixocio/ui_npm_audit
Run npm audit fix
2022-02-09 12:48:54 -05:00
Rebeccah Hunter
96a5540083 Merge pull request #11632 from ansible/minikube-docs-part-2
update minikube dev env docs with newer keywords for instantiate-awx-deployment.yml
2022-02-09 11:44:43 -05:00
Shane McDonald
750e1bd80a Merge pull request #11342 from shanemcd/custom-uwsgi-mount-path
Allow for running AWX at non-root path (URL prefixing)
2022-02-09 10:37:04 -05:00
Jeff Bradberry
a12f161be5 Merge pull request #11711 from jbradberry/firehose-with-partitioning
Fix the firehose job creation script
2022-02-09 10:07:47 -05:00
Jeff Bradberry
04568ea830 Fix the firehose job creation script
to account for the changes made due to the job event table partitioning work.
2022-02-09 09:49:17 -05:00
nixocio
3be0b527d6 Run npm audit fix
Run npm audit fix

See: https://github.com/ansible/awx/issues/11709
2022-02-09 09:03:20 -05:00
Kersom
afc0732a32 Merge pull request #11568 from nixocio/ui_rs5
Bump react scripts to 5.0
2022-02-09 07:49:43 -05:00
nixocio
9703fb06fc Bump react scripts to 5.0
Bump react scripts to 5.0

See: https://github.com/ansible/awx/issues/11543

Bump eslint

Bump eslint and related plugins

Add @babe/core

Add @babe/core remove babel/core.

Rename .eslintrc to .eslintrc.json

Rename .eslintrc to .eslintrc.json

Add extra plugin

Move babe-plugin-macro as dev dependencies

Move babe-plugin-macro as dev dependencies

Add preset-react

Add preset-react

Fixing lint errors

Fixing lint errors

Run eslint --fix

Run eslint --fix

Turn no-restricted-exports off

Turn no-restricted-exports off

Revert "Run eslint --fix"

This reverts commit e760885b6c199f2ca18091088cb79bfa77c1d3ed.

Run --fix

Run --fix

Fix lint errors

Also bump specificity of Select CSS border component to avoid bug of
missing borders.

Also update API tests related to lincenses.
2022-02-08 11:12:51 -05:00
Shane McDonald
54cbf13219 Merge pull request #11696 from sean-m-sullivan/awx_collection_role_update_v2
add execution_environment_admin to role module
2022-02-08 10:12:00 -05:00
Shane McDonald
6774a12c67 Merge pull request #11694 from shanemcd/scoped-schema
Scope schema.json to target branch
2022-02-08 09:48:08 -05:00
Sean Sullivan
94e53d988b add execution adminitrator to role module 2022-02-08 09:44:50 -05:00
Shane McDonald
22d47ea8c4 Update port binding for UI dev tooling
Jake says "Folks sometimes run the ui dev server independently of the tools_awx container"

Co-authored-by: Jake McDermott <9753817+jakemcdermott@users.noreply.github.com>
2022-02-08 08:33:21 -05:00
Sarah Akus
73bba00cc6 Merge pull request #11670 from keithjgrant/11628-missing-job-output
Display all job type events in job output
2022-02-07 18:04:18 -05:00
Shane McDonald
6ed429ada2 Scope api schema.json to target branch 2022-02-07 17:54:01 -05:00
Keith J. Grant
d2c2d459c4 display all job type events in job output 2022-02-07 14:48:39 -08:00
John Westcott IV
c8b906ffb7 Workflow changes (#11692)
Modifying workflows to install python for make commands
Squashing CI tasks to remove repeated steps
Modifying pre-commit.sh to not fail if there are no python file changes
2022-02-07 15:42:35 -05:00
Shane McDonald
264f1d6638 Merge pull request #11685 from shanemcd/skip-pytest-7.0.0
Skip pytest 7.0.0
2022-02-04 16:09:42 -05:00
Shane McDonald
16c7908adc Skip pytest 7.0.0
A test was failing with:

    from importlib.readers import FileReader
E   ModuleNotFoundError: No module named 'importlib.readers'
2022-02-04 15:48:18 -05:00
Sarabraj Singh
c9d05d7d4a Merge pull request #11474 from sarabrajsingh/supervisord-rsyslog-event-listener-buff
adding event handler specific to when awx-rsyslog throws PROCESS_LOG_STDERR
2022-02-04 11:59:51 -05:00
Sarabraj Singh
ec7e4488dc adding event handler specific to when awx-rsyslog throws PROCESS_LOG_STDERR errors based on 4XX http errors; increased clarity in stderr log messages; removed useless None intializations 2022-02-04 11:18:45 -05:00
Alex Corey
72f440acf5 Merge pull request #11675 from AlexSCorey/11630-WrongtooltipDocs
Fix tooltip documentation in settings
2022-02-04 10:23:11 -05:00
Alan Rominger
21bf698c81 Merge pull request #11617 from AlanCoding/task_job_id
Fix error on timeout with non-job types
2022-02-04 09:41:25 -05:00
Shane McDonald
489ee30e54 Simplify code that generates named URLS 2022-02-03 19:00:07 -05:00
Shane McDonald
2abab0772f Bind port for UI live reload tooling in development environmentt
This allows for running:

```
docker exec -ti tools_awx_1 npm --prefix=awx/ui start
```
2022-02-03 19:00:07 -05:00
Shane McDonald
0bca0fabaa Fix bug in named url middleware when running at non-root path
The most notable change here is the removal of the conditional in
process_request. I don't know why we were preferring REQUEST_URI over
PATH_INFO. When the app is running at /, they are always the same as far as I
can tell. However, when using SCRIPT_NAME, this was incorrectly setting path and
path_info to /myprefix/myprefix/.
2022-02-03 19:00:07 -05:00
Shane McDonald
93ac3fea43 Make UI work when not running at root path 2022-02-03 19:00:07 -05:00
Shane McDonald
c72b71a43a Use relative paths for UI assets
Found at https://create-react-app.dev/docs/deployment/#serving-the-same-build-from-different-paths
2022-02-03 19:00:07 -05:00
Shane McDonald
9e8c40598c Allow for overriding UWSGI mount path
This is just one piece of the puzzle as I try to add support for URL prefixing.
2022-02-03 19:00:07 -05:00
Shane McDonald
4ded4afb7d Move production UWSGI config to a file 2022-02-03 19:00:07 -05:00
Seth Foster
801c45da6d Merge pull request #11681 from fosterseth/fix_cleanup_named_pipe
remove any named pipes before unzipping artifacts
2022-02-03 15:43:05 -05:00
srinathman
278b356a18 Update saml.md (#11663)
* Update saml.md

- Updated link to python documentation
- Added instructions for superadmin permissions

Co-authored-by: John Westcott IV <john.westcott.iv@redhat.com>
2022-02-03 13:33:50 -05:00
Shane McDonald
a718e01dbf Merge pull request #11676 from shanemcd/automate-labels
Automate labels with GHA
2022-02-03 10:53:15 -05:00
Shane McDonald
8e6cdde861 Automate labels 2022-02-03 09:45:00 -05:00
Alex Corey
62b0c2b647 Fix tooltip documentation 2022-02-02 16:18:41 -05:00
Seth Foster
1cd30ceb31 remove any named pipes before unzipping artifacts 2022-02-02 15:54:31 -05:00
Shane McDonald
15c7a3f85b Merge pull request #11673 from ansible/fix_dockerfile_kube_dev_deps
Includes gettext on build-deps for multi-stage builds
2022-02-02 15:31:54 -05:00
Alex Corey
d977aff8cf Merge pull request #11668 from nixocio/ui_issue_11582
Fix typerror cannot read property of null
2022-02-02 14:46:04 -05:00
Marcelo Moreira de Mello
e3b44c3950 Includes gettext on build-deps for multi-stage builds 2022-02-02 14:12:27 -05:00
nixocio
ba035efc91 Fix typerror cannot read property of null
```
> x = null
null
> x?.contains
undefined
> x.contains
Uncaught TypeError: Cannot read property 'contains' of null
```

See: https://github.com/ansible/awx/issues/11582
2022-02-02 13:54:37 -05:00
Sarah Akus
76cfd7784a Merge pull request #11517 from AlexSCorey/11236-ExpandCollapseAll
Adds expand collapse all functionality on job output page.
2022-02-02 09:43:13 -05:00
Alex Corey
3e6875ce1d Adds expand collapse all functionality on job output page. 2022-02-02 09:26:08 -05:00
Shane McDonald
1ab7aa0fc4 Merge pull request #11662 from simaishi/remove_tower_setup_script
Remove ansible-tower-setup script
2022-02-01 15:25:00 -05:00
Shane McDonald
5950e0bfcb Merge pull request #11643 from john-westcott-iv/github_meta_changes
GitHub meta changes
2022-02-01 13:15:40 -05:00
Satoe Imaishi
ac540d3d3f Remove tower-setup script - no longer used 2022-02-01 12:51:02 -05:00
Rebeccah Hunter
848ddc5f3e Merge pull request #10912 from rh-dluong/add_org_alias_to_org_mapping
Add organization_alias to Org Mapping as intended
2022-02-01 11:44:48 -05:00
Marliana Lara
30d1d63813 Add wf node list item info popover (#11587) 2022-02-01 11:10:24 -05:00
dluong
9781a9094f Added functionality to where user can add organization alias to org mapping so that the user doesn't have to match the saml attr exactly as the org name 2022-02-01 09:46:37 -05:00
Kersom
ab3de5898d Merge pull request #11646 from jainnikhil30/fix_jobs_id
add job id to the jobs details page
2022-02-01 08:45:51 -05:00
Nikhil Jain
7ff8a3764b add job id to the jobs details page 2022-02-01 10:34:02 +05:30
Tiago Góes
32d6d746b3 Merge pull request #11638 from jakemcdermott/fix-prompted-inventory-role-level
Only display usable inventories for launch prompt
2022-01-31 17:48:28 -03:00
Shane McDonald
ecf9a0827d Merge pull request #11618 from fosterseth/ps_in_dev_image
Install ps in dev image
2022-01-31 12:42:59 -05:00
John Westcott IV
a9a7fac308 Removing the Installer option in issues and pr templates 2022-01-31 10:56:59 -05:00
Alan Rominger
54b5884943 Merge pull request #11642 from AlanCoding/new_black_rule
Fix newly-added black rules
2022-01-31 10:01:50 -05:00
John Westcott IV
1fb38137dc Adding Collection and Installer category to issues/prs 2022-01-30 14:01:25 -05:00
John Westcott IV
2d6192db75 Adding triage label to any new issue 2022-01-30 13:59:37 -05:00
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
Alan Rominger
6b25fcaa80 Fix newly-added black rules 2022-01-29 23:17:58 -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
Jake McDermott
5e0eb5ab97 Only display usable inventories for launch prompt 2022-01-28 16:13:19 -05:00
Alan Rominger
2de5ffc8d9 Merge pull request #11627 from AlanCoding/fast_heartbeat
Prevent duplicate query in local health check
2022-01-28 13:19:56 -05:00
Elijah DeLee
3b2fe39a0a update another part of minikube dev env docs
vars in ansible/instantiate-awx-deployment.yml in awx-operator repo appear to have been updated, because when we used the `tower_...` vars, they did not apply
2022-01-27 23:31:20 -05:00
Alan Rominger
285ff080d0 Prevent duplicate query in local health check 2022-01-27 15:27:07 -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
Shane McDonald
ef7d5e6004 Merge pull request #11621 from ansible/update-minikube-dev-env-docs
Update minikube dev environment docs
2022-01-27 09:56:50 -05:00
Elijah DeLee
598c8a1c4d Update minikube docs
Replace reference to a non-existent playbook with current directions from awx-operator
Also add some tips about how to interact with the deployment
2022-01-27 08:37:14 -05:00
Seth Foster
b3c20ee0ae Install ps in dev image 2022-01-26 18:12:52 -05:00
Alan Rominger
cd8d382038 Fix error on timeout with non-job types 2022-01-26 17:00:59 -05:00
Shane McDonald
b678d61318 Merge pull request #11569 from zjzh/devel
Update ad_hoc_commands.py
2022-01-26 16:51:30 -05:00
Brian Coca
43c8231f7d fix deprecated indentation and type (#11599)
* fix deprecated indentation and type

This was breaking docs build for any plugins that used this fragment

fixes #10776
2022-01-26 16:10:02 -05:00
Shane McDonald
db401e0daa Merge pull request #11616 from shanemcd/hostname
Install hostname in dev image
2022-01-26 15:04:07 -05:00
Shane McDonald
675d4c5f2b Install hostname in dev image 2022-01-26 14:39:57 -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
Shane McDonald
5660f9ac59 Merge pull request #11514 from shanemcd/python39
Upgrade to Python 3.9
2022-01-26 10:59:14 -05:00
Alex Corey
546e63aa4c Merge pull request #11581 from AlexSCorey/UpdateReleaseNotes
Adds more detail to the AWX release notes
2022-01-26 10:43:52 -05:00
Alex Corey
ddbd143793 Adds more detail to the AWX release notes 2022-01-26 09:52:40 -05:00
Shane McDonald
35ba321546 Unpin virtualenv version 2022-01-25 17:41:38 -05:00
Shane McDonald
2fe7fe30f8 Remove epel
This doesnt seem to be needed anymore
2022-01-25 17:39:42 -05:00
Alan Rominger
8d4d1d594b Merge pull request #11608 from AlanCoding/mount_awx_devel
Mount awx_devel in execution nodes for developer utility
2022-01-25 16:42:56 -05:00
Alan Rominger
c86fafbd7e Mount awx_devel in execution nodes for developer utility 2022-01-25 12:28:26 -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
Sarah Akus
4cdc88e4bb Merge pull request #11534 from marshmalien/7678-inv-sync-link
Link from sync status icon to prefiltered list of inventory source sync jobs
2022-01-25 12:03:09 -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
Marcelo Moreira de Mello
cfabbcaaf6 Merge pull request #11602 from ansible/avoid_project_updates_on_create_preload_data
Avoid Project..get_or_create() in create_preload_data
2022-01-24 18:20:29 -05:00
Marcelo Moreira de Mello
7ae6286152 Avoid Project..get_or_create() in create_preload_data
Django ORM method get_or_create() does not call save() directly,
but it calls the create() [1].

The create method ignores the skip_update=True option, which then
will trigger a project update, however the EE was not yet created
in the database.

To avoid this problem, we just check the existence of the default
project and creates it with save(skip_update=True) manually.
2022-01-24 17:59:29 -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
Keith Grant
85cc67fb4e Update status icons (#11561)
* update StatusLabels on job detail

* change StatusIcon to use PF circle icons

* change status icon to status label on host event modal

* update status label on wf job output

* update tests for status label changes

* fix default status icon color
2022-01-24 14:01:02 -05:00
Shane McDonald
af9eb7c374 Update timezone test 2022-01-24 12:21:28 -05:00
Shane McDonald
44968cc01e Upgrade to Python 3.9 2022-01-24 12:21:20 -05:00
Shane McDonald
af69b25eaa Merge pull request #11332 from shanemcd/bump-deps
Security-related updates for some Python dependencies.
2022-01-24 12:13:53 -05:00
Shane McDonald
eb33b95083 Merge pull request #11548 from shanemcd/revert-11428
Revert "Make awx-python script available in k8s app images"
2022-01-24 12:10:01 -05:00
Marcelo Moreira de Mello
aa9124e072 Merge pull request #11566 from ansible/expose_isolate_path_podman_O
Support user customization of EE mount options and mount paths
2022-01-21 22:41:23 -05:00
Marcelo Moreira de Mello
c086fad945 Added verbosity to molecule logs 2022-01-21 21:30:49 -05:00
Marcelo Moreira de Mello
0fef88c358 Support user customization of container mount options and mount paths 2022-01-21 17:12:32 -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
John Westcott IV
5bced09fc5 Handeling different types of response.data (#11576) 2022-01-21 15:16:09 -05:00
Jake McDermott
b4e9ff7ce0 Merge pull request #11573 from nixocio/ui_rename_files
Rename remaining .jsx files to .js
2022-01-21 10:55:06 -05:00
Alex Corey
208cbabb31 Merge pull request #11580 from jakemcdermott/readme-update-templates-2
Update ui dev readme
2022-01-21 10:50:01 -05:00
Jake McDermott
2fb5cfd55d Update ui dev readme 2022-01-21 10:31:35 -05:00
Jake McDermott
582036ba45 Merge pull request #11579 from jakemcdermott/readme-update-templates
Update ui dev readme, templates
2022-01-21 10:12:50 -05:00
Jake McDermott
e06f9f5438 Update ui dev readme, templates 2022-01-21 09:55:54 -05:00
nixocio
461876da93 Rename remaining .jsx files to .js
Rename remaining .jsx files to .js
2022-01-20 14:17:32 -05:00
Alan Rominger
4f1c662691 Merge pull request #11570 from AlanCoding/keycloak_docs
Minor docs tweaks for keycloak setup
2022-01-20 11:52:21 -05:00
Alan Rominger
9abd4e05d0 Minor docs tweaks for keycloak setup 2022-01-20 11:01:32 -05:00
Elijah DeLee
faba64890e Merge pull request #11559 from kdelee/pending_container_group_jobs_take2
Add resource requests to default podspec
2022-01-20 09:54:20 -05:00
Alan Rominger
add54bfd0b Merge pull request #11472 from AlanCoding/process_ident
Pass new ansible-runner parameters to reduce number of artifacts we don't need on file system
2022-01-20 09:48:44 -05:00
zzj
16d39bb72b Update ad_hoc_commands.py
refactoring code with set comprehension which is more concise and efficient
2022-01-20 18:50:33 +08:00
John Westcott IV
e63ce9ed08 Api 4XX error msg customization #1236 (#11527)
* Adding API_400_ERROR_LOG_FORMAT setting
* Adding functional tests for API_400_ERROR_LOG_FORMAT
Co-authored-by: nixocio <nixocio@gmail.com>
2022-01-19 11:16:21 -05:00
Kersom
60831cae88 Merge pull request #11539 from nixocio/api_issue_11523
Update ping endpoint to use last_seen
2022-01-19 10:40:02 -05:00
Kersom
97cf46eaa9 Merge pull request #11556 from nixocio/ui_bump_node_npm
Bump node and npm versions inside container
2022-01-19 09:58:30 -05:00
Shane McDonald
381e75b913 Merge pull request #11562 from ansible/avoid_dups_create_preload_data
Avoid duplicated entries when calling create_preload_data
2022-01-18 19:00:43 -05:00
Shane McDonald
7bd516a16c Skip project update 2022-01-18 18:40:58 -05:00
Marcelo Moreira de Mello
3dd01cde89 Avoid duplicated entries when calling create_preload_data 2022-01-18 18:07:26 -05:00
Kersom
495394084d Fix null on workflowjobtemplate (#11522)
Fix null on workflowjobtemplate

See: https://github.com/ansible/awx/issues/11284
2022-01-18 16:54:00 -05:00
Alan Rominger
2609ee5ed0 Delete artifact dir after transmit phase is finished 2022-01-18 14:51:40 -05:00
John Westcott IV
da930ce276 Fixing token documentation (#11550) 2022-01-18 14:21:17 -05:00
Elijah DeLee
987924cbda Add resource requests to default podspec
Extend the timeout, assuming that we want to let the kubernetes scheduler
start containers when it wants to start them. This allows us to make
resource requests knowing that when some jobs queue up waiting for
resources, they will not get reaped in as short of a
timeout.
2022-01-18 13:34:39 -05:00
Alan Rominger
8fac1c18c8 Make task logic use consistent artifact dir location 2022-01-18 13:00:39 -05:00
Alan Rominger
eb64fde885 Pass ident to "process" cmd and disable stdout file
This requires corresponding ansible-runner changes
  which are only available in devel branch
  to do this, requirements are changed
  to install ansible-runner devel as it did before

Revert "Use ansible-runner 2.1.1 build"

This reverts commit f0ede01017.

Add back in change from updater.sh that we want to keep
2022-01-18 13:00:39 -05:00
nixocio
b1e9537499 Bump node and npm versions inside container
Bump node and npm versions inside container

Prepating to bump react scripts to 5.0.

See: https://github.com/ansible/awx/issues/11543
2022-01-17 20:33:47 -05:00
Shane McDonald
9d636cad29 Revert "Make awx-python script available in k8s app images"
This reverts commit 88bbd43314.
2022-01-15 10:38:50 -05:00
Alan Rominger
696c0b0055 Merge pull request #11503 from AlanCoding/no_version
Remove unused ansible version method
2022-01-14 22:15:15 -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
Alan Rominger
9664aed1f2 Remove unused ansible version method 2022-01-14 14:55:35 -05:00
Amol Gautam
6dda5f477e Merge pull request #11544 from AlanCoding/another_rule
Respect linter rule F811 about trivial re-definition
2022-01-14 14:05:41 -05:00
Alan Rominger
72cd73ca71 Update to cover stuff from tasks.py changes 2022-01-14 13:42:24 -05:00
Alan Rominger
02e18cf919 Fix more F811 linter violations 2022-01-14 13:23:05 -05:00
Alan Rominger
82671680e3 Respect linter rule F811 for trivial re-definition 2022-01-14 13:23:04 -05:00
Amol Gautam
bff49f2a5f Merge pull request #11528 from amolgautam25/tasks-refactor-1
Refactored 'tasks.py' file  into a package
2022-01-14 12:16:32 -05:00
Marcelo Moreira de Mello
59d582ce83 Merge pull request #11530 from ansible/dont_expose_k8s_api_token_by_default
Don't expose serviceAccount token on default pod spec
2022-01-14 12:04:14 -05:00
Amol Gautam
a4a3ba65d7 Refactored tasks.py to a package
--- Added 3 new sub-package : awx.main.tasks.system , awx.main.tasks.jobs , awx.main.tasks.receptor
--- Modified the functional tests and unit tests accordingly
2022-01-14 11:55:41 -05:00
Kersom
11f4b64229 Modify how manual subform is displayed for projects (#11509)
Modify how manual subform is displayed for projects - Do not rely on
label that could be translated, rely on the value.

See: https://github.com/ansible/awx/issues/11505
2022-01-14 11:19:10 -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
nixocio
3d45f31536 Update ping endpoint to use last_seen
Update ping endpoint to use last_seen, instead of `modified` on
instances `heartbeat`.

See: https://github.com/ansible/awx/issues/11523
2022-01-13 16:46:40 -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
Alex Corey
d33a0d5dde Merge pull request #11454 from AlexSCorey/ReceptorEndPoints
Creates end point and beginning of serializer for receptor mesh
2022-01-13 11:51:34 -05:00
Marliana Lara
11cc7e37e1 Add prefiltered link to inventory source sync jobs 2022-01-13 11:48:40 -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
Marcelo Moreira de Mello
1517f2d910 Don't expose serviceAccount token on default pod spec 2022-01-12 23:47:24 -05:00
Alan Rominger
b0c59ee330 Merge pull request #11375 from AlanCoding/missing_image_error_devel
Fail with specific error message if protected image is not available
2022-01-12 11:05:17 -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
Alex Corey
dea53a0dba Creates end point and serializer for receptor mesh 2022-01-11 10:57:57 -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
John Westcott IV
c92468062d SAML user attribute flags issue #5303 (PR #11430)
* Adding SAML option in SAML configuration to specify system auditor and system superusers by role or attribute
* Adding keycloak container and documentation on how to start keycloak alongside AWX (including configuration of both)
2022-01-10 16:52:44 -05:00
Seth Foster
4de0f09c85 Merge pull request #11515 from fosterseth/revert_debug_level
Revert "Remove unnecessary DEBUG logger level settings (#11441)"
2022-01-10 16:38:33 -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
Sarah Akus
53ff99e391 Merge pull request #11513 from marshmalien/10241-test-locator
Add test locators to OUIA-compliant components
2022-01-10 13:10:08 -05:00
Shane McDonald
c035c12c0a Merge pull request #11380 from sean-m-sullivan/new_name
add new name to multiple modules
2022-01-11 01:42:55 +08:00
Shane McDonald
6e39a02e99 Merge pull request #11504 from sean-m-sullivan/devel
add better error and documentation on labels
2022-01-11 01:42:13 +08:00
Seth Foster
956638e564 Revert "Remove unnecessary DEBUG logger level settings (#11441)"
This reverts commit 8126f734e3.
2022-01-10 11:46:19 -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
Marliana Lara
b2124dffb5 Add test locators to OUIA-compliant components 2022-01-07 14:39:18 -05:00
Christian Adams
25eaace4be Merge pull request #11508 from tchellomello/awx-config-watcher-dies-ocp
Disable awx-config-watcher for k8s images
2022-01-07 10:01:19 -05:00
sean-m-ssullivan
bb8efbcc82 add new name to multiple modules 2022-01-05 22:33:51 -05:00
sean-m-sullivan
e0bd5ad041 add better error and documentation on labels 2022-01-05 20:09:02 -05:00
Marcelo Moreira de Mello
69ec49d0e9 Disable awx-config-watcher on OCP 2022-01-05 17:02:14 -05:00
Alan Rominger
8126f734e3 Remove unnecessary DEBUG logger level settings (#11441)
* Remove unnecessary DEBUG logger level settings
2022-01-05 14:44:57 -05:00
nixocio
f2aaa6778c Add warning message for K8S deployment
Add warning message for K8S deployment
2022-01-05 11:32:59 -05:00
Sarah Akus
4fd5b01a83 Merge pull request #11324 from keithjgrant/10655-duplicate-api-requests
Reduce duplicate fetches after saving inventory group
2022-01-04 11:42:37 -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
Kersom
afc210a70d Merge pull request #11489 from nixocio/ui_issue_11452
Fix relaunch of jobs
2022-01-04 08:34:50 -05:00
Keith J. Grant
f63003f982 don't navigate to inventory group details on edit cancel 2021-12-21 13:22:59 -08:00
Keith J. Grant
e89037dd77 reduce duplicate fetches after saving inventory group 2021-12-21 13:22:59 -08:00
nixocio
ab6e650e9c Fix relaunch of jobs
Events were passed to `handleRelaunch` and those events structure were
not parseable to JSON - breaking the relaunch of jobs. React 17 changes
made this bug visible.

Also, remove withRouter from LaunchButton.

See: https://github.com/ansible/awx/issues/11452
2021-12-21 14:39:34 -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
Sarah Akus
ddc428532f Merge pull request #11470 from rebeccahhh/devel
Jobs page filter status with OR operator
2021-12-16 16:45:47 -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
Wambugu “Innocent” Kironji
9d6972c6ce Merge pull request #11459 from marshmalien/5456-insights-system-settings
Update label and display of "Last gathered entries..." setting
2021-12-15 16:58:18 -05:00
Marliana Lara
0566a0f1d6 Update label and display of "Last gathered entries..." setting 2021-12-15 15:59:43 -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
Rebeccah
a9f4f53f92 change logical ANDs into logical ORs for filtering based on status in the JobsList 2021-12-15 15:15:33 -05:00
Elijah DeLee
5fdfd4114a Merge pull request #11395 from kdelee/override_default_container_group_pod_spec
Allow setting default execution group pod spec
2021-12-15 13:57:47 -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
Tiago Góes
1205d71f4b Merge pull request #11466 from tiagodread/restore-locator-2
Restore locator removed
2021-12-15 11:10:26 -03:00
Tiago
3f762a6476 restore locator removed 2021-12-15 10:55:02 -03:00
Tiago Góes
4aa403c122 Merge pull request #11465 from tiagodread/restore-locator
Restore locator removed
2021-12-14 18:57:22 -03:00
Tiago
a13070a8da restore locator removed 2021-12-14 18:39:10 -03:00
Wambugu “Innocent” Kironji
b63b171653 Merge pull request #11447 from nixocio/ui_issue_7561
Add email as default search key user lists
2021-12-14 16:29:10 -05:00
Alan Rominger
7219f8fed8 Merge pull request #11462 from AlanCoding/forgot_this
Add the cancel_callback to system job interface
2021-12-14 14:17:47 -05:00
Alan Rominger
b6a5f834d6 Merge pull request #11408 from amolgautam25/receptor_tech_debt
Removing time.sleep(3)
2021-12-14 11:54:49 -05:00
Alan Rominger
99b9d53bbb Add the cancel_callback to system job interface 2021-12-14 10:50:39 -05:00
Alex Corey
edca19a697 Merge pull request #11402 from AlexSCorey/upgradePF
Updates patternfly dependencies
2021-12-13 11:02:01 -05:00
Jake McDermott
c13d721062 Merge pull request #11435 from jakemcdermott/fix-vaulted-ee-cred
Handle exception for credential input checks in calling function
2021-12-13 10:10:23 -05:00
Kersom
d2f316c484 Merge pull request #11443 from nixocio/ui_issue_11442
Fix extra requests when creating WorkFlowJobTemplate
2021-12-13 09:12:27 -05:00
nixocio
70e832d4db Fix extra requests when creating WorkFlowJobTemplate
Fix extra requests when creating WorkFlowJobTemplate

See: https://github.com/ansible/awx/issues/11442
2021-12-13 08:19:24 -05:00
Alan Rominger
21895bd09b Merge pull request #11448 from AlanCoding/revert_again
Revert "cancel job if receptor no longer knows about the work item"
2021-12-10 16:35:12 -05:00
Alan Rominger
411ef5f9e8 Revert "cancel job if receptor no longer knows about the work item"
This reverts commit 2a11bb4f3b.
2021-12-10 16:18:44 -05:00
nixocio
f6282b9a09 Add email as default search key user lists
Add email as default search key user lists

See: https://github.com/ansible/awx/issues/7561
2021-12-10 16:06:38 -05:00
Elijah DeLee
e10030b73d Allow setting default execution group pod spec
This will allow us to control the default container group created via settings, meaning
we could set this in the operator and the default container group would get created with it applied.

We need this for https://github.com/ansible/awx-operator/issues/242

Deepmerge the default podspec and the override

With out this, providing the `spec` for the podspec would override everything
contained, which ends up including the container used, which is not desired

Also, use the same deepmerge function def, as the code seems to be copypasted from
the utils
2021-12-10 15:02:45 -05:00
Jeff Needle
cdf14158b4 Merge pull request #11436 from AlexSCorey/sync
Pulling in upstream changes
2021-12-10 14:48:59 -05:00
Alex Corey
f310e672b0 Merge pull request #11247 from AlexSCorey/11227-fix
Removes disassociate button on details view and fine tunes disassociate button on list view
2021-12-10 10:30:30 -05:00
Keith Grant
675d0d28d2 Job Output expand/collapse take 2 (#11312) 2021-12-09 14:08:31 -05:00
Alex Corey
4c2fd056ef updated patternfly 2021-12-09 12:09:58 -05:00
Sarah Akus
a259e48377 Merge pull request #11414 from AlexSCorey/upgradeReact
Upgrade react
2021-12-09 09:53:35 -05:00
ansible-translation-bot
095c586172 UI translation strings for release_4.1 branch
* Correct syntax errors & add back lost last line for messages.po
  * Manually sort through es & nl translated strings
  * Mnaually sort through french strings and correct syntax errors

Signed-off-by: Christian M. Adams <chadams@redhat.com>
2021-12-08 15:57:08 -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
Jim Ladd
2a11bb4f3b cancel job if receptor no longer knows about the work item
lint
2021-12-08 15:57:02 -05:00
Shane McDonald
35bac50962 Ensure docker pull commands fail gracefully 2021-12-08 15:51:14 -05:00
jakemcdermott
366d2c1d97 Handle exception for credential input checks in calling function 2021-12-08 12:09:20 -05:00
Jake McDermott
9a930cbd95 Merge pull request #10935 from jakemcdermott/remove-sleep
Remove sleep from tests
2021-12-08 11:14:36 -05:00
Jake McDermott
03277513a9 Remove sleep from tests 2021-12-08 10:55:30 -05:00
Alan Rominger
1b0fca8026 Merge pull request #11386 from AlanCoding/logs_on_the_fire
Remove dev-only log filters and downgrade periodic logs
2021-12-07 16:13:45 -05:00
Christian Adams
c9cf5b78c5 Merge pull request #11428 from rooftopcellist/fix-k8s-image-build
Make awx-python script available in k8s app images
2021-12-07 14:36:31 -05:00
Alan Rominger
d6679a1e9b Respect dynamic log setting for console, downgrade exit log 2021-12-07 14:35:03 -05:00
Alan Rominger
b721a4b361 Remove dev-only log filters and downgrade periodic logs 2021-12-07 14:35:02 -05:00
Christian M. Adams
88bbd43314 Make awx-python script available in k8s app images 2021-12-07 13:48:32 -05:00
Tiago Góes
fb1c97cdc1 Merge pull request #11311 from nixocio/ui_no_more_classes
Convert last class components to functional components
2021-12-07 14:57:47 -03:00
Kersom
f5ae8a0a4c Merge pull request #11377 from nixocio/ui_sonic_tests
Update how ui tests are invoked on CI
2021-12-07 09:42:34 -05:00
nixocio
1994eaa406 Convert last class components to functional components
Convert last class components to functional components
2021-12-07 09:19:49 -05:00
nixocio
510b40a776 Update how ui tests are invoked on CI
Update how ui tests are invoked on CI as an attempt to speed up test
run.
2021-12-07 09:18:32 -05:00
Alex Corey
f37b070965 Upgrades React 2021-12-06 14:36:08 -05:00
Alex Corey
41385261f3 Resolves disassociate button for instances 2021-12-06 11:32:12 -05:00
Alan Rominger
19b4849345 Merge pull request #11394 from notok/cfg_from_template_branch
Load ansible.cfg from the branch specified on job template
2021-12-06 11:09:36 -05:00
notok
76283bd299 Load ansible.cfg from the branch specified on job template
Load ansible.cfg from the branch specified on job template (i.e. the same branch that the playbook exists), not from the branch set in the "project".

Signed-off-by: notok <noto.kazufumi@gmail.com>
2021-12-03 20:36:07 +09:00
Amol Gautam
2e4cda74c8 Removing time.sleep(3) 2021-12-02 15:41:46 -05:00
Alan Rominger
5512b71e16 Merge pull request #11412 from AlanCoding/cookie_revert
Revert "Set SESSION_COOKIE_NAME by default"
2021-12-02 11:00:56 -05:00
Alan Rominger
97b60c43b7 Merge pull request #11385 from AlanCoding/my_cluster_host
Do not overwrite file-based CLUSTER_HOST_ID written by installer
2021-12-02 10:53:59 -05:00
Alan Rominger
35b62f8526 Revert "Set SESSION_COOKIE_NAME by default"
This reverts commit 59c6f35b0b.
2021-12-01 17:51:47 -05:00
Kersom
a15a3f005c Merge pull request #11278 from nixocio/ui_bump
Bump Browserslist version
2021-12-01 09:26:19 -05:00
Alan Rominger
776c4a988a Do not overwrite file-based CLUSTER_HOST_ID written by installer 2021-11-30 20:15:10 -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
Jake McDermott
ba324c73ce Merge pull request #11378 from ansible/update-dev-env-readme
Update example command for running test container
2021-11-19 16:09:37 -05:00
Jake McDermott
4a5dc78331 Update example command for running test container 2021-11-19 15:44:51 -05:00
Kersom
55dc9dfb54 Merge pull request #11355 from nixocio/ui_issue_11352
Linkify instance/container groups job template details
2021-11-19 14:59:31 -05:00
nixocio
23a8191bb5 Bump Browserslist version
Bump Browserslist version to remove warning.

See: https://github.com/browserslist/browserslist#browsers-data-updating
2021-11-19 14:53:01 -05:00
nixocio
c665caaf35 Linkify instance/container groups job template
Linkify instance/container groups job template

See: https://github.com/ansible/awx/issues/11352
2021-11-19 14:23:11 -05:00
Alan Rominger
099efb883d Allow customizing the receptor image in the development environment (#11374)
* Allow for customizing the receptor image

* Hook in receptor image to docker-compose template

* Fix missing -e to pass into Dockerfile playbook

* Add some docs
2021-11-19 14:00:23 -05:00
Sarah Akus
44237426df Merge pull request #11353 from nixocio/ui_node_delete
Identify node to be deleted on workflow
2021-11-19 12:32:27 -05:00
Alan Rominger
eeefd19ad3 Fail with specific error message if protected image is not available locally 2021-11-19 11:52:54 -05:00
nixocio
47ae6e7a5a Identify node to be deleted on workflow
Identify node to be deleted on workflow. If there is an alias show the
alias if no alias is available show the node name.

See: https://github.com/ansible/awx/issues/11351
2021-11-19 10:55:19 -05:00
Shane McDonald
03ed6e9755 Merge pull request #11371 from shanemcd/document-release-process
Document release process
2021-11-19 18:43:53 +08:00
Shane McDonald
8d4e7f0a82 Document release process 2021-11-19 08:28:48 +00:00
Shane McDonald
7fdf491c05 Merge pull request #11369 from shanemcd/lets-automate-everything
Automate the rest of our release process
2021-11-19 11:37:58 +08:00
Shane McDonald
ef1563283e An automated stage / promotion release process 2021-11-19 02:22:45 +00:00
Shane McDonald
a206d79851 Merge pull request #11368 from shanemcd/downstream-changes
A few more downstream fixes
2021-11-19 09:46:21 +08:00
Satoe Imaishi
42c9c0a06b Use receptor 1.1.1 build 2021-11-19 01:11:35 +00:00
Satoe Imaishi
f0ede01017 Use ansible-runner 2.1.1 build 2021-11-19 01:11:19 +00:00
Alan Rominger
d67007f777 Move only_transmit_kwargs calculation out of thread 2021-11-19 01:11:18 +00:00
nixocio
83d81e3788 Upgrade has-ansi 2021-11-19 01:10:36 +00:00
Shane McDonald
e789e16289 Merge pull request #11348 from pabelanger/temp/sessionname
Set SESSION_COOKIE_NAME by default
2021-11-19 08:33:07 +08:00
Bianca Henderson
61c9683aa6 Merge pull request #11269 from AlexSCorey/1741-SlackNotifications
Users can send slack notification to a thread
2021-11-18 14:28:28 -05:00
Sarah Akus
ee9d1356b2 Merge pull request #11354 from nixocio/ui_issue_11350
Update search keys
2021-11-17 14:56:46 -05:00
Alex Corey
f92a49fda9 Adds ability to send slack notification to a thread, updates tooltip in ui, and adds test button to notification details view 2021-11-17 14:04:32 -05:00
nixocio
3dc6a055ac Update search keys
Update search keys.

See: https://github.com/ansible/awx/issues/11350
2021-11-16 15:32:50 -05:00
Kersom
229f0d97f9 Merge pull request #11307 from jakemcdermott/default-template-search-labels
Add labels to default template search
2021-11-16 15:14:55 -05:00
Christian Adams
7cc530f950 Merge pull request #11145 from aperigault/devel
fix french typos
2021-11-16 11:23:18 -05:00
aperigault
2ef840ce12 Fix encrypted translation 2021-11-16 16:27:27 +01:00
Antony Perigault
a372d8d1d5 fix french typos 2021-11-16 16:27:27 +01:00
Shane McDonald
aad150cf1d Pin rsa package to latest version 2021-11-16 09:02:11 +00:00
Shane McDonald
be13a11dd5 Merge pull request #11344 from Akasurde/typo
Misc typo fix
2021-11-16 16:52:30 +08:00
Paul Belanger
59c6f35b0b Set SESSION_COOKIE_NAME by default
Make sure to use a different session cookie name then the default, to
avoid overlapping cookies with other django apps that might be running.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2021-11-15 12:59:07 -05:00
Abhijeet Kasurde
37e45c5e7c Misc typo fix
Changed 'controler' to 'controller'

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-11-15 16:24:21 +05:30
Shane McDonald
39370f1eab Security-related updates for some Python dependencies. 2021-11-14 08:45:49 +00:00
Shane McDonald
aec7ac6ebd Merge pull request #11341 from shanemcd/fix-image-builds
Fix official image builds
2021-11-13 14:31:26 +08:00
Shane McDonald
f6e63d0917 Fix official image builds
I broke everything in https://github.com/ansible/awx/pull/11242.

These changes were necessary in order to run `awx-manage collectstatic` without a running database.
2021-11-13 06:07:37 +00:00
Rebeccah Hunter
0ae67edaba Merge pull request #11267 from ziegenberg/add-tests-for-webhook-notifications
Add unit tests for webhook notifications
2021-11-11 09:55:38 -05:00
Shane McDonald
481f6435ee Merge pull request #11327 from shanemcd/downstream-changes
Pull in downstream changes
2021-11-11 11:09:22 +08:00
chris meyers
d0c5c3d3cf add work_unit_id to job lifecycle 2021-11-10 08:50:16 +08:00
chris meyers
9f8250bd47 add events to job lifecycle
* Note in the job lifecycle when the controller_node and execution_node
  are chosen. This event occurs most commonly in the task manager with a
  couple of exceptions that happen when we dynamically create dependenct
  jobs on the fly in tasks.py
2021-11-10 08:50:16 +08:00
Alan Rominger
3a3fffb2dd Fixed error dropped on floor - save receptor detail when it applies 2021-11-10 08:50:16 +08:00
nixocio
4cfa4eaf8e Update validators for Misc Auth Edit
* Update SharedFields to use number validator instead of integer
* Use number validation for SESSIONS_PER_USER

See: https://github.com/ansible/tower/issues/5396
2021-11-10 08:50:16 +08:00
Kersom
abb1125a2c Display host name for Associate Modal (#5407)
Display host name for Associate Modal

See: https://github.com/ansible/awx/issues/11256
2021-11-10 08:50:16 +08:00
Alan Rominger
a2acbe9fe6 Fix incorrect (changed: True) frequent in OCP task logs 2021-11-10 08:50:16 +08:00
Alex Corey
cab8c690d2 Adds instances to aactivty stream 2021-11-10 08:50:16 +08:00
Alan Rominger
0d1f8a06ce Revert default EE authfile support for inventory_import 2021-11-10 08:50:15 +08:00
Alan Rominger
d42fe921db Re-order authfile option to make inventory import command work 2021-11-10 08:50:15 +08:00
Kersom
db7fb81855 Fix login redirect (#5386)
Allows the user to visit login page when the login redirect url is set.

Also, redirects to login page once logging out and there is session from
a SAML available.

See: https://github.com/ansible/awx/issues/11012
2021-11-10 08:50:15 +08: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
Bianca Henderson
58cdbca5cf Update error message to be more accurate 2021-11-10 08:50:15 +08:00
Bianca Henderson
8275082896 Update error messages for when exceptions are caught 2021-11-10 08:50:14 +08:00
Bianca Henderson
d79da1ef9f Catch exceptions that might pop up when releasing work units 2021-11-10 08:50:14 +08:00
Jeff Bradberry
a9636426b8 Make the inventory_import command respect the default EE and credential 2021-11-10 08:50:14 +08:00
Alan Rominger
329caad681 In admin reaper skip work units w/o params 2021-11-10 08:50:14 +08:00
Alan Rominger
ecb84e090c Revert "Merge pull request #5354 from ansible/jobs_killed_via_receptor_should_get_reaped"
This reverts commit 8736858d80, reversing
changes made to 84e77c9db9.
2021-11-10 08:50:14 +08:00
nixocio
8e9fc14b0e Fix SAML variables default values
Fix SAML variables default values

See: https://github.com/ansible/tower/issues/5372
2021-11-10 08:50:14 +08:00
Jim Ladd
0f77ca605d add unit tests 2021-11-10 08:50:14 +08:00
Jim Ladd
231fcc8178 drop lines picked up during merge resolution 2021-11-10 08:50:13 +08:00
Alan Rominger
2839091b22 Avoid extra check if we have job_explanation 2021-11-10 08:50:13 +08:00
Alan Rominger
47e67481b3 Avoid reaping tentative jobs 2021-11-10 08:50:13 +08:00
Alan Rominger
55059b015f Avoid resultsock shutdown before reading from it 2021-11-10 08:50:13 +08:00
Alan Rominger
eb6c58682d Alternative for reaping lost jobs, in work unit reaper 2021-11-10 08:50:13 +08:00
Jim Ladd
26055de772 cancel job if receptor no longer knows about the work item 2021-11-10 08:50:13 +08:00
Jim Ladd
ebb4581595 update exception log message to be descriptive
.. instead of surfacing exception
2021-11-10 08:50:12 +08:00
Jim Ladd
d1fecc11c9 when releasing receptor work, do so in try/except 2021-11-10 08:50:12 +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
Seth Foster
e04efad3c0 tools_receptor_1 should use whatever awx_devel tag that tools_awx_1 is using 2021-11-10 08:50:11 +08:00
Alan Rominger
e54db3ce50 Gracefully handle receptorctl RuntimeError in health check 2021-11-10 08:50:11 +08:00
Alan Rominger
77076dbd67 Reduce the number of triggers for execution node health checks 2021-11-10 08:50:11 +08:00
Alan Rominger
6f20a798ab Allow testing a single hybrid instance like the good old days 2021-11-10 08:50:11 +08:00
Alex Corey
0d3a22bbc3 Fixes erroneous validation 2021-11-10 08:50:11 +08:00
Alan Rominger
f34c96ecf5 Error handling when node is missing from mesh for jobs and checks 2021-11-10 08:50:11 +08:00
nixocio
206c85778e Do not show control instances as option to be associated
Do not show control instances as option to be associated to user defined
instance groups.

See: https://github.com/ansible/tower/issues/5339
2021-11-10 08:50:11 +08:00
Marcelo Moreira de Mello
d6b4b9f973 Added node_type on awx-manage list_instances commmand
(cherry picked from commit 683145e3eaa8b13da59bc51e57dff98f25d3554d)
2021-11-10 08:50:10 +08:00
chris meyers
3065e29deb avoid work_results and work release race
* Unsure exactly why this happens but there seems to be a race condition
  related to the time window between Receptor work_results and work
  release. This sleep extends that window and hopefully avoids the race
  condition.
2021-11-10 08:50:10 +08:00
Bianca Henderson
481047bed8 Change log level from 'warning' to 'exception' 2021-11-10 08:50:10 +08:00
Bianca Henderson
f72292cce2 Move error handling into try/catch block 2021-11-10 08:50:10 +08:00
Alan Rominger
7b35902d33 Respect settings to keep files and work units
Add new logic to cleanup orphaned work units
  from administrative tasks

Remove noisy log which is often irrelevant
  about running-cleanup-on-execution-nodes
  we already have other logs for this
2021-11-10 08:50:10 +08:00
Shane McDonald
1660900914 Dont fail CI when pre-built images arent available
CI will build the image from scratch if the pre-build image is not available
2021-11-10 08:50:08 +08:00
kialam
a7be25ce8b Merge pull request #11282 from kialam/upgrade-d3-to-v7
Upgrade d3 to v7.
2021-11-04 14:06:23 -07:00
Tiago Góes
54b5ba08b8 Merge pull request #11259 from tiagodread/update-e2e-script
Fix e2e tests workflow
2021-11-04 13:06:38 -03:00
jakemcdermott
0fb8d48074 Add labels to default template search 2021-11-04 10:35:24 -04:00
Rebeccah Hunter
b5fac4157d Merge pull request #11281 from ziegenberg/update-docs-to-include-openssl-as-requirement
add OpenSSL to the list of prerequisites
2021-11-01 13:02:52 -04:00
Bianca Henderson
9e61949f9f Merge pull request #11263 from ziegenberg/fix-documentation-link-to-debugging
fix link to debugging documentation
2021-11-01 11:53:01 -04:00
Daniel Ziegenberg
6c5640798f fix link to debugging documentation
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2021-10-30 18:45:46 +02:00
Bianca Henderson
03222197a3 Merge pull request #11270 from ziegenberg/update-slack-sdk
Update dependency slackclient to slack_sdk
2021-10-29 17:33:29 -04:00
Alan Rominger
12f417d0a3 Merge pull request #11286 from StarryInternet/enpaul-multiuse-mesh
Skip additional instance checks on unrecognized hosts
2021-10-29 15:09:33 -04:00
Ethan Paul
c77aaece1d Skip additional instance checks on unrecognized hosts
Skip checking the health of a mesh instance when the instance is not registered
with the application. This prevents encountering an 'UnbouncLocalError' when
running the application attached to a multi-use Receptor mesh network

Signed-off-by: Ethan Paul <24588726+enpaul@users.noreply.github.com>
2021-10-29 14:06:36 -04:00
Shane McDonald
25140c9072 Merge pull request #11288 from bhavenst/devel
Fix dev build (docker-compose) problems
2021-10-28 12:54:13 -04:00
Bryan Havenstein
3a636c29ab Fix dev build (docker-compose) problems
Prevent deletion of nginx user by entrypoint.sh
 - Fixes: https://github.com/ansible/awx/issues/9552

Enable fuse-overlayfs in all images - native overlay not supported until kernel 5.13+
 - Fixes: https://github.com/ansible/awx/issues/10099

Refs:
https://www.redhat.com/sysadmin/podman-rootless-overlay
https://www.redhat.com/en/blog/working-container-storage-library-and-tools-red-hat-enterprise-linux
2021-10-27 15:55:57 -06:00
Kia Lam
a11d5ccd37 Add missing UI license file. 2021-10-27 10:58:31 -07:00
Daniel Ziegenberg
f6e7937f74 Add unit tests for webhook notifications
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2021-10-27 17:33:37 +02:00
Rebeccah Hunter
e447b667e5 Merge pull request #11246 from ziegenberg/fix-http-headers-for-rocketchat-notifications
Use the AWX HTTP client headers for rocketchat notifications
2021-10-27 10:20:58 -04:00
Kia Lam
24c635e9bc Fix unit tests. 2021-10-26 14:48:58 -07:00
Kia Lam
2ad4dcd741 Upgrade d3 to v7. 2021-10-26 12:07:15 -07:00
Daniel Ziegenberg
f5cd9e0799 add OpenSSL to the list of prerequisites
For running `make docker-compose` a working version of openssl is
required for successfully generating Private RSA key for signing work.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2021-10-26 17:14:00 +02:00
Daniel Ziegenberg
e7064868b4 updates the implementation of the slack backend for notifications
Use the slack_sdk instead of the deprecated slackclient. Because according to the official documentation:
>  The slackclient PyPI project is in maintenance mode now and slack-sdk project is the successor.
With this commit one UPGRADE BLOCKER from requirements/requirements.in is removed. Als the license for slack_sdk
is updated and unit tests for slack notifications backend are added.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2021-10-26 16:41:10 +02:00
Daniel Ziegenberg
65cbbf15c9 Use the AWX HTTP client headers for rocketchat notifications
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2021-10-20 13:14:30 +02:00
Tiago
a325509e1e Fix e2e check 2021-10-19 15:23:43 -03:00
Jake McDermott
69ae731898 Merge pull request #11258 from ansible/jakemcdermott-include-jsconfig
Add jsconfig to frontend container
2021-10-19 14:02:54 -04:00
Jake McDermott
3452dee1b0 Add jsconfig to frontend container
The eslint and jsconfig files are needed to start the dev server.

Without the jsconfig, the ui development server can't resolve src 
modules and will fail to start.
2021-10-19 12:05:15 -04:00
Shane McDonald
64b337e3c6 Dont re-run CI after merging PRs into devel 2021-10-19 11:24:28 -04:00
Bianca Henderson
5df9655fe3 Merge pull request #11252 from beeankha/update_version_makefile_target
Update/Add Targets that Acquire AWX Version
2021-10-19 10:59:48 -04:00
Shane McDonald
f3669f3be6 Fix make install_collection
The version obtained from setuptools_scm is not compatible with ansible-galaxy collection install.
2021-10-19 10:26:23 -04:00
Shane McDonald
61eb99c46d Merge pull request #11253 from beeankha/collections_docs_fix_pt2
Update auth_plugin Doc Extension File to Fix Malformed Collections Docs
2021-10-18 18:07:41 -04:00
Bianca Henderson
f74a14e34f Update auth_plugin doc extension to fix malformed Collections docs 2021-10-18 11:08:17 -04:00
Shane McDonald
517f1d7991 Merge pull request #9491 from sezanzeb/awxkit-credential-file
making the cli use AWXKIT_CREDENTIAL_FILE
2021-10-13 19:05:56 -04:00
Bianca Henderson
25e69885d0 Merge pull request #11198 from sean-m-sullivan/name_or_id_workflow_node
update to allow use of id for unified job template
2021-10-13 15:19:02 -04:00
Shane McDonald
60a357eda1 Merge pull request #10906 from oweel/10829-idle_timeout_setting
Added idle_timeout setting to job settings
2021-10-13 13:16:53 -04:00
Cesar Francisco San Nicolas Martinez
d74679a5f9 Merge pull request #11244 from ansible/CFSNM-fix-minor-typo
Update test_ha.py
2021-10-13 17:04:34 +02:00
Chris Meyers
73a865073d Merge pull request #11241 from chrismeyersfsu/fix-missing-project-updates
Fix missing project updates
2021-10-13 11:03:44 -04:00
Cesar Francisco San Nicolas Martinez
4ff8c28fe4 Update test_ha.py
Fixed minor typo in node type
2021-10-13 16:46:58 +02:00
Shane McDonald
4ab2539c8a Merge pull request #11242 from shanemcd/awx-operator-ci-check
Add awx-operator CI check
2021-10-13 10:28:23 -04:00
Tiago Góes
459eb3903e Merge pull request #11208 from AlexSCorey/7741-GroupAdvanceSearchKeys
Groups Advanced Search Keys
2021-10-13 10:32:26 -03:00
chris meyers
611a537b55 add missing create partition for scm backed inv
* This will resolve missing project update job events issue
2021-10-13 07:51:40 -04:00
Shane McDonald
3a74cc5a74 Add awx-operator CI check 2021-10-12 18:59:24 -04:00
Shane McDonald
f1520e1a70 Allow for building headless mode
This will only be used in CI and maybe other places where we dont need a UI
2021-10-12 18:59:24 -04:00
Shane McDonald
727b4668c2 yamllint: ignore some gitignore'd directories 2021-10-12 18:59:24 -04:00
Shane McDonald
1287e001d8 yamllint: disable truthy rule
This rule feels very anti-Ansible
2021-10-12 18:59:23 -04:00
Shane McDonald
c9b53cf975 Refactor image_build and image_push roles
Primary changes are:

- Generalized variable names (remove "docker")
- Add explicit "push" variable rather than checking if the "registry" variable is defined.
- Allow for passing in version as build arg
2021-10-12 18:59:13 -04:00
chris meyers
64811d0b6b fix python black lint requirements 2021-10-12 17:09:30 -04:00
Alan Rominger
74af187568 Fix Makefile conditional used for docker-refresh (#11238) 2021-10-12 13:52:52 -04:00
sean-m-ssullivan
a28c023cf1 update to allow use of id for unified job template 2021-10-12 13:06:30 -04:00
Shane McDonald
cdf7fd64b2 Merge pull request #11230 from no-12/devel
Fix survey update with job_template module
2021-10-11 17:23:57 -04:00
Shane McDonald
84ffa4a5b7 Merge pull request #11189 from nntrn/pgsql-12
Change pgsql version from 10 to 12 in template for dockerfile role
2021-10-11 15:41:18 -04:00
Shane McDonald
326a43de11 Merge pull request #11231 from CastawayEGR/fix-awx-collection-spelling
fix spelling of Vault
2021-10-11 15:37:20 -04:00
Amol Gautam
07f193d8d6 Merge pull request #11226 from amolgautam25/K8s_signed_work
Changed Work Submission parameter for K8s work
2021-10-11 13:03:28 -04:00
Amol Gautam
f79a57c3e2 Changed Work Submission parameter for K8s work 2021-10-11 08:10:26 -07:00
Michael Tipton
f8319fcd02 fix spelling of Vault 2021-10-09 23:46:16 -04: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
kialam
d1800aa6d0 Merge pull request #11218 from kialam/revert-pf-upgrade
Roll back PF deps upgrade to re-enable select input typing.
2021-10-08 11:38:55 -07:00
Wambugu “Innocent” Kironji
dda940344e Merge pull request #11209 from kialam/fix-job-list-refresh
Pass configurable qs to fetchJobsById function.
2021-10-08 13:18:53 -04:00
Kersom
1fffeb430c Merge pull request #11216 from AlexSCorey/11214-DisableDefaultInstanceDelete
Disable default instance delete
2021-10-08 12:48:23 -04: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
Chris Meyers
6a2826b91c Merge pull request #11088 from saito-hideki/issue/10879
Fixed Org mapping behavior with SAML when Ansible Galaxy cred does not exist
2021-10-08 10:48:11 -04:00
Jim Ladd
112111c7f9 Merge pull request #10904 from jladdjr/do_not_collect_artifact_data
do not collect artifact_data when gathering analytics
2021-10-07 22:46:00 -07:00
Alan Rominger
ed8498f43f Change search location for job private data (#11217) 2021-10-07 20:33:57 -04:00
Kia Lam
77a5bb9069 Roll back PF deps upgrade to re-enable select input typing. 2021-10-07 15:36:14 -07:00
Alex Corey
37f86803f7 Disables name field for default and controlplan instance groups 2021-10-07 15:36:25 -04:00
Tiago Góes
160858b051 Merge pull request #11206 from nixocio/ui_update
Upgrade a few ui dependencies
2021-10-07 15:55:50 -03:00
Kia Lam
68f44c01ea Rely on default qs value. 2021-10-07 09:52:33 -07:00
Alex Corey
bef8d7426f Groups Advanced search keys, and removes Clear all filters text after advanced search 2021-10-07 10:08:06 -04:00
nixocio
c758f079cd Upgrade a few ui dependencies
Upgrade axios, and ansi-to-html.
2021-10-06 22:14:59 -04:00
Shane McDonald
7e404b7c19 Merge pull request #11199 from shanemcd/auto-version
Remove VERSION files, obtain version from git tags.
2021-10-06 20:14:06 -04:00
Kia Lam
4b7faea552 Remove comments and linter-disable. 2021-10-06 13:18:47 -07:00
Sarah Akus
4ddd391033 Merge pull request #11168 from AlexSCorey/11103-AllowJinjaOnSettings
Sufrace ALLOW_JINJA_IN_EXTRA_VARS on the job settings page
2021-10-06 15:59:28 -04:00
Alan Rominger
e52416fd47 Report single node clusters as non-ha (#11212)
* Report single node clusters as non-ha

* Move test file so we can make it use the database

* Update unit test to accomidate different node types
2021-10-06 10:50:18 -04:00
Shane McDonald
f67a2d2f46 Make setup.py compatible with older pythons
This caused some annoying downstream failures I'd rather not fix right now.
2021-10-05 19:11:03 -04:00
Shane McDonald
fcdda8d7a7 Remove old test comparing VERSION files 2021-10-05 19:11:03 -04:00
Shane McDonald
1f0b936e82 Remove VERSION files, obtain version from git tags. 2021-10-05 19:11:00 -04:00
Alan Rominger
b70793db5c Consolidate cleanup actions under new ansible-runner worker cleanup command (#11160)
* Primary development of integrating runner cleanup command

* Fixup image cleanup signals and their tests

* Use alphabetical sort to solve the cluster coordination problem

* Update test to new pattern

* Clarity edits to interface with ansible-runner cleanup method

* Another change corresponding to ansible-runner CLI updates

* Fix incomplete implementation of receptor remote cleanup

* Share receptor utils code between worker_info and cleanup

* Complete task logging from calling runner cleanup command

* Wrap up unit tests and some contract changes that fall out of those

* Fix bug in CLI construction

* Fix queryset filter bug
2021-10-05 16:32:03 -04:00
Kia Lam
0f044f6c21 Pass configurable qs to fetchJobsById function. 2021-10-05 13:04:37 -07:00
Amol Gautam
4c205dfde9 Merge pull request #11133 from amolgautam25/receptor_work_sign
AWX dev environment changes for receptor work signing feature
2021-10-05 14:57:58 -04:00
Tiago Góes
d58d460119 Merge pull request #11173 from mabashian/hub-to-controller
Adds support for pre-filling EE add form name, description, and image from query params
2021-10-05 15:57:31 -03:00
Amol Gautam
24a6edef9e AWX dev environment changes for receptor work signing feature
-- Updated devel build to take most recent receptor binary
-- Added signWork parameter when sedning job to receptor
-- Modified docker-compose tasks to generate RSA key pair to use for work-signing
-- Modified docker-compose templates and jinja templates for implementing work-sign
-- Modified Firewall rules on the receptor jinja config

Add firewall rules to dev env
2021-10-05 11:41:34 -07:00
Kersom
a5485096ac Merge pull request #11200 from nixocio/ui_update_unit_tests
Update unit-tests
2021-10-05 14:29:07 -04:00
Kersom
60a5ccf70b Merge pull request #11201 from nixocio/ui_remove_console
Remove console.log
2021-10-05 14:28:42 -04:00
Marliana Lara
d93a7c2997 Reset form values when query params change 2021-10-05 13:10:33 -04:00
Alan Rominger
af5f8e8a4a Always set project sync execution_node to current host (#11204) 2021-10-05 13:08:40 -04:00
nixocio
1596c855ff Remove console.log
Remove console.log
2021-10-05 11:26:03 -04:00
nixocio
f45dd7a748 Update unit-tests
Update unit-tests mocked values, as attempt to mitigate CI failures.
2021-10-05 11:16:42 -04:00
Shane McDonald
a036363e85 Merge pull request #11195 from shanemcd/update-pip-and-setuptools
Update pip and setuptools
2021-10-04 18:50:51 -04:00
Shane McDonald
4aceea41fd Update licensce test to work with newer pip 2021-10-04 17:41:48 -04:00
Shane McDonald
7bbfcbaefd Update dev requirements to work with setuptools 58 2021-10-04 16:24:16 -04:00
Elijah DeLee
18eaa9bb92 Merge pull request #11166 from ansible/receptorctl-status-sosreport
get receptorctl status for sosreport
2021-10-04 16:13:37 -04:00
Tiago Góes
6826d5444b Merge pull request #11183 from AlexSCorey/11170-fix
Fixes Instance Group tooltip
2021-10-04 15:35:03 -03:00
Alex Corey
622ec69216 fixes tooltip 2021-10-04 14:17:13 -04:00
Shane McDonald
d38c109d49 Update pip and setuptools 2021-10-04 13:07:16 -04:00
Tiago Góes
a31b2d0259 Merge pull request #11192 from AlexSCorey/11191-fix
Fixes delete message
2021-10-04 12:39:19 -03:00
Tiago Góes
b13c076881 Merge pull request #11148 from AlexSCorey/11105-UpdatePF
Updates PF dependencies, and Instance Toggle labels
2021-10-04 12:29:36 -03:00
Alex Corey
c429a55382 Fixes delete message 2021-10-04 10:58:48 -04:00
Alex Corey
20c4b21c39 Sufrace ALLOW_JINJA_IN_EXTRA_VARS on the job settings page 2021-10-04 10:24:26 -04:00
Elijah DeLee
d3289dc688 fix typo in comment in tools/sosreport/controller.py 2021-10-04 09:45:11 -04:00
annie tran
685c0b844e Change pgsql version from 10 to 12 in template for dockerfile role 2021-10-04 06:34:16 -05:00
Shane McDonald
57c9b14198 Fix docker-compose targets 2021-10-03 13:40:26 -04:00
Shane McDonald
0736f4d166 Merge pull request #11187 from shanemcd/bump-19.4.0
AWX 19.4.0
2021-10-02 15:21:01 -04:00
Shane McDonald
fed94b531d Merge pull request #11163 from gbaychev/patch-1
Update websockets.md
2021-10-02 15:17:03 -04:00
Shane McDonald
43a77e8667 Clean up unused parts of Makefile 2021-10-02 14:22:14 -04:00
Shane McDonald
637dc3844d Bump version 2021-10-02 14:15:54 -04:00
Jim Ladd
815a45cf2f call 'work cancel' on inactive controller jobs 2021-10-01 12:55:06 -07:00
Sarah Akus
0b66b61dd6 Merge pull request #11184 from akus062381/user-date-detail-revised
change locator- UserDateDetail
2021-10-01 15:07:24 -04:00
akus062381
7c011a1796 fix commit problem, user date detail
fix commit problem, user date detail
2021-10-01 14:51:03 -04:00
Sarah Akus
bf8859f401 Merge pull request #11171 from nixocio/ui_issue_11169
Fix subform for AAP for inventory source
2021-10-01 12:46:02 -04:00
Sarah Akus
c14d5ec59e Merge pull request #11158 from AlexSCorey/11137-FixSurveyIntegerValidation
Properly validates Integer Survey Question with min value of 0
2021-10-01 12:36:19 -04:00
Elijah DeLee
6d850e031a Merge pull request #11175 from ansible/receptor-sos
don't collect keys with sosreport
2021-09-30 10:09:16 -04:00
Tiago Góes
38af9e2d42 Merge pull request #11156 from nixocio/ui_issue_11150
Fix translation for instance list
2021-09-30 10:16:38 -03:00
nixocio
a3d7901d5f Fix translation for instance list
Fix translation for instance list. Issue was just visible on production
build.

See:https://github.com/ansible/awx/issues/11150
2021-09-30 09:01:01 -04:00
Elijah DeLee
54b3e2f285 don't collect keys with sosreport 2021-09-30 08:58:16 -04:00
mabashian
d0a13cb12a Adds test coverage for parsing and prefilling form fields from query params on EE add form 2021-09-29 16:59:16 -04:00
nixocio
003bf29dce Fix subform for AAP for inventory source
Fix subform for AAP for inventory source

See: https://github.com/ansible/awx/issues/11169
2021-09-29 16:53:48 -04:00
mabashian
71c72f74a1 Add support for name and description query params on ee add 2021-09-29 16:45:07 -04:00
Alex Corey
adaa24a562 Properly validates Integer Survey Question with min value of 0 2021-09-29 15:02:22 -04:00
mabashian
ad24fe7017 Remove cred from potential hub params 2021-09-29 13:57:27 -04:00
mabashian
e5578a8ef3 Fix bad merge conflict resolution 2021-09-29 13:55:30 -04:00
Elijah DeLee
3a40d5e243 get receptorctl status for sosreport
I presume the logs also get collected from journalctl but I'm not sure
2021-09-29 11:24:49 -04:00
Marliana Lara
8e34898b4e Redirect with query params and update EE form with hub image data 2021-09-29 11:22:56 -04:00
Bianca Henderson
7eefa897b3 Merge pull request #11070 from beeankha/receptor_related_docs_changes
Update Tasks and Clustering Doc Files
2021-09-29 11:17:47 -04:00
beeankha
4c7c89b410 Update wording from 'node' to 'instance' 2021-09-29 10:12:19 -04:00
beeankha
caafa55c35 Update clustering.md doc to remove some installer-related info 2021-09-29 10:05:53 -04:00
beeankha
7776d426ac Delete receptor_mesh.md file, update docker-compose README with new cluster info 2021-09-29 10:05:53 -04:00
beeankha
2d87ccface Update Tasks doc file with Receptor work unit information 2021-09-29 10:05:53 -04:00
Sarah Akus
b9131b9e8b Merge pull request #11157 from nixocio/ui_issue_11113
Redirect system path to management on jobs URL
2021-09-29 10:05:06 -04:00
Alan Rominger
7c9626b0e7 Fix bug that would run --worker-info health checks on control or hybrid nodes (#11161)
* Fix bug that would run health check on control nodes

* Prevent running execution node health check against main cluster nodes
2021-09-29 09:34:22 -04:00
Georgi Baychev
1338aef2bd Update websockets.md
- specify that the websockets are not meant for external usage/3rd party clients (see #10764)
- add a the missing slash at the '/websocket/' URL
2021-09-29 13:55:12 +02:00
Bianca Henderson
b9ecf389c2 Merge pull request #11151 from sean-m-sullivan/simplify_utils
simplify module utils python to single file
2021-09-28 17:36:02 -04:00
Bianca Henderson
75a873079d Merge pull request #11135 from sean-m-sullivan/workflow_node_id
add ability to lookup unified job template by org
2021-09-28 13:28:36 -04:00
Satoe Imaishi
4824153cd9 Merge pull request #11154 from simaishi/venv_add_pbr
Fix rpm 'offline' build (add pbr to venv and change receptorctl wheel file name)
2021-09-28 12:06:23 -04:00
sean-m-ssullivan
5b28e7b397 simplify module utils files 2021-09-28 11:43:28 -04:00
Satoe Imaishi
f3f781917a Skip pbr license check if ansible-runner isn't a released version 2021-09-28 11:07:30 -04:00
nixocio
4398c7c777 Redirect system path to management on jobs URL
When user attempts to access `/jobs/system/66` redirect to
`/jobs/management/66`.

This will catch management jobs notifications, for instance, and redirect to
the proper URL.

See:#11113
2021-09-28 10:23:57 -04:00
Satoe Imaishi
b6179c6073 receptorctl whl with version number 2021-09-28 08:27:12 -04:00
sean-m-ssullivan
dd4943310d simplify module utils files 2021-09-27 19:35:22 -04:00
Satoe Imaishi
7df6f8d88c Add pbr to venv temporarily 2021-09-27 18:02:47 -04:00
sean-m-ssullivan
c026790f55 add ability to lookup unified job template by org 2021-09-27 17:31:33 -04:00
Alex Corey
0b0d049071 Updates PF dependencies, and Instance Toggle labels 2021-09-27 17:26:39 -04:00
Kersom
87105a654c Merge pull request #11147 from kialam/fix-logout-react-console-error
Wrap `setAuthRedirectTo` in useEffect.
2021-09-27 16:57:30 -04:00
Kia Lam
32651db4e9 Wrap setAuthRedirectTo in useEffect. 2021-09-27 10:58:49 -07:00
Marcelo Moreira de Mello
270f6c4abd Merge pull request #11143 from tchellomello/fix_streamtls_when_not_present
Fixed logic to avoid tracebacks when node_name is invalid
2021-09-27 11:49:11 -04:00
Alan Rominger
3664cc3369 Disable autodiscovery except for docker-compose (#11142) 2021-09-27 11:36:11 -04:00
Marcelo Moreira de Mello
2204e03123 Fixed logic to avoid tracebacks when node_name is invalid 2021-09-27 11:28:28 -04:00
Sarah Akus
7b6befa3d2 Merge pull request #11134 from nixocio/ui_issue_11127
Do not display EE if a job was canceled
2021-09-27 11:10:36 -04:00
Sarah Akus
84bc91defd Merge pull request #11132 from nixocio/ui_issue_6302
Break lines for long strings on main lists
2021-09-27 11:05:14 -04:00
nixocio
2dca92c788 Do not display EE if a job was canceled
Do not display EE if a job was canceled. Since the API is returning null
for the value of the EE for this particular scenario.

See: https://github.com/ansible/awx/issues/11127
2021-09-27 08:33:50 -04:00
Marcelo Moreira de Mello
76dc22cd06 Merge pull request #11118 from tchellomello/ensure_controller_node_is_assigned_prj_updates
Project updates must run on controller nodes
2021-09-25 23:19:11 -04:00
Marcelo Moreira de Mello
6d4b4cac37 Project updates must run on controller nodes
For project updates jobs triggered due a job template run,
we must ensure that project_update job to run on at the same
controller which dispatched the original job template, otherwise
the job might fail for being unable to find the playbook YAML file.
2021-09-25 23:05:45 -04:00
Alan Rominger
3fc63489f1 Filter controller_node selection to online nodes (#11120) 2021-09-24 23:01:32 -04:00
nixocio
e8cd8c249c Break lines for long strings on main lists
Break lines for long strings on main lists to avoid horizontal
scrolling.

Main goal of this change is to avoid actions items to be hidden on the
main lists.

See: https://github.com/ansible/awx/issues/6302
2021-09-24 15:38:25 -04:00
Marcelo Moreira de Mello
471f47cd9e Merge pull request #11093 from ansible/receptor_control_service_tls
Introduce the control-service TLS support on receptor
2021-09-24 12:26:19 -04:00
Rebeccah Hunter
e5dbb592fa Merge pull request #11074 from rebeccahhh/no_duplicate_uuids
prevent duplicate UUIDs from being created and allow users to update hostnames based on uuid
2021-09-24 11:52:55 -04:00
Shane McDonald
44466a3e76 Merge pull request #11077 from shanemcd/nightly-receptorctl
Install receptorctl from new nightly url
2021-09-24 11:40:29 -04:00
Wambugu “Innocent” Kironji
d6ef84e9e2 Merge pull request #11122 from nixocio/ui_issue_10942
Update empty survey list
2021-09-24 10:40:41 -04:00
Shane McDonald
c4d8485c81 Update license test to work with http(s) urls in requirements files 2021-09-24 10:16:11 -04:00
Shane McDonald
dbb1a0c733 Install receptorctl from new nightly url
We ran into problems with our offline builds with our usage of PBR + subdirectory
2021-09-24 09:59:12 -04:00
Alan Rominger
b5dee61e57 Delete wording that we have reversed position on (#11129) 2021-09-24 09:38:48 -04:00
Kersom
2c7d9320e2 Merge pull request #11125 from nixocio/ui_remove_component
Remove unused component VariablesInput
2021-09-23 17:10:01 -04:00
Alex Corey
fd3a82d430 Merge pull request #11123 from AlexSCorey/11028-MeshFix
Removes receptor instances from select option on metrics screen
2021-09-23 16:16:38 -04:00
nixocio
3a776ccbff Update empty survey list
Update empty survey list to be as the remaining lists.

See: https://github.com/ansible/awx/issues/10942
2021-09-23 15:32:15 -04:00
kialam
f96ed11a87 Merge pull request #11107 from kialam/fix-10785-ee-revert-button
Wrap ExecutionEnv Lookup in SettingGroup component.
2021-09-23 14:17:45 -04:00
Alex Corey
86f8ced486 Removes receptor instances from select option on metrics screen 2021-09-23 14:17:26 -04:00
nixocio
940f055412 Remove unused component VariablesInput
Remove unused component VariablesInput

See: https://github.com/ansible/awx/pull/11102/files
2021-09-23 13:54:56 -04:00
Kia Lam
d7f1f0c7e6 Remove validation and unused vars for EE Lookup. 2021-09-23 10:23:51 -07:00
Marcelo Moreira de Mello
045785c36f Refactored get_conn_type() method to use Enum 2021-09-23 10:51:50 -04:00
Marcelo Moreira de Mello
45600d034d Initial StreamTLS support for receptor nodes 2021-09-23 10:50:17 -04:00
Alex Corey
33c7f0b5fc Merge pull request #11104 from AlexSCorey/8826-ErroneousFormValidation
Prevents form validation on cancel button click
2021-09-23 10:01:35 -04:00
Alan Rominger
62e9e7ea80 Avoid setting controller_node to an execution node for container jobs (#11117) 2021-09-23 09:16:10 -04:00
Kersom
a75c10f447 Merge pull request #11115 from nixocio/ui_issue_11111
Fix broken link for inventory
2021-09-22 16:47:29 -04:00
nixocio
ee4b47595a Fix broken link for inventory
Fix broke link for inventory

See: https://github.com/ansible/awx/issues/11111
2021-09-22 14:43:52 -04:00
Kersom
9be8fba63d Merge pull request #11102 from AlexSCorey/11099-ExtraVarsPopOut
Adds Popout for extra vars on Job Details view
2021-09-22 13:17:14 -04:00
Alex Corey
15f41a0f16 Prevents form validation on cancel button click 2021-09-22 11:09:39 -04:00
Kia Lam
f06eb5e2f1 Wrap ExecutionEnv Lookup in SettingGroup component. 2021-09-21 18:51:48 -07:00
Rebeccah
a9f4011a45 defensive code for getting instance added, also simplified nested if
statements, rewrote some comments add a logger warning that the instance is being grabbed by the hostname and not the UUID
2021-09-21 16:54:11 -04:00
Rebeccah
55f2125a51 if the user provides a uuid and it exists, allow that to tie to the instance, which allows the user to update the instance based on the UUID (includeding updating the hostname) should they choose to do so. 2021-09-21 16:54:11 -04:00
Sarah Akus
b41f90e7d4 Merge pull request #11090 from AlexSCorey/10952-AddHealthCheckOnInstancesList
Adds Health Check functionality to instance list
2021-09-21 16:38:22 -04:00
Wambugu “Innocent” Kironji
7c707ede2b Merge pull request #11096 from AlexSCorey/10945-DisplayCurrentConvergenceData
Fixes convergence data value on node edit mode
2021-09-21 16:26:16 -04:00
Alex Corey
4df9f9eca0 Adds Health Check functionality to instance list 2021-09-21 16:10:26 -04:00
Alex Corey
6af27fffbc Adds popout for extra vars on Job Details view 2021-09-21 14:42:08 -04:00
Alex Corey
a7ed9c5ff6 Fixes convergence data value on node edit mode 2021-09-21 14:39:09 -04:00
Sarah Akus
51b45c4fac Merge pull request #11097 from nixocio/ui_issue_11061
Fix worfklow node info
2021-09-21 14:35:52 -04:00
nixocio
313de35e60 Fix worfklow node info
Fix workflow node info.

See: https://github.com/ansible/awx/issues/11061
Also: https://github.com/ansible/awx/issues/10628
2021-09-20 15:42:31 -04:00
Alan Rominger
0ac3a377fd Make some needed updates to docker-refresh target (#11089) 2021-09-17 09:11:52 -04:00
Alan Rominger
1319fadc60 Fix overwrite bug where hosts with no instance ID var are re-created (#10910)
* Write tests to assure air-tightness of overwrite

* Candidate fix for group overwrite air-tightness

* Another proposed fix for the id mapping

* Further double down on tracking old instance_id

* Separate unchanging data case and fix some test issues

* parametrize final confusion test

* cut down some more on test cases and fix bug with prior fix

* Rewrite of _delete_host code sharing with update method

This is a start-to-finish rewrite of the host overwrite bug fix
this method is much more conservative,
it does this by keeping the overall code structure where hosts
are deleted before host updates are made

To fix the bug, we share code between the method that deletes hosts
and the method that updates the hosts
A data structure is created and passed to both methods

By having both methods use the same data structure which maps
the in-memory hosts to DB hosts, we assure that the deletions
will ONLY delete hosts that will not be updated
2021-09-16 15:29:57 -04:00
Bianca Henderson
181bda51ce Merge pull request #11081 from sean-m-sullivan/schedule_credentials
add credentials option to schedules
2021-09-16 13:19:58 -04:00
Alan Rominger
e914c23c42 Pass --delete flag to worker for execution node cleanup (#11078)
* Pass --delete flag to worker for execution node cleanup

* Remove the pdd_wrapper_ directory
2021-09-16 11:21:41 -04:00
Bianca Henderson
c1587b25b8 Merge pull request #11064 from beeankha/new_way_to_auth_for_exec_nodes
Enable Jobs to Run on Execution-Only Nodes Via EEs from Protected Registries
2021-09-16 11:20:33 -04:00
Hideki Saito
9e74ac24fa Fixed Org mapping behavior with SAML when Ansible Galaxy cred does not exist
- Fixes #10879
- Fixes ansible/tower#5061

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-09-16 23:25:50 +09:00
beeankha
48eb06f320 Add verify_ssl to container_auth_data params 2021-09-16 09:49:53 -04:00
Alex Corey
65ba87e71f Merge pull request #11069 from AlexSCorey/10951-InstanceDetailsandHealthCheck
This adds Instance Details view
2021-09-16 09:38:27 -04:00
sean-m-ssullivan
f92924d57e add credentials option to schedules 2021-09-16 08:47:00 -04:00
Alex Corey
eeb0feabc0 Adds the Instance Details view with the health check functionality 2021-09-15 14:20:30 -04:00
beeankha
ac8b49b39d Change the way auth info is passed to Runner for EEs pulled from protected registries 2021-09-15 08:49:28 -04:00
Jim Ladd
1b50db26b6 Explicitly pass in UUID to get_or_register
Co-authored-by: Alan Rominger <arominge@redhat.com>
2021-09-14 10:58:29 -07:00
sezanzeb
cbe612baa5 add credential file support
Signed-off-by: sezanzeb <proxima@sezanzeb.de>
2021-09-12 17:58:49 +02:00
Alex Corey
1f34d4c134 Merge pull request #11029 from AlexSCorey/10070-translateMetrics
Translates the UI strings on the metrics pages
2021-09-10 14:46:14 -04:00
Christian Adams
f864335463 Merge pull request #11066 from ansible/i18n_devel_translations
UI translation strings for devel branch
2021-09-10 14:30:58 -04:00
Alex Corey
47970d3455 Translates the UI strings on the metrics pages 2021-09-10 11:57:38 -04:00
Bianca Henderson
6cdaacdda3 Merge pull request #11062 from john-westcott-iv/collection_version_change
Collection version change
2021-09-10 10:13:37 -04:00
beeankha
9b66bda8b9 Fix pep8 error 2021-09-10 09:20:44 -04:00
Kersom
ef354ca1e6 Merge pull request #11065 from nixocio/ui_linguirc
Minor update linguirc
2021-09-10 08:54:35 -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
b9758f5c1a Adding unit test for no header response 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
Christian M. Adams
7860eb529f Localization: fix dynamic vars in fr .po files 2021-09-09 19:08:04 -04:00
nixocio
49c2a38437 Minor update linguirc
Minor update linguirc
2021-09-09 17:57:29 -04:00
ansible-translation-bot
d4bf238173 UI translation strings for devel branch 2021-09-09 17:05:23 -04:00
Sarah Akus
c085397bcb Merge pull request #11023 from nixocio/ui_issue_10933
Show button to cancel inventory source sync
2021-09-09 14:16:07 -04:00
nixocio
58fab2530f Show button to cancel inventory source sync
Show button to cancel inventory source sync.

See: https://github.com/ansible/awx/issues/10933
Also: https://github.com/ansible/awx/issues/10991
2021-09-09 14:04:10 -04:00
Sarah Akus
287b32870e Merge pull request #11014 from kialam/add-node-type-to-associate-modal
Add instance node type to associate modal.
2021-09-09 10:17:12 -04:00
Alan Rominger
46ac9506e6 Assure consistent ordering with default IG first (#11034)
* Assure consistent ordering with default IG first

* Write conditional a little more defensively to pass tests
2021-09-08 11:11:46 -04:00
Elijah DeLee
19ccfcff9a Merge pull request #10988 from ansible/more-receptor-sos
List dir where receptor socket should be
2021-09-08 10:43:48 -04:00
Christian Adams
f8a08c8a5e Merge pull request #11035 from rooftopcellist/build_app_image_docs
Update image variable name for awx-operator app image docs
2021-09-08 09:32:14 -04:00
Christian M. Adams
6f7fe8f9f9 Update image variable name for awx-operator app image docs
Signed-off-by: Christian M. Adams <chadams@redhat.com>
2021-09-07 17:07:47 -04:00
Kersom
86b41a4887 Merge pull request #11011 from nixocio/ui_issue_10971
Add strings to be translated
2021-09-03 17:12:14 -04:00
Sarah Akus
3786693078 Merge pull request #10978 from AlexSCorey/10973-fix
Fixes translation issue on Schedule Form
2021-09-03 16:42:23 -04:00
Alan Rominger
6a17e5b65b Allow manually running a health check, and make other adjustments to the health check trigger (#11002)
* Full finalize the planned work for health checks of execution nodes

* Implementation of instance health_check endpoint

* Also do version conditional to node_type

* Do not use receptor mesh to check main cluster nodes health

* Fix bugs from testing health check of cluster nodes, add doc

* Add a few fields to health check serializer missed before

* Light refactoring of error field processing

* Fix errors clearing error, write more unit tests

* Update health check info in docs

* Bump migration of health check after rebase

* Mark string for translation

* Add related health_check link for system auditors too

* Handle health_check cluster node timeout, add errors for peer judgement
2021-09-03 16:37:37 -04:00
Elijah DeLee
169c0f6642 Merge pull request #11022 from kdelee/try-localhost
Set python to ansible_playbook_python on hosts
2021-09-03 15:48:33 -04:00
Elijah DeLee
054569da70 emulate workaround present in demo inventory
see 9d000a76de

This change works around the fact that the presumed correct python3 for rhel8 (which the EE is based on)
is not the python3 that ansible-playbook is using, and is not where the python dependencies are installed.
2021-09-03 15:21:34 -04:00
Elijah DeLee
4a6ab622df Update inventory.py 2021-09-03 15:20:10 -04:00
nixocio
07cc75f6d4 Add strings to be translated
Add strings to be translated

See: https://github.com/ansible/awx/issues/10971
2021-09-03 15:15:12 -04:00
Bianca Henderson
7fc8775654 Merge pull request #11018 from beeankha/node_type_on_ping
Add Node Type Information to /api/v2/ping Endpoint
2021-09-03 15:01:49 -04:00
beeankha
41a6473782 Sort instance groups by name regardless of upper/lower case 2021-09-03 13:52:12 -04:00
Jim Ladd
f39834ad82 pass uuid to Instance.create 2021-09-03 10:05:15 -07:00
Jim Ladd
bdb13343bb remove unused import 2021-09-03 10:05:15 -07:00
Jim Ladd
262cd3c695 set default uuid 2021-09-03 10:05:15 -07:00
Jim Ladd
f02099e8b7 provision_instance should create new uuid if needed
.. instead of default to current system's UUID

related: #10990
2021-09-03 10:05:15 -07:00
Kersom
7bf3ee69ef Merge pull request #10987 from nixocio/ui_issue_9013
Add websockets to Inventory Source Details
2021-09-03 12:37:53 -04:00
Kia Lam
41e837d1e2 Properly mark strings for translation. 2021-09-03 12:36:04 -04:00
beeankha
2090e46ac2 Add node_type to api/v2/ping/ endpoint 2021-09-03 11:25:05 -04:00
Kersom
f09ee33e6c Merge pull request #10994 from nixocio/ui_issue_10966
Add string `Filter By` to be translated
2021-09-03 11:19:40 -04:00
Alan Rominger
22782f8c5f Add wording about expectations for enabled status and default group (#10993)
* Add wording about expections for enabled status and default group

* fix pluralization

Co-authored-by: Alex Corey <acorey@redhat.com>

* Correct grammar mistake

Co-authored-by: Alex Corey <acorey@redhat.com>
2021-09-03 10:35:29 -04:00
Alex Corey
e61e7df54e Moved the entirety of the field label to the parent component to improve translation 2021-09-03 09:57:19 -04:00
Jake McDermott
baf37e94eb Merge pull request #11003 from AlexSCorey/5252-tower-Settings-deprecation
Adds deprecation banner
2021-09-03 09:04:11 -04:00
Kia Lam
bba2a264ea Add instance node type to associate modal. 2021-09-02 20:01:03 -04:00
Alex Corey
324ca7fe72 Merge pull request #11013 from nixocio/ui_issue_10977
Display finished date once the job is finished
2021-09-02 16:44:15 -04:00
nixocio
fb5394e31c Display finished date once the job is finished
Display finished date once the job is finished.

See: https://github.com/ansible/awx/issues/10977
2021-09-02 13:27:02 -04:00
nixocio
53baea4c6c Add websockets to Inventory Source Details
Add websockets to Inventory Source Details

See: https://github.com/ansible/awx/issues/9013
2021-09-02 10:35:08 -04:00
Alex Corey
35a51b393a Adds deprecation banner 2021-09-02 10:14:00 -04:00
kialam
9ee9de76b5 Merge pull request #11001 from kialam/fix-instance-list-name-sort
Sort instance by hostname instead of name.
2021-09-02 09:51:56 -04:00
Alex Corey
ae15dcaf0b Merge pull request #10958 from AlexSCorey/10557-NotificationValidation
Fixes validation issues associated with the Notification Form
2021-09-02 09:49:02 -04:00
Alan Rominger
eb0528c157 dev environment - change location of receptor socket and sync awx and receptor nodes function (#11005)
* Change the location of the receptor socket

to /var/run/awx-receptor, to match what the installer is currently doing.

* Sync awx and receptor nodes for control socket

Co-authored-by: Jeff Bradberry <jeff.bradberry@gmail.com>
2021-09-02 09:18:25 -04:00
nixocio
764089e493 Add string Filter By to be translated
Add string `Filter By` to be translated

See:https://github.com/ansible/awx/issues/10966
2021-09-02 09:02:56 -04:00
Kersom
77e704cef1 Merge pull request #11007 from rooftopcellist/rm-add-locale
Remove deprecated lingui add-locale cmd
2021-09-02 08:52:09 -04:00
Christian M. Adams
59ce1bba16 Remove deprecated lingui add-locale cmd 2021-09-01 16:53:30 -04:00
Alan Rominger
1d3a36d821 Fix the hostname of execution nodes in dev environment (#10992) 2021-09-01 13:35:39 -04:00
Kia Lam
dc0d74ca2c Sort instance by hostname instead of name. 2021-09-01 13:20:25 -04:00
kialam
ef36d7c87f Merge pull request #10927 from kialam/feature-10853-control-node-read-only
Disable checkbox for instances with node type control.
2021-09-01 09:30:37 -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
Alan Rominger
5a6e9a06e2 Exclude control-only nodes from IG policy calculations (#10985)
* Exclude control-only nodes from IG policy calculations

Also, as a reverse to this, exclude execution-only nodes from
  the calculations if the group in question is the controlplane

* Incorporate review comments
2021-09-01 08:09:46 -04:00
Chris Meyers
9083425c24 Merge pull request #10940 from chrismeyersfsu/doc-debug-slow-api
add docs for debugging slow api endpoint
2021-08-31 16:30:21 -04:00
Chris Meyers
010f5031a7 grammar 2021-08-31 16:17:48 -04:00
Alex Corey
40e5b70495 Fixes validation issues associated with the Notification Form 2021-08-31 14:35:50 -04:00
Marcelo Moreira de Mello
9588ff3b4f Merge pull request #10965 from tchellomello/fix_ldap_dn
Associates ldap_dn on a first User() login
2021-08-31 14:25:26 -04:00
Sarah Akus
30cf483357 Merge pull request #10982 from keithjgrant/json-deterministic-order
Ensure deterministic order of JSON serializing for misc auth settings
2021-08-31 14:14:19 -04:00
Sarah Akus
4d1fa4d262 Merge pull request #10959 from AlexSCorey/10642-MisalignedTableHeaders
Fixes misalignment on template list and advanced search Key dropdown bug
2021-08-31 13:08:46 -04:00
Elijah DeLee
ac40449d6e List dir where receptor socket should be
This is for adding more info to the sos report
2021-08-31 12:52:34 -04:00
Alan Rominger
dc4b014d12 Make status command in error handling cleaner (#10823) 2021-08-31 12:02:39 -04:00
Kersom
d129928e42 Merge pull request #10920 from nixocio/ui_issue_10827
Update Workflow Node Convergence
2021-08-31 11:05:01 -04:00
Alan Rominger
573b2bc44f Redefine execution plane (#10979) 2021-08-31 10:33:14 -04:00
Tiago Góes
c095f0fc19 Merge pull request #10909 from keithjgrant/6613-job-output-collapsing
Refactor Job Output component
2021-08-31 10:43:22 -03:00
Shane McDonald
ae06e9cb14 Merge pull request #10981 from kdelee/receptor_sos
Capture /etc/receptor in sos report
2021-08-30 19:56:11 -04:00
Keith J. Grant
73af95f55e set a deterministic order of JSON serializing for misc auth settings 2021-08-30 16:26:38 -07:00
nixocio
64d9a7983b Update Workflow Node Convergence
Update when `All` is displayed when editing the workflow node.

See: https://github.com/ansible/awx/issues/10827
2021-08-30 17:34:12 -04:00
Elijah DeLee
f6d14564a2 Capture /etc/receptor in sos report
this will help with debugging so we can know what receptor's configuration was
at the time the sos report was collected
2021-08-30 17:04:35 -04:00
Shane McDonald
6c266b47e6 Merge pull request #10964 from shanemcd/more-ansible-please
Automate release process and changelog generation
2021-08-30 16:02:15 -04:00
Jeff Bradberry
a2b984a1a5 Validate that control-only Instance nodes cannot change IG membership 2021-08-30 16:00:23 -04:00
Shane McDonald
0a7945a911 Remove unnecessary usage of set_fact. Thanks @samdoran! 2021-08-30 15:12:39 -04:00
Shane McDonald
9c3e78443b Hide the ugly parts in a custom action 2021-08-30 15:12:15 -04:00
Alan Rominger
68f79a1f3a Always use controlplane as project update backup IG (#10949)
* Always use controlplane as project update backup IG

Before, this was done conditionally to container_group jobs
this logic changes it so that controlgroup will always be a
firm backstop for project updates

* Code a little more defensively to make unit tests pass

* Fix unit tests
2021-08-30 14:23:09 -04:00
Jake McDermott
b00e5876d4 Merge pull request #10972 from quasd/devel
Check dynamic_input fields also with has_input()
2021-08-30 14:09:10 -04:00
Alex Corey
7481d20261 Fixes misalignment on template list and advanced search Key dropdown bug 2021-08-30 13:15:05 -04:00
quasd
637d6173bc Check dynamic_input fields also with has_inputs() - Fixes,
using credential plugins in Container Registry credential,
with execution environments

Signed-off-by: quasd <qquasd@gmail.com>
2021-08-30 16:10:34 +03:00
Marcelo Moreira de Mello
e23e634974 Associate ldap_dn on a first User() login
To avoid calling the user.save() on every single login (PR#9703)
we can check if the user.profile is available. For new users,
accessing the user.profile throws an ValueError exception which
is capture on this fix.

Example:
----
>>> _ = user.profile
*** ValueError: save() prohibited to prevent data loss due to unsaved related object 'user'.
>>> User.objects.filter(username=user.username).count()
0

This way, the user.save() gets called for brand users and will get the
ldap_dn associated as expected.
2021-08-29 22:02:00 -04:00
Shane McDonald
1c65fbaae3 Update old changelog document to point to releases page. 2021-08-29 15:54:00 -04:00
Shane McDonald
dc0cc0f910 Automate release process and changelog generation 2021-08-29 13:58:51 -04:00
Alan Rominger
424dbe8208 Use ansible-runner imports for cpu and memory calculation (#10954)
* Use ansible-runner imports for cpu and memory calculation

* Fix bug with capacity and memory adjustment
2021-08-27 21:46:53 -04:00
Alex Corey
db34423af8 Merge pull request #10950 from AlexSCorey/10947-fix
Fixes erroneous pluralization from rrule
2021-08-27 16:20:05 -04:00
Alex Corey
ca76f4db0c Fixes erroneous pluralization from rrule 2021-08-27 15:56:28 -04:00
Alan Rominger
711e5e09ba Delete images by id instead of tag in docker-refresh (#10957) 2021-08-27 11:51:58 -04:00
Alex Corey
6001bd5446 Merge pull request #10921 from AlexSCorey/tower_5194_fix
Properly marks string for translation and removes unused component
2021-08-26 16:43:52 -04:00
Alex Corey
02f60467d7 Properly marks string for translation and removes unused component 2021-08-26 16:23:32 -04:00
Sarah Akus
cdce745c55 Merge pull request #10798 from keithjgrant/7834-advanced-search-fix
Only allow legal/logical match types in advanced search
2021-08-26 14:39:40 -04:00
Jim Ladd
467a37f8fe use settings.DEFAULT_EXECUTION_QUEUE_NAME in lieu of default 2021-08-26 11:15:14 -07:00
Jim Ladd
88a6412b54 only need to update IG's policy_instance_list field 2021-08-26 11:15:14 -07:00
Jim Ladd
502eaf9fb9 handle case where default IG does not exist
* also, only add discovered execution node to default group
  if `register`-ing the node actually resulted in a confirmed
  change
2021-08-26 11:15:14 -07:00
Jim Ladd
de8eab0434 inspect_execution_nodes should *not* block when retreiving lock
* would otherwise hold up cluster heartbeat task
* furthermore, only really need one node to run through
  `inspect_execution_nodes` each interval
2021-08-26 11:15:14 -07:00
Jim Ladd
f317fca9e4 add auto-discovered nodes to default IG
* add advisory_lock to avoid IG update race logic
* update IG by way of policy_instance_list
2021-08-26 11:15:14 -07:00
Jim Ladd
561fc289fb disable discovered instances by default 2021-08-26 11:15:14 -07:00
Jim Ladd
77933e97c0 create default IG when bringing up dev env 2021-08-26 11:15:14 -07:00
Alan Rominger
ee4792dbf8 Add an option to create a cluster with control-only nodes (#10946) 2021-08-26 13:37:13 -04:00
Kia Lam
cde0df937f Filter out instances with node_type equal to 'control'. 2021-08-26 12:47:43 -04:00
Alan Rominger
daf4310176 Clean up work_type processing and fix execution vs control capacity (#10930)
* Clean up added work_type processing for mesh_code branch

* track both execution and control capacity

* Remove unused execution_capacity property

* Count all forms of capacity to make test pass

* Force jobs to be on execution nodes, updates on control nodes

* Introduce capacity_type property to abstract some details out

* Update test to cover all job types at same time

* Register OpenShift nodes as control types

* Remove unqualified consumed_capacity from task manager and make unit tests work

* Remove unqualified consumed_capacity from task manager and make unit tests work

* Update unit test to execution vs control TM logic changes

* Fix bug, else handling for work_type method
2021-08-26 07:24:14 -04:00
Alex Corey
fb0e55fd1b Merge pull request #10934 from AlexSCorey/10925-WrongDeleteModal
Fixes issue where the wrong text appeared in modal
2021-08-25 11:45:20 -04:00
Alex Corey
2e5ef22585 Fixes issue where the wrong text appeared in modal 2021-08-25 09:27:17 -04:00
Chris Meyers
8e043b139a add docs for debugging slow api endpoint 2021-08-25 09:09:19 -04:00
Alan Rominger
e7dbe90cb5 Merge pull request #10727 from ansible/mesh_code
Code changes to support execution-only nodes in receptor mesh
2021-08-24 13:39:19 -04:00
Alan Rominger
42484cf98d Obtain receptor sockfile from the receptor.conf file (#10932) 2021-08-24 11:20:21 -04:00
Shane McDonald
274e487a96 Attempt to surface streaming errors that were being eaten (#10918) 2021-08-24 10:33:00 -04:00
Alan Rominger
940c189c12 Corresponding AWX changes for runner --worker-info schema update (#10926) 2021-08-24 08:41:36 -04:00
Alan Rominger
c3ad479fc6 Minor tweaks for the mesh_code branch from review (#10902) 2021-08-24 08:41:35 -04:00
Alan Rominger
928c35ede5 Model changes for instance last_seen field to replace modified (#10870)
* Model changes for instance last_seen field to replace modified

* Break up refresh_capacity into smaller units

* Rename execution node methods, fix last_seen clustering

* Use update_fields to make it clear save only affects capacity

* Restructing to pass unit tests

* Fix bug where a PATCH did not update capacity value
2021-08-24 08:41:35 -04:00
beeankha
1a9fcdccc2 Change place where controller node is being looked for in the task manager 2021-08-24 08:41:35 -04:00
Alan Rominger
3b1e40d227 Use the ansible-runner worker --worker-info to perform execution node capacity checks (#10825)
* Introduce utilities for --worker-info health check integration

* Handle case where ansible-runner is not installed

* Add ttl parameter for health check

* Reformulate return data structure and add lots of error cases

* Move up the cleanup tasks, close sockets

* Integrate new --worker-info into the execution node capacity check

* Undo the raw value override from the PoC

* Additional refinement to execution node check frequency

* Put in more complete network diagram

* Followup on comment to remove modified from from health check responsibilities
2021-08-24 08:41:35 -04:00
Alan Rominger
4e84c7c4c4 Use the existing get_receptor_ctl method (#10813) 2021-08-24 08:41:35 -04:00
Alan Rominger
f47eb126e2 Adopt the node_type field in receptor logic (#10802)
* Adopt the node_type field in receptor logic

* Refactor Instance.objects.register so we do not reset capacity to 0
2021-08-24 08:41:34 -04:00
Alan Rominger
5d4ab13386 Add topology of docker-compose to docs, remove old mount (#10773) 2021-08-24 08:41:34 -04:00
Alan Rominger
b53d3bc81d Undo some things not compatible with hybrid node hack (#10763) 2021-08-24 08:41:34 -04:00
Alan Rominger
46ccc58749 Make the AWX nodes fully connected in the development environment (#10758) 2021-08-24 08:41:34 -04:00
Alan Rominger
289beb85d2 Add developer docs for incoming receptor mesh features (#10747)
* Add developer docs for incoming receptor mesh features

* Additional wording about the receptor mesh process

* Wrap up docs feedback changes and polishing

* Add in way more terminology introductions, delete statement about past

* Fix typo around OCP-incluster type
2021-08-24 08:41:34 -04:00
Shane McDonald
460c7c3379 Allow for dynamically scaling automation mesh in dev env 2021-08-24 08:41:32 -04:00
Alan Rominger
9881bb72b8 Treat the awx_1 node as a hybrid node for now, use local work type (#10726) 2021-08-24 08:40:21 -04:00
beeankha
264c560a8a Template docker receptor yaml file, update Makefile to reflect this change 2021-08-24 08:40:21 -04:00
beeankha
2fc581c249 Pull in user's uid vs hardcode to 1000 2021-08-24 08:40:20 -04:00
Jim Ladd
a79d7444e5 set userid to 1000 (#10714) 2021-08-24 08:40:20 -04:00
beeankha
f8d074db01 Point to correct config file for execution_node_1 2021-08-24 08:40:20 -04:00
Bianca Henderson
c3843004aa Update docker-compose (#10664)
* Update docker-compose

- Deploys 1 control and 1 execution node

* Add a new Receptor cluster configuration file

* update receptor peer to awx_1
to match how hop node is configured in cluster (Jim Ladd's commit)

* Move receptor_1 instantiation in the docker-compose setup

* Hard code receptor_1 name

* Update execution node name, move standalone conf file to docker-compose directory

* Reformat docker-compose file, mount another volume, change privileges
2021-08-24 08:40:20 -04:00
Alan Rominger
f597205fa7 Run capacity checks with container isolation (#10688)
This requires swapping out the container images
  for the execution nodes from awx-ee to the awx image

For completeness, the hop node image is switched to the raw
  receptor image

A few outright bugs are fixed here
  memory calculation just was not right at all
  the execution_capacity calculation was reverse of intention

Drop in a few TODOs about error handling from debugging
2021-08-24 08:40:19 -04:00
Alan Rominger
e7be86867d Fix rebase bug specific to ad hoc commands 2021-08-24 08:40:19 -04:00
Alan Rominger
13300bdbd4 Update rebase to keep old control plane capacity check
Also do some basic work to separate control versus execution capacity
  this is to assure that we don't send jobs to the control node
2021-08-24 08:40:19 -04:00
Alan Rominger
b09da48835 Remove some diff that we dont want from PoC 2021-08-24 08:40:19 -04:00
Alan Rominger
39e23db523 Make minor changes to add needed imports 2021-08-24 08:40:19 -04:00
Alan Rominger
b10a8b0fa9 Initial functionality tweaks 2021-08-24 08:40:18 -04:00
Ryan Petrello
05cb876df5 implement an initial development environment for receptor-based clusters 2021-08-24 08:40:18 -04:00
Kersom
4a271d6897 Merge pull request #10928 from mabashian/deps-audit-autofix
Auto fix dep audit
2021-08-24 08:34:14 -04:00
mabashian
41342883d4 Auto fix dep audit 2021-08-23 16:12:54 -04:00
Kia Lam
cc7488bc15 Disable checkbox for instances with node type control. 2021-08-23 15:06:36 -04:00
Jake McDermott
367e0a5e87 Merge pull request #10917 from AlexSCorey/10223-InventorySourceData
Adds source data to job list and job details view
2021-08-20 15:44:17 -04:00
Kersom
4a2917b6a0 Merge pull request #10859 from nixocio/ui_issue_warning_session
Remove warning for SSO session when logging in
2021-08-20 14:23:30 -04:00
kialam
c6a63d01db Merge pull request #10898 from kialam/fix-10718-null-datetime
Validate that start/end datetime creates at least 1 schedule.
2021-08-20 13:42:53 -04:00
nixocio
0694cb9a7d Remove warning for SSO session when logging in
Remove warning for SSO session when logging in

See: https://github.com/ansible/awx/issues/10860
2021-08-20 11:25:10 -04:00
Kia Lam
da2bf4c510 Validate that start/end datetime creates at least 1 schedule. 2021-08-19 18:39:05 -04:00
Alex Corey
48a044cc68 Adds source data to job list and job details view 2021-08-19 14:11:44 -04:00
Shane McDonald
b7c0f02cb1 Merge pull request #10915 from rooftopcellist/fix-make-target
Add new COMPOSE_UP_PRE_OPTS variable to docker-compose up target
2021-08-19 13:04:23 -04:00
Christian M. Adams
a76194c493 Add new COMPOSE_OPTS variable to docker-compose up target
Signed-off-by: Christian M. Adams <chadams@redhat.com>
2021-08-19 12:43:16 -04:00
Alex Corey
86390152bc Merge pull request #10907 from AlexSCorey/10872-ApprovalNodeValidation
properly validates node
2021-08-19 09:09:02 -04:00
Alexander Komarov
899d36b2c9 Fix tests 2021-08-19 15:20:52 +05:00
Alexander Komarov
530977d6b3 Set default value is 0 for idle_timeout 2021-08-19 15:18:38 +05:00
Alexander Komarov
aa682fa2c9 Add idle_timeout setting to job settings 2021-08-19 14:48:29 +05:00
Alex Corey
28ad404baa properly validates node 2021-08-18 15:46:50 -04:00
Tiago Góes
1ff8ebab94 Merge pull request #10892 from guyomog78/patch-1
fix typo Bienvenue French logon  screen
2021-08-18 14:57:41 -03:00
Bianca Henderson
c616678beb Merge pull request #10903 from beeankha/misc_collections_updates
Fix Test Playbooks, Update README, Make Module Docs More Informative
2021-08-18 12:41:38 -04:00
Keith J. Grant
500d407099 delete duplicate prop 2021-08-18 09:17:41 -07:00
Keith J. Grant
b99129c6b2 stub notifications api in test 2021-08-18 09:17:40 -07:00
Keith J. Grant
60f1919791 update searchableKeys in all Lookups & JobOutput 2021-08-18 09:17:40 -07:00
Keith J. Grant
262a2b70e2 update all lists to use getSearchableKeys helper 2021-08-18 09:17:40 -07:00
Keith J. Grant
977164b920 cleanup tests/advanced search changes 2021-08-18 09:12:21 -07:00
Keith J. Grant
a0df379225 limit advanced search options by field type 2021-08-18 09:12:21 -07:00
Keith J. Grant
b5bc9bb3f4 JobOutput: extract multiple helper functions 2021-08-18 08:54:35 -07:00
Keith J. Grant
b5708a8cc4 Revert "JobOutput: extract JobOutputPane"
This reverts commit 903de92969bf931cf0c01eb2fbfb703842c5ea83.
2021-08-18 08:54:35 -07:00
Keith J. Grant
c8604c73a9 JobOutput: extract JobOutputPane 2021-08-18 08:54:35 -07:00
Keith J. Grant
949c2b92af JobOutput: extract helper funcs into separate file 2021-08-18 08:54:35 -07:00
Keith J. Grant
5473e54219 JobOutput: extract JobOutputSearch bar 2021-08-18 08:54:35 -07:00
Shane McDonald
aefc28a0ed Update README.md 2021-08-18 09:45:00 -04:00
Shane McDonald
f102b0ccf9 Add support for running CI checks directly on devel branch 2021-08-18 09:31:39 -04:00
Shane McDonald
55e37f6229 Update ci.yml 2021-08-18 09:07:30 -04:00
beeankha
ad0dc028f2 Update README with recent Collections changes 2021-08-18 09:04:09 -04:00
Jim Ladd
e3893b1887 do not collect artifact_data when gathering analytics
- also, store event_data in jsonb object
- .. in order to have data structure that supports '-' operator
2021-08-17 14:55:16 -07:00
beeankha
c89296e76d Update integration test playbooks to work with most current Collections modules 2021-08-17 13:50:35 -04:00
Tiago Góes
c58fef949d Merge pull request #10849 from nixocio/ui_issue_10775_again
Update useBrandName
2021-08-16 18:44:16 -03:00
Tiago
26ab6dd264 Fix broken test 2021-08-16 18:29:59 -03:00
Tiago Góes
abf870e604 Merge pull request #10885 from gruselglatz/patch-1
Update Readme.md
2021-08-16 16:58:32 -03:00
guyomog78
a83aa7c0ae fix typo Bienvenu French logon screen 2021-08-16 19:08:19 +02:00
kialam
82fe099060 Merge pull request #10783 from kialam/fix-10587-managed-job-time
Fix 10587 managed job time
2021-08-16 12:18:34 -04:00
Kia Lam
304ec80d80 Convert dates to use luxon.js 2021-08-16 08:31:30 -07:00
Bianca Henderson
f6104dd438 Merge pull request #10888 from beeankha/update_collection_runtime_file
Update runtime.yml to Include Ansible Version Requirement
2021-08-16 10:36:46 -04:00
beeankha
7fadc00fb3 Update runtime.yml to include ansible version requirement 2021-08-16 09:23:06 -04:00
herbert
26e5830b80 Update Readme.md
fix path to inventory file
2021-08-16 13:21:19 +02:00
nixocio
efcac6d55a Update useBrandName
Update useBrandName and its usage.

It was verified on downstrean this solution.

See:https://github.com/ansible/awx/issues/10775
2021-08-12 17:05:35 -04:00
Kersom
6a9de16cda Merge pull request #10869 from AlexSCorey/10822-fixReactWarnings
Fixes several react warnings
2021-08-12 12:44:09 -04:00
Alex Corey
9d648edc19 fixes several react warnings 2021-08-12 09:08:40 -04:00
Shane McDonald
9da383fe2d Merge pull request #10866 from ansible/fix-awx-ee-name
Fix name of default awx ee
2021-08-12 08:06:34 -04:00
Elijah DeLee
86600531e2 Fix name of default awx ee
we are now tracking the latest tag
2021-08-11 22:06:56 -04:00
Shane McDonald
7505ecd284 Merge pull request #10865 from shanemcd/19.3.0
Bump version and changelog
2021-08-11 21:02:26 -04:00
Shane McDonald
a22de5a9ee Bump version and changelog 2021-08-11 19:51:06 -04:00
Tiago Góes
514616ad6e Merge pull request #10864 from tiagodread/awxkit
Generate a small random title size on awxkit when necessary
2021-08-11 19:14:19 -03:00
Tiago
4f5909ad21 Generate a small random size when necessary 2021-08-11 18:58:07 -03:00
Shane McDonald
aa98a5b5e1 Merge pull request #10858 from rooftopcellist/devel-receptor-runner
Install receptor and ansible-runner from devel branch
2021-08-11 16:43:13 -04:00
Christian Adams
93ee0a362f Merge pull request #10861 from kdelee/awx-ee-latest
Use awx-ee:latest to get latest receptor and runner
2021-08-11 16:27:18 -04:00
Christian M. Adams
56fd5c435d Install receptor and ansible-runner from devel
Signed-off-by: Christian M. Adams <rooftopcellist@gmail.com>
2021-08-11 16:22:24 -04:00
Tiago Góes
ebe5fff992 Merge pull request #10856 from tiagodread/awxkit
Update awxkit random_title setting non_ascii to False
2021-08-11 14:26:53 -03:00
Tiago
2a56be77b3 fix lint 2021-08-11 14:02:46 -03:00
Tiago
bf70200550 Update awxkit random_title setting non_ascii to False 2021-08-11 13:38:30 -03:00
Elijah DeLee
9b2d2a1856 Use awx-ee:latest to get latest receptor and runner
We are updating the requirements to get the latest receptor and runner in the task container,
we should also have the latest in the EE
2021-08-11 11:36:42 -04:00
Sarah Akus
ec729a3f15 Merge pull request #10820 from AlexSCorey/10654-10739-10740-fix
Host List Expand All and Survey List -> Tables
2021-08-11 09:58:49 -04:00
Alex Corey
34d0595bab adds locators 2021-08-11 09:44:54 -04:00
Alex Corey
b4243c6f03 adds dragging functionality to modal 2021-08-11 09:43:50 -04:00
Alex Corey
0aa82c2784 Adds expand all to Host List, and moved Survey list to table view 2021-08-11 09:43:50 -04:00
Jake McDermott
80053cea83 Merge pull request #10845 from nixocio/ui_add_more_ids
Update Ids for Job Details page
2021-08-10 10:39:28 -04:00
nixocio
100c1cbbce Update Ids for Job Details page
Update Ids for job details page to ease testing.

Also, distinguish between Project and Inventory Source Project.

See: https://github.com/ansible/awx/issues/10786#issuecomment-893658516
2021-08-09 17:05:13 -04:00
Bianca Henderson
1173dca900 Merge pull request #10809 from beeankha/remove_deprecated_params
Remove Collections Module Parameters Deprecated in Controller 4.0.0
2021-08-09 15:33:21 -04:00
Alex Corey
205935bc38 Merge pull request #10703 from AlexSCorey/10683-fixstrings
Marks dashboard chart axis labels for translation
2021-08-09 14:42:40 -04:00
Alex Corey
7025bc2678 marks dashboard chart axis labels for translation 2021-08-09 14:00:13 -04:00
Kersom
6cc6442f0d Merge pull request #10832 from nixocio/ui_issue_8020
Update inventory source sync button on kebab
2021-08-09 11:02:27 -04:00
Alex Corey
071973d89e Merge pull request #10828 from AlexSCorey/10628-ConvergenceData_10549-fix
Addresses permission problem on host group list and adds convergence data to Prompt Detail
2021-08-09 09:24:35 -04:00
Alex Corey
13ddc78b7d Addresses permission problem on host group list and adds convergence data to Prompt Detail 2021-08-09 09:04:22 -04:00
nixocio
bc083089bb Update inventory source sync button on kebab
Update inventory source sync button on kebab

See: https://github.com/ansible/awx/issues/8020
2021-08-06 16:31:07 -04:00
Bianca Henderson
ec66ffb1eb Merge pull request #10826 from beeankha/fix_collection_name_issue
Point to the Correct Name for AAP Within Collections
2021-08-06 14:32:46 -04:00
Kersom
3a6b228f6f Merge pull request #10821 from nixocio/ui_ids
Add Ids to ease tests
2021-08-06 11:41:59 -04:00
beeankha
bc365e2d01 Point to the correct name for AAP within collections 2021-08-06 10:13:06 -04:00
nixocio
e9b9dd3072 Add Ids to ease tests
Add Ids to ease tests.

See: https://github.com/ansible/awx/issues/8680#issuecomment-893663314
2021-08-06 10:12:06 -04:00
Jake McDermott
7b065ae0a0 Merge pull request #10789 from phemmer/patch-1
add minikube to github bug template
2021-08-06 10:04:00 -04:00
Patrick Hemmer
c10d556f17 add minikube to github bug template 2021-08-06 09:36:00 -04:00
Keith Grant
1ea0ff611a Merge pull request #10819 from keithjgrant/8474-hide-search-clear-all
Remove Clear All button in search when filters cleared
2021-08-05 11:20:24 -07:00
Keith J. Grant
92e35978dc remove Clear All button in search when filters cleared 2021-08-05 10:46:43 -07:00
Kersom
8d06c64495 Merge pull request #10772 from nixocio/ui_upgrade_formik
Upgrade formik
2021-08-05 13:14:00 -04:00
nixocio
fe8cd7188c Upgrade formik
Upgrade formik
2021-08-05 10:56:00 -04:00
Kersom
c721fe0b37 Merge pull request #10794 from nixocio/ui_issue_8680
Show PAT as part of bulk delete list
2021-08-05 10:33:09 -04:00
Kersom
ba1f89b9d8 Merge pull request #10796 from nixocio/ui_issue_job_id
Add job id to job details screen
2021-08-05 10:32:24 -04:00
Kersom
d94eba7179 Merge pull request #10810 from nixocio/ui_update_npm_container
Bump npm version inside container
2021-08-05 09:54:45 -04:00
nixocio
f2e8b90628 Bump npm version inside container
Bump npm version inside container

See: https://docs.npmjs.com/cli/v7/configuring-npm/package-lock-json#lockfileversion
2021-08-04 15:34:27 -04:00
Tiago Góes
2f0b5fc20a Merge pull request #10722 from AlexSCorey/10706-DisappearingField
Ensures that field is on screen behind the confirmation modal
2021-08-04 14:21:35 -03:00
Alex Corey
53817d3cbe ensures that field is on screen behind the confirmation modal 2021-08-03 18:08:11 -04:00
Bianca Henderson
c23f7f5bdc Merge pull request #10807 from beeankha/collections_doc_error
Fix Broken Collections Docs
2021-08-03 17:05:29 -04:00
Tiago Góes
4277149a3f Merge pull request #10797 from tiagodread/workflow-e2e
Update workflow to use pull_request_target
2021-08-03 17:31:59 -03:00
Tiago
3ba00c7a72 Add CODEOWNERS for e2e_test.yml 2021-08-03 17:18:47 -03:00
nixocio
0d2bc750e8 Show PAT as part of bulk delete list
* Show PAT as part of bulk delete list
* Update tooltip message in how to create a Personal Access Token

See: https://github.com/ansible/awx/issues/8680
2021-08-03 16:12:46 -04:00
nixocio
97a4122ceb Add job id to job details screen
Add job id to job details screen

See: https://github.com/ansible/awx/issues/10786
2021-08-03 16:11:54 -04:00
Tiago
8b165b333e Update workflow to use pull_request_target 2021-08-03 16:34:42 -03:00
beeankha
ea71fef2bd Add required params to collections docs file 2021-08-03 15:06:53 -04:00
beeankha
9409dc0085 Remove Collections module parameters deprecated in Controller 4.0.0 2021-08-03 14:55:45 -04:00
Tiago Góes
dae3f1a164 Merge pull request #10592 from mabashian/2032-workflow-node-alias
Adds support for workflow node aliasing via identifier field
2021-08-03 15:50:18 -03:00
mabashian
0213fb5412 Fix linting errors 2021-08-03 14:08:00 -04:00
mabashian
a4f263bc92 Fix bug where identifier is undefined 2021-08-03 14:07:56 -04:00
mabashian
231cccbb19 Adds support for workflow node aliasing via identifier field 2021-08-03 14:07:50 -04:00
kialam
791d24bcb6 Merge pull request #10801 from kialam/add-instances-node-type-ui
Add Node Type to Instances page and modify "Type" to "Policy Type."
2021-08-03 14:01:02 -04:00
Kia Lam
729723205f Fix unit tests. 2021-08-03 13:06:35 -04:00
Kia Lam
2474f60e00 Add Node Type to Instances page and modify "Type" to "Policy Type." 2021-08-03 13:06:34 -04:00
Tiago Góes
dbb5715fea Merge pull request #10803 from akus062381/add-ouia-wfjt-survey-prompt
WFJT Prompt- Survey- add OUIA locators for testability
2021-08-03 11:57:07 -03:00
akus062381
86ebce6d3d adding ouiaId locators to Survey Prompt step within Node Prompt Modal for WFJT
adding ouiaId locators to Survey Prompt step within Node Prompt Modal for WFJT
2021-08-03 10:36:24 -04:00
Bianca Henderson
e84a629ada Merge pull request #10788 from beeankha/fix_sanity_errors_collections
Fix Collections Errors
2021-08-03 08:56:43 -04:00
Kersom
1907859827 Merge pull request #10724 from nixocio/ui_issue_10676
Merge ui and ui_next in one dir
2021-08-03 08:33:13 -04:00
beeankha
cf4a68c9b3 Revert "Add required params to deprecated docstrings"
This reverts commit dea2ce6fde.
2021-08-02 23:15:30 -04:00
beeankha
dea2ce6fde Add required params to deprecated docstrings 2021-08-02 20:03:02 -04:00
nixocio
f85b2b6352 Merge ui and ui_next in one dir
Merge ui and ui_next in one dir

See: https://github.com/ansible/awx/issues/10676

Update django .po files

Update django .po files

Run `awx-manage makemessages`.
2021-08-02 10:40:24 -04:00
beeankha
e88e81928c Fix sanity errors for collections 2021-07-30 10:53:44 -04:00
Rebeccah Hunter
d89719c740 Merge pull request #10757 from rebeccahhh/instance_node_type
add a node_type field to the instance model
2021-07-28 17:52:27 -04:00
Jake McDermott
eef80c8875 Merge pull request #10781 from tiagodread/update-e2e-workflow
Use cypress base image from a public repo in quay
2021-07-28 16:51:25 -04:00
Jake McDermott
34bd0588b4 Merge pull request #10777 from nixocio/ui_issue_10775
Update usage of useBrandName
2021-07-28 16:46:18 -04:00
Tiago
bf8d70e657 Use cypress base image from a public repo in quay 2021-07-28 17:39:16 -03:00
Tiago Góes
b349774f92 Merge pull request #10572 from mabashian/790-mgt-jobs-workflow
Add UI support for management jobs in workflows
2021-07-28 16:15:38 -03:00
nixocio
452848ff27 Update usage of useBrandName
useBrandName return variables were updated. Update a few places using
this custom hook.

See: https://github.com/ansible/awx/issues/10775
2021-07-28 14:53:49 -04:00
Sarah Akus
5d345c22b4 Merge pull request #10635 from nixocio/ui_issue_10613
Add extra step to confirm edition of login redirect URL
2021-07-28 14:29:21 -04:00
nixocio
33502daf45 Add extra step to allow edition of login redirect URL
Add extra step to allow edition of login redirect URL

closes: https://github.com/ansible/awx/issues/10613
2021-07-28 12:08:54 -04:00
Jake McDermott
07a4683f08 Merge pull request #10741 from AlexSCorey/10495-ActionBtnOnEmptyState
Improves empty state messages for improve UX
2021-07-28 10:18:49 -04:00
Jake McDermott
e207b424b1 Merge pull request #10768 from nixocio/ui_issue_8593
Remove all groups filter
2021-07-28 10:06:16 -04:00
Jake McDermott
50279478c8 Update job list message 2021-07-28 10:04:58 -04:00
Tiago Góes
7b6fa1815a Merge pull request #10692 from nixocio/ui_issue_10663_again
Add auto-populate inventory host form
2021-07-28 10:32:08 -03:00
nixocio
b57966677e Remove all groups filter
Remove all groups filter

See: https://github.com/ansible/awx/issues/8593
2021-07-27 16:18:56 -04:00
Jake McDermott
dc79d76444 Merge pull request #10761 from nixocio/ui_issue_6800
Add string to be translated
2021-07-27 15:20:06 -04:00
nixocio
3c1de8d683 Add auto-populate inventory host form
Add auto-populate inventory host form

closes:https://github.com/ansible/awx/issues/10663
2021-07-27 13:03:51 -04:00
nixocio
b077f186d1 Add string to be translated
Add string to be translated

closes: https://github.com/ansible/awx/issues/6800
2021-07-27 11:22:08 -04:00
Jake McDermott
63075976c2 Merge pull request #10662 from AlexSCorey/updatesProdDeps
Updates Several UI Production Dependencies
2021-07-27 11:14:04 -04:00
mabashian
5f7db084d3 Fix linting errors 2021-07-27 09:02:43 -04:00
mabashian
1e30e33d30 Fix bug where page crashed if attempting to view system job node without extra vars 2021-07-27 09:02:43 -04:00
mabashian
874b497794 Update label on days field 2021-07-27 09:02:42 -04:00
mabashian
8374533c5f Ensure that days is always an integer 2021-07-27 09:02:42 -04:00
mabashian
034c665c83 Adds Variables detail to node view when node is a system job template 2021-07-27 09:02:42 -04:00
mabashian
d7521efc91 Fix days to keep bug when editing a new node 2021-07-27 09:02:42 -04:00
mabashian
4db6eaf1aa Add UI support for management jobs in workflows 2021-07-27 09:02:42 -04:00
Rebeccah
fd6ce66906 edit the provision_instance awx-manage command to include node_type when provisioning a new instance. 2021-07-26 16:36:44 -04:00
Rebeccah
f11b73da12 update node_type to be read-only 2021-07-26 16:13:57 -04:00
Tiago Góes
cfa5d1b11d set timeout limit for e2e tests (#10756) 2021-07-26 20:00:00 +00:00
Rebeccah
706f3f97ea add a new field to the instance model for use with receptor changes (incoming) 2021-07-26 15:53:56 -04:00
Alex Corey
34fdf11217 fixes tests 2021-07-26 14:21:31 -04:00
Alex Corey
3dec379052 adds missing license text files 2021-07-26 14:21:23 -04:00
Alex Corey
56fb5479e2 removes unuse license text files 2021-07-26 14:21:19 -04:00
Alex Corey
0a64f3274e updates d3, ansi-t0-html, has-ansi, httml-entities, sanitize-html, styled-components 2021-07-26 14:21:03 -04:00
Jake McDermott
57fa2c03f7 Merge pull request #10753 from ansible/jakemcdermott-patch-readme
Update CI results status badge
2021-07-26 11:38:47 -04:00
Jake McDermott
3ef8008f91 Update CI results status badge 2021-07-26 11:19:54 -04:00
Jake McDermott
70f69b6c8b Merge pull request #10751 from tiagodread/e2e-workflow
Update e2e workflow to use variable for e2e project name
2021-07-26 11:06:15 -04:00
Tiago
c50c0d3f1e Update e2e workflow to use variable for e2e project name 2021-07-26 11:51:12 -03:00
Tiago Góes
6740785054 Merge pull request #10725 from ansible/e2e-tests
Add E2E tests workflow
2021-07-26 11:32:32 -03:00
Tiago
777d37c4b8 Add workflow to run e2e tests when the label needs_test is applied to the PR 2021-07-23 19:13:20 -03:00
Shane McDonald
41321d8ad5 Merge pull request #10716 from oweel/10392-return_404_ad_hoc_command_events
Return 404 for ad_hoc_command_events list api. Remove api endtpoint
2021-07-23 17:35:57 -04:00
Keith Grant
e9b7f9ac40 Merge pull request #10713 from keithjgrant/10563-a11y-fixes
Fix multiple accessibility violations
2021-07-23 10:36:21 -07:00
Alex Corey
f3b6291918 Merge pull request #10634 from AlexSCorey/5200-AboutModalUpdate
Updates product name in About modal
2021-07-23 13:20:13 -04:00
Alex Corey
3c6e7b0983 Improves empty state messages for improve UX 2021-07-23 11:34:03 -04:00
Shane McDonald
09479be4ba Merge pull request #10738 from shanemcd/fix-docker-clean-volumes
Fix docker-clean-volumes target when not using minikube
2021-07-23 11:06:13 -04:00
Shane McDonald
18a51d1dd0 Fix docker-clean-volumes target when not using minikube
Without this patch, you get:

```
tools/docker-compose-minikube/_sources/minikube delete
make: tools/docker-compose-minikube/_sources/minikube: No such file or directory
```
2021-07-23 09:09:33 -04:00
Shane McDonald
7882cb9008 Merge pull request #10668 from oweel/devel
Fix ignoring --no-color for awx-manage list_instances command
2021-07-22 20:46:02 -04:00
Shane McDonald
05c7d3a60e Merge pull request #10108 from saito-hideki/issue/10057
Fix to handle ask_* parameters correctly when set false
2021-07-22 20:25:14 -04:00
Shane McDonald
c09050d1f2 Merge pull request #9944 from AlanCoding/schedule_teardown
Allow stable use of AWXKIT_PREVENT_TEARDOWN by disabling schedules at the end
2021-07-22 20:19:35 -04:00
Shane McDonald
dd9c6270ba Dont fail when pre-built CI image is not available 2021-07-22 19:43:34 -04:00
Shane McDonald
18d9bfa06e Merge pull request #10573 from Tompage1994/collection_inv_src_proj
Default source_project to organization for inventory source
2021-07-22 17:14:32 -04:00
Shane McDonald
ef82c1ce01 Merge pull request #10566 from strollo/webhook-headers-patch
Headers missing in webhook notification request
2021-07-22 17:08:56 -04:00
Shane McDonald
6a7aa77033 Merge pull request #10484 from ansible/chrismeyersfsu-patch-1
only get active long running queries
2021-07-22 15:58:10 -04:00
Shane McDonald
f683c7159d Merge pull request #10481 from brigzzy/compose_up_fix
Reorder docker compose up options
2021-07-22 15:57:39 -04:00
Shane McDonald
cd33db037d Merge pull request #9703 from tchellomello/double_ldap
Avoid double LDAP updates
2021-07-22 15:54:29 -04:00
Shane McDonald
8609a637f9 Merge pull request #9365 from mcharanrm/aa-workloads-firehose
tools/scripts/firehose.py: capture all job ids, attach events to all jobs ids and distribute the events
2021-07-22 15:52:16 -04:00
Shane McDonald
99ffd3898c Merge pull request #8023 from velzend/improve_logging_migrating_or_instance_not_registered
improve logging migrate or instance not registered
2021-07-22 15:50:33 -04:00
Shane McDonald
c36821d6e1 Merge pull request #7273 from jamesmarshall24/devel
Remove query_parameters from page loop causing 414
2021-07-22 15:49:16 -04:00
Shane McDonald
b3604ed94a Merge pull request #10511 from fosterseth/fix_haproxy_permission
run dev cluster haproxy container as root
2021-07-22 15:45:28 -04:00
Shane McDonald
0e30c6639a Merge pull request #10583 from coolbry95/waitfordb
wait for database connection
2021-07-22 14:12:30 -04:00
Keith J. Grant
f6037f9df5 run changes through updated v of prettier 2021-07-22 10:57:49 -07:00
Shane McDonald
0aca4d658a Bash nitpick 2021-07-22 13:56:58 -04:00
Sarabraj Singh
ca14cbefaf Merge pull request #10425 from sarabrajsingh/bugfix/preflight-check-postgres-version-4940
introduced a pre-flight check for postgres 12
2021-07-22 13:56:58 -04:00
coolbry95
041e22f609 wait for migrations in awx-web container 2021-07-22 13:56:58 -04:00
coolbry95
a21dcec85d wait for database connection
Signed-off-by: coolbry95 <coolbry95@gmail.com>
2021-07-22 13:56:58 -04:00
Keith J. Grant
55a9a4ca46 update selectors in tests to match id changes 2021-07-22 09:55:01 -07:00
Keith J. Grant
e32471adbd fix a11y id issues in team list and jt form 2021-07-22 08:58:00 -07:00
Keith J. Grant
77f2729a76 fix settings pages a11y issues 2021-07-22 08:58:00 -07:00
Keith J. Grant
5fb1b604bf ensure unique ids on jobs list 2021-07-22 08:58:00 -07:00
Keith J. Grant
29753c6b9b fix lookup field ids 2021-07-22 08:58:00 -07:00
Jake McDermott
1aacd94cb5 Merge pull request #10711 from ansible/pip-boto
Install boto to ci ansible python env
2021-07-22 11:08:35 -04:00
Jake McDermott
7bfc1702ab Merge pull request #10632 from The-Migus-Group/tss-plugin-amigus
Add Thycotic SecretServer support
2021-07-22 08:57:39 -04:00
Kersom
d68c118fd4 Merge pull request #10570 from nixocio/ui_remove_with_router
Remove mix usage of hooks and HOC for router
2021-07-22 08:34:55 -04:00
Alexander Komarov
27543aed1d Return 404 for ad_hoc_command_events list api. Remove api endtpoint 2021-07-22 15:04:00 +05:00
Adam Migus
edd3554c36 Breakdown the compound statement in tss_backend 2021-07-21 22:03:34 -04:00
Adam Migus
2025426a1b Use a callable function instead of a lambda. 2021-07-21 22:03:34 -04:00
Adam Migus
77ab35e7a8 Extract the field from the secret. 2021-07-21 22:03:33 -04:00
endlesstrax
9dc84d69d5 Update required for SDK v1 compatability 2021-07-21 22:03:32 -04:00
endlesstrax
fa7867e8a7 Fixed import error 2021-07-21 22:03:31 -04:00
endlesstrax
e6ed7f95f1 Added licences fro dataclasses and python-tss-sdk 2021-07-21 22:03:30 -04:00
endlesstrax
28de50f14e Updated the required sdk version to latest release v1.0.0 2021-07-21 22:03:29 -04:00
Adam Migus
7ec56a56e5 Fixed it. 2021-07-21 22:03:29 -04:00
Adam C. Migus
b0b295ba1e My changes. 2021-07-21 22:03:28 -04:00
Ricky White
0cc6bf9b60 Updated backend code 2021-07-21 22:03:27 -04:00
Ricky White
14b767abc3 Added thycotic_tss to test credential 2021-07-21 22:03:26 -04:00
Ricky White
f06c6d349c Added base tss plugin code. Not tested 2021-07-21 22:03:25 -04:00
Ricky White
d6621470b3 Added tss credential plugin 2021-07-21 22:03:25 -04:00
Ricky White
68ab6e4853 Added python-tss-sdk to requirements 2021-07-21 22:03:24 -04:00
Jake McDermott
3980864151 Install boto to ci ansible python env 2021-07-21 18:01:09 -04:00
Tiago
0c8f4fc9e7 Revert "add e2e tests to ci.yml"
This reverts commit 4f428af515.
2021-07-21 18:52:14 -03:00
Tiago
4f428af515 add e2e tests to ci.yml 2021-07-21 18:35:02 -03:00
Kersom
5d20acaa92 Merge pull request #10709 from nixocio/ui_fix_lint
Run prettier and lint
2021-07-21 17:15:48 -04:00
nixocio
05e5cd6bf1 Run prettier
Run prettier
2021-07-21 17:00:05 -04:00
Sarah Akus
53251434f2 Merge pull request #10696 from nixocio/ui_status_label
Create map of strings to be translated
2021-07-21 15:41:56 -04:00
Keith Grant
9704c57d6b Merge pull request #10665 from keithjgrant/disallow-test-network-requests
Disallow network requests in tests
2021-07-21 09:32:47 -07:00
Sarah Akus
9b7ef9ba21 Merge pull request #10700 from nixocio/ui_misalignment
Fix misalignment node approval timeout
2021-07-21 12:05:41 -04:00
Alexander Komarov
e7f1d1d0c1 Fix ignoring --no-color for awx-manage list_instances command 2021-07-21 20:55:24 +05:00
Marcelo Moreira de Mello
c9259ac45b Merge pull request #10675 from tchellomello/minikube-hack-macos
Workaround Minikube issue on MacOS and enable preflights
2021-07-21 10:56:14 -04:00
Marcelo Moreira de Mello
7e46499e18 Workaround Minikube issue on MacOS and enable preflights 2021-07-21 10:39:51 -04:00
nixocio
c1b2428b5d Create map of strings to be translated
Create map of strings to be translated to StatusLabel

closes:https://github.com/ansible/awx/issues/8586
2021-07-21 09:53:37 -04:00
Tiago Góes
c073583663 Merge pull request #10658 from AlexSCorey/updatesESLint_and_Prettier_and_relatedDeps
Updates Several Dev Dependencies
2021-07-21 10:50:22 -03:00
Sarah Akus
66fc92a97f Merge pull request #10679 from AlexSCorey/10549-AuditorsCanAssociateHostWithGroup
Enforces Proper permissions for Host Groups List
2021-07-21 09:45:38 -04:00
nixocio
10c8480247 Fix misalignment node approval timeout
Fix misalignment node approval timeout

closes:https://github.com/ansible/awx/issues/10515
2021-07-21 09:30:58 -04:00
Alex Corey
cfcaa4271c hits correct api end point to get options data for host groups list 2021-07-21 09:30:10 -04:00
Jake McDermott
872513617e Merge pull request #10660 from nixocio/ui_issue_9554
Bump size of SSO icons login screen
2021-07-20 16:56:39 -04:00
Keith J. Grant
9237ca4809 fix path to useBrandName in test 2021-07-20 13:47:46 -07:00
nixocio
719c9e824b Remove mix usage of hooks and HOC for router
There were a few cases that hooks and HOC were being used at the same on
a certain component. Remove HOC from those ones.
2021-07-20 16:47:39 -04:00
Keith J. Grant
9d01334a86 remove withRouter where not needed 2021-07-20 13:01:32 -07:00
Keith J. Grant
4c62bf268d fix test warning about open worker process 2021-07-20 13:01:31 -07:00
Keith J. Grant
3e79fa2dcb fail tests that initiate network requests 2021-07-20 13:01:31 -07:00
Shane McDonald
6715b88633 Update upload_schema.yml 2021-07-20 15:32:11 -04:00
Shane McDonald
556f8aff17 Update upload_schema.yml 2021-07-20 15:14:36 -04:00
Shane McDonald
c8322ee2f1 Merge pull request #10672 from shanemcd/actions
Reimplement CI jobs in GitHub Actions
2021-07-20 12:55:06 -04:00
Shane McDonald
d2017feb55 Specify which region to upload schema to 2021-07-20 12:23:06 -04:00
Shane McDonald
aa934b1dda Add post-merge GHA job for uploading api schema to s3 2021-07-20 12:23:05 -04:00
Jake McDermott
dd510ab90c Set maxworkers to 4 2021-07-20 12:23:04 -04:00
Shane McDonald
3353b3f3b7 Split out UI test and linters into different GHA jobs 2021-07-20 12:23:04 -04:00
Shane McDonald
e22612fc3e Fix image push job 2021-07-20 12:23:03 -04:00
Shane McDonald
baca30ef83 Dont lint GHA files 2021-07-20 12:23:02 -04:00
Shane McDonald
2622a1e764 Port CI jobs to GitHub Actions 2021-07-20 12:23:01 -04:00
Alex Corey
3def23883e updates several dependencies 2021-07-20 12:19:27 -04:00
softwarefactory-project-zuul[bot]
e77d297a28 Merge pull request #10510 from AlexSCorey/10440-8660-fix
Renders Command Module in job detail view and improves Ad Hoc Commands execution permissions

SUMMARY
This closes #10440 and #8660.
On the job details view we now render the command module name, and the arguments.  We also remove the run command button for user that do not have permission to launch a ad hoc command.
ISSUE TYPE
-enhancement
COMPONENT NAME

UI

AWX VERSION
ADDITIONAL INFORMATION

Reviewed-by: Kersom <None>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-20 15:28:24 +00:00
softwarefactory-project-zuul[bot]
8183179850 Merge pull request #10576 from AlexSCorey/9399-revampAdHocCommandsWorkflow
Adds Ad Hoc Preview step and adds workflow similar to prompt on launch

SUMMARY
This closes #9399 it also introduce the same workflow that prompt on launch uses in the Ad Hoc Commands, where the user to go between steps as they wish.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

UI

AWX VERSION
ADDITIONAL INFORMATION

Reviewed-by: Kersom <None>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-20 13:31:37 +00:00
nixocio
52777681d1 Bump size of SSO icons login screen
Bump size of SSO icons login screen

closes: https://github.com/ansible/awx/issues/9554
2021-07-20 08:59:57 -04:00
Alex Corey
71a3a816e2 improves permissions for ad hoc commands execution and tooltip handling 2021-07-20 08:57:25 -04:00
Alex Corey
d389362ca3 renders ad hoc command fields in job detail view 2021-07-20 08:57:25 -04:00
Alex Corey
87890234f8 Adds Ad Hoc Preview step and adds workflow similar to prompt on launch 2021-07-20 08:56:10 -04:00
Alex Corey
fb91c8fba1 updates product name in About modal 2021-07-20 08:27:33 -04:00
softwarefactory-project-zuul[bot]
3f44c5d18b Merge pull request #10639 from weidongkl/devel
Fix inaccurate translation

SUMMARY

Fix some inaccurate translation in zh meesage.po

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


UI

AWX VERSION

devel branch

ADDITIONAL INFORMATION

Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
Reviewed-by: weidong <None>
2021-07-20 02:17:50 +00:00
weidong
cf269fb337 Update Weekday's translation 2021-07-20 09:26:55 +08:00
softwarefactory-project-zuul[bot]
fd99b366c2 Merge pull request #10684 from rooftopcellist/compile-messages
Properly compile translated API strings

SUMMARY
Fixes: #10681
Now when make ui-devel is run, it will compile the API translated strings and display them to the client browser.
[chadams@chadams-work awx]$ make ui-devel
make[1]: Entering directory '/home/chadams/awx'
python3.8 tools/scripts/compilemessages.py
processing file django.po in /home/chadams/awx/awx/locale/fr/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/zh/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/en-us/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/ja/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/es/LC_MESSAGES
processing file django.po in /home/chadams/awx/awx/locale/nl/LC_MESSAGES
npm --prefix awx/ui_next --loglevel warn run compile-strings
...

ISSUE TYPE


Bugfix Pull Request

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
2021-07-19 22:33:34 +00:00
softwarefactory-project-zuul[bot]
001f66980f Merge pull request #10562 from jakemcdermott/fix-relatives-2
Fix relative imports in src code, relocate src

(Lots of files modified but the changes are low-risk and automated)
This PR is a follow-up to #6954, specifically the part where we removed webpack aliases to pick up react-scripts.
SUMMARY

 Add the jsconfig.json w/  baseUrl to enable absolute imports from src. Replaces all the ../../../../../ importing
  jsx -> js extension renaming
 hooks directory
[ ] ui_next -> ui see: #10676

For posterity, the script used to fix the relative imports is included in the commit history.
python3 tools/fixrelative.py awx/ui_next/src
npm --prefix=awx/ui_next run lint -- --fix
npm --prefix=awx/ui_next run prettier

import argparse
import glob
import os
from shutil import move, copymode
from tempfile import mkstemp


def get_new_import_string(old_import_str, root):
    if not root.startswith("./"):
        raise Exception("root must start with './'")
    name = root.replace("./", "")
    left, right = old_import_str.split("from")
    left += "from '"
    _, trailing = right.split(name)

    return left + name + trailing


roots = [
    "./api",
    "./components",
    # "./constants",
    "./contexts",
    "./screens",
    "./types",
    "./util",
]


def get_root(line):
    matched_root = None
    for root in roots:
        if root in line:
            matched_root = root
            break
    if "jest" in line:
        matched_root = None
    return matched_root


def find_and_replace_roots(file_path, root_dir, preview):
    fh, temp_path = mkstemp()
    has_logged_file_name = False
    with os.fdopen(fh, "w") as new_file:
        with open(file_path) as old_file:
            for (line_number, line) in enumerate(old_file):
                matched_root = get_root(line)
                if matched_root:
                    new_line = get_new_import_string(line, matched_root)
                    if not preview:
                        new_file.write(new_line)
                    if not has_logged_file_name:
                        log_file_replacement(root_dir, file_path)
                        has_logged_file_name = True
                    log_line_replacement(line_number, line, new_line)
                elif not preview:
                    new_file.write(line)

    if not preview:
        copymode(file_path, temp_path)
        os.remove(file_path)
        move(temp_path, file_path)


def log_line_replacement(line_number, line, new_line):
    display_line = line.replace(os.linesep, "")
    display_new_line = new_line.replace(os.linesep, "")
    print(f"\t (line {line_number}): {display_line} --> {display_new_line}")


def log_file_replacement(root_dir, file_path):
    display_path = os.path.relpath(file_path, root_dir)
    print("")
    print(f"{display_path}:")


def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("root_dir", help="Root directory")
    parser.add_argument("--preview", help="Preview (no write)", action="store_true")
    args = parser.parse_args()
    return args


def run():
    args = parse_args()
    search_path = args.root_dir + "**/**/*.js*"

    for file_path in glob.iglob(search_path, recursive=True):
        find_and_replace_roots(file_path, args.root_dir, args.preview)


if __name__ == "__main__":
    run()

Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-19 21:57:27 +00:00
Christian M. Adams
2f6855262e Properly compile translated API strings 2021-07-19 17:52:28 -04:00
Jake McDermott
954be5dd32 Regenerate translation string files 2021-07-19 13:33:54 -04:00
Jake McDermott
6d71997b51 Relocate hooks to hooks directory
mkdir awx/ui_next/src/hooks
mv awx/ui_next/src/util/use* awx/ui_next/src/hooks/
find ./awx/ui_next/src -type f -exec sed -i -e 's/util\/use/hooks\/use/g' {} \;
find ./awx/ui_next/src/hooks -type f -exec sed -i -e 's/from \x27\.\//from \x27util\//g' {} \;
find ./awx/ui_next/src/hooks -type f -exec sed -i -e 's/from \x27util\/use/from \x27\.\/use/g' {} \;
npm --prefix=awx/ui_next run lint -- --fix
npm --prefix=awx/ui_next run prettier
2021-07-19 13:33:45 -04:00
Jake McDermott
021e98b14a Remove script to switch relative imports 2021-07-19 13:33:42 -04:00
Jake McDermott
c92fffaecc Rename .jsx -> .js 2021-07-19 13:33:38 -04:00
Jake McDermott
595cf192b7 Fix relative imports
python tools/fixrelative.py awx/ui_next/src
npm --prefix=awx/ui_next run lint -- --fix
npm --prefix=awx/ui_next run prettier
2021-07-19 13:33:35 -04:00
Jake McDermott
0ee7d22e9d Add script to switch relative imports 2021-07-19 13:33:30 -04:00
Jake McDermott
dc1b312672 Enable absolute imports 2021-07-19 13:33:24 -04:00
softwarefactory-project-zuul[bot]
9820c8cd81 Merge pull request #10671 from fosterseth/fix_minikube_start_by_default
Fix conditional to check that minikube should start

SUMMARY

make docker-compose tries to start container group without this fix

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


API

AWX VERSION

awx: 19.2.2

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-07-19 15:46:53 +00:00
Seth Foster
d346dbb8ba Fix conditional to check that minikube should start 2021-07-19 11:05:05 -04:00
softwarefactory-project-zuul[bot]
81eb3be8d4 Merge pull request #10629 from nixocio/ui_issue_5687
Update User screens

Add modified field to user endpoints. The API returns the last login
date as the modified field to the users.
Modify user form layout to be as per mockups.
Remove last name and  first name from user row, since it is
already on the column title.


closes: #5687
closes: #9564

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 20:42:33 +00:00
softwarefactory-project-zuul[bot]
d01cd5517d Merge pull request #10606 from nixocio/ui_issue_10595
Display full keys advanced search smart inventory

Display full keys advanced search smart inventory

closes: #10595

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 20:42:27 +00:00
nixocio
faf295d7f2 Update User screens
* Add `modified` field to user endpoints. The API returns the last login
date as the `modified` field to the users.
* Add modified to user details.
* Modify user form layout to be as per mockups.
* Remove `last name` and  `first name` from user row, since it is
already on the column title.

closes: https://github.com/ansible/awx/issues/5687
closes: https://github.com/ansible/awx/issues/9564
2021-07-15 16:05:34 -04:00
softwarefactory-project-zuul[bot]
9bb7d918eb Merge pull request #10623 from AlexSCorey/4208-ExpandWholeList
Adds functionality for expand all 

SUMMARY
Closes #4208.  Adds basically the same work as useSelected, in a useExpanded hook.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

UI

AWX VERSION
ADDITIONAL INFORMATION

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 19:24:54 +00:00
softwarefactory-project-zuul[bot]
efed55d0c0 Merge pull request #10640 from nixocio/ui_issue_10095
Add edit icon to SurveyListItem

Add edit icon to SurveyListItem

closes: #10095

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 18:59:09 +00:00
softwarefactory-project-zuul[bot]
5f916e6237 Merge pull request #10622 from nixocio/ui_issue_10612
Update login redirect to a be text input field

Update login redirect to a be text input field. Allowing values like
/sso/login/saml/?idp=SSO
closes: #10612

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 18:59:05 +00:00
softwarefactory-project-zuul[bot]
d3143d9b1d Merge pull request #10621 from nixocio/ui_issue_10620
Fix close button alert modal

Fix close button alert modal
closes: #10620

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 18:59:02 +00:00
softwarefactory-project-zuul[bot]
207eaaf9b4 Merge pull request #10608 from nixocio/ui_issue_10548
Disable remove button if row is being dragged

Disable remove button if row is being dragged.
Also, disable drag button there is just one item selected.
closes: #10548

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 18:58:59 +00:00
softwarefactory-project-zuul[bot]
f16626c808 Merge pull request #10604 from nixocio/ui_update_rbac
Update RBAC sidebar

Update RBAC sidebar. Do the following:

Expose read-only applications to normal users in the UI
Expose read-only credential types to normal users in the UI


closes: #10432
closes: #10433

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 18:06:05 +00:00
softwarefactory-project-zuul[bot]
6533a255a7 Merge pull request #10578 from wenottingham/spuds_mckenzicon
Point REST API favicon at the one the UI uses

SUMMARY
Don't  ship one that is only used for the API browser.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

API
UI

AWX VERSION
devel

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
2021-07-15 17:34:19 +00:00
softwarefactory-project-zuul[bot]
f8ff9ffe62 Merge pull request #10598 from nixocio/ui_issue_10593
Identify sliced jobs on Job List and Job Details

Identify sliced jobs on Job List and Job details - for workflow jobs.
closes: #2479
closes: #10593
Jobs List

Job Details - Workflow Job

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 17:28:39 +00:00
nixocio
7cc3ac1a11 Identify sliced jobs on Job List and Job Details
Identify sliced jobs on Job List and Job details - for workflow jobs.

closes: https://github.com/ansible/awx/issues/2479
closes: https://github.com/ansible/awx/issues/10593
2021-07-15 12:51:53 -04:00
softwarefactory-project-zuul[bot]
9ed1f3bc0f Merge pull request #10636 from tchellomello/minikube-devel-hack
Incorporates Minikube to devel environment

SUMMARY

Incorporates Minikube to devel environment
This PR allows creating a smooth devel environment deploying Minikube connected to the AWX devel network interface using Docker.
Furthermore, both CredentialType  and Container Group gets created automatically.
Steps performed by the target make docker-compose-container-group

Downloads Minikube (currently supported Linux and MacOS)
Downloads kubectl (currently supported Linux and MacOS)
Starts Minikube using docker as backend
Creates a Service Account, Role and RoleBinding on Minikube
Exports Minikube ServiceAccount token to be used on AWX Credential
Creates Minikube AWX Credential
Creates Container Group to use Minikube backend
Starts regular AWX devel instances and connected with Minikube network

ISSUE TYPE


Feature Pull Request

COMPONENT NAME


API

AWX VERSION

devel

ADDITIONAL INFORMATION
Quick step-by-step to use this PR:
$ make docker-compose-container-group-clean  # this will remove your database and any old Minikube already deployed
$ make docker-compose-container-group
Verifying some work:
$ kubectl get serviceaccount awx-devel
NAME        SECRETS   AGE
awx-devel   1         130m

$ kubectl get roles
NAME        CREATED AT
awx-devel   2021-07-15T00:47:37Z

$ kubectl get rolebindings
NAME        ROLE             AGE
awx-devel   Role/awx-devel   131m
Credential

Container Instance Group

After updating a Job Template and assigning to the Container Instance Group
kubectl get pods -w
NAME                     READY   STATUS    RESTARTS   AGE
automation-job-6-w6rmh   0/1     Pending   0          0s
automation-job-6-w6rmh   0/1     Pending   0          0s
automation-job-6-w6rmh   0/1     ContainerCreating   0          0s
automation-job-6-w6rmh   1/1     Running             0          5s
automation-job-6-w6rmh   1/1     Terminating         0          6s

Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: Elijah DeLee <kdelee@redhat.com>
Reviewed-by: Marcelo Moreira de Mello <tchello.mello@gmail.com>
Reviewed-by: Sarabraj Singh <singh.sarabraj@gmail.com>
2021-07-15 16:46:26 +00:00
softwarefactory-project-zuul[bot]
4b81df2ab4 Merge pull request #10651 from gabyfulchic/patch-1
Update kubernetes pod doc url

SUMMARY
Just a little change allowing users to find the Kubernetes pod core documentation.
ISSUE TYPE

Docs Pull Request

COMPONENT NAME

UI

AWX VERSION
N/A
ADDITIONAL INFORMATION
N/A

Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-07-15 16:40:09 +00:00
softwarefactory-project-zuul[bot]
8d7bd5fb0f Merge pull request #10656 from ansible/bump-ee-version
Update defaults.py

we missed this...need it for container groups to work out of the box in the dev environment

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-07-15 16:05:38 +00:00
softwarefactory-project-zuul[bot]
62a1eddd1a Merge pull request #10597 from AlexSCorey/10547-fix
Fixes missing key values in ad hoc credental step advanced search

SUMMARY
Resolves #10547
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

AWX VERSION
ADDITIONAL INFORMATION

Reviewed-by: Kersom <None>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 15:47:50 +00:00
softwarefactory-project-zuul[bot]
6e88e094ee Merge pull request #10580 from AlexSCorey/10499-fix
Removes tabs from survey form

SUMMARY
Resolves #10499
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

AWX VERSION
ADDITIONAL INFORMATION

Reviewed-by: Kersom <None>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 15:46:23 +00:00
Marcelo Moreira de Mello
b63313a08b Using awx-manage shell produces a better stdout during bootstrap 2021-07-15 11:43:20 -04:00
Elijah DeLee
b431067aa8 also update control plane ee 2021-07-15 11:30:21 -04:00
softwarefactory-project-zuul[bot]
39522a35c6 Merge pull request #10577 from nixocio/ui_issue_9550
Display error message if schedule does not exist

Display error message if schedule does not exist when redirecting to
details page.

closes: #9550

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 15:29:34 +00:00
Elijah DeLee
718b3bab4a Update defaults.py 2021-07-15 11:27:55 -04:00
softwarefactory-project-zuul[bot]
7d01cc45bc Merge pull request #10525 from nixocio/ui_issue_10497
Update EE lookup title

Upated EE lookup name to be singular. Also, another reference that to EE
that should be singular.
Closes: #10497

Reviewed-by: Marliana Lara <marliana.lara@gmail.com>
Reviewed-by: Sarah Akus <sakus@redhat.com>
2021-07-15 15:09:14 +00:00
Marcelo Moreira de Mello
f6a71e770d Incorporates Minikube to devel environment 2021-07-15 10:42:04 -04:00
gabyf
c0e9ffd65a Update container_groups.md 2021-07-15 14:21:48 +02:00
gabyf
c511597c0f Update kubernetes pod doc url 2021-07-15 14:17:28 +02:00
softwarefactory-project-zuul[bot]
0e75193e3d Merge pull request #10614 from keithjgrant/test-cleanup
Test cleanup

SUMMARY

Makes a unit test fail if any errors or warnings are logged (see setupTest.js)
Updates/fixes all tests that were logging errors
Fixes a key cause of test flake caused by Jobs.test.jsx (I have still seen a rogue "Network error" cause a flaky failure once; which I will hopefully take care of in a subsequent PR)
Removes all unnecessary calls to wrapper.unmount() (this also surfaced several instances of tests leaving asynchronous code running after test completion, which are now fixed)

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

Reviewed-by: Kersom <None>
Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-14 19:33:32 +00:00
Keith J. Grant
a307421b82 attempt to fix ci/merge test error 2021-07-14 11:53:24 -07:00
softwarefactory-project-zuul[bot]
65ddc8c0bd Merge pull request #10633 from jbradberry/conditional-polymorphic-setnull
Conditional polymorphic setnull

SUMMARY


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


API

AWX VERSION



ADDITIONAL INFORMATION

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-07-14 18:42:42 +00:00
softwarefactory-project-zuul[bot]
7961bcb2cb Merge pull request #10631 from AlanCoding/inventory_delete
Wait until inventory is fully deleted in silent_delete

The silent_delete method does not appear to be used by the AWX CLI. I believe the only use is from:

  
    
      awx/awxkit/awxkit/api/pages/base.py
    
    
        Lines 185 to 187
      in
      eec4f8d
    
    
    
    

        
          
           def cleanup(self): 
        

        
          
               log.debug('{0.endpoint} cleaning up.'.format(self)) 
        

        
          
               return self._cleanup(self.delete) 
        
    
  


This is used in integration tests to cleanup at the end of a test. Whenever inventory gets deleted, this leads to various conflict scenarios and deadlocks. This tends to play out by:

DELETE request for the inventory object
DELETE request for the organization

within the request-response cycle, this cascade deletes other objects, or takes SET_NULL action



Because the actual inventory deletion happens in a separate task, this means that inventory and organization deletion cascades are happening simultaneously (dependent on timing and resources).
This is low-priority on our list of practical concerns, because the inventory object accurately reports that its deletion is in progress. Clients can workaround if needed - and that's what I'm trying to do here. In an effort to reduce the flakiness and erroneous errors in integration tests, I propose that this will basically serialize the teardown process (for a given test agent), and that will eliminate a large cluster of flaky errors.

Reviewed-by: Elijah DeLee <kdelee@redhat.com>
Reviewed-by: Jeff Bradberry <None>
2021-07-14 16:37:00 +00:00
nixocio
ef4feae9bf Add edit icon to SurveyListItem
Add edit icon to SurveyListItem

closes: https://github.com/ansible/awx/issues/10095
2021-07-14 10:57:26 -04:00
softwarefactory-project-zuul[bot]
df3a8d8718 Merge pull request #10591 from nixocio/ui_issue_2961
Update inventory prompt string for workflows

Update inventory prompt string for workflows
closes: #2961

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-14 14:10:33 +00:00
softwarefactory-project-zuul[bot]
4eca133080 Merge pull request #10581 from AlexSCorey/10544-fix
Prevents submission of jtform if name is > 512 characters

SUMMARY
This addresses #10544 by adding a maxLength validator to the name field on the Job Template form
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

AWX VERSION
ADDITIONAL INFORMATION

Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-14 13:46:07 +00:00
weidong
b7855a3c74 Fix inaccurate translation 2021-07-14 14:00:47 +08:00
Alan Rominger
397fab793d Avoid waiting for deletion in error cases 2021-07-13 13:49:09 -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
softwarefactory-project-zuul[bot]
4e97492ed6 Merge pull request #10619 from wenottingham/dont-think-we-need-this
Delete some old code related to the reencryption migration

We've moved past the point where this code would still be live.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

API

AWX VERSION
current

ADDITIONAL INFORMATION
We could probably squash more of these?

Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-07-13 16:46:33 +00:00
softwarefactory-project-zuul[bot]
45a6d03dcd Merge pull request #10590 from shanemcd/downstream-fixes
Downstream fixes

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
2021-07-13 16:24:59 +00:00
Shane McDonald
b0fe3d7f85 Bump ansible-runner to 2.0.1 2021-07-13 11:47:02 -04:00
Elijah DeLee
b8239c1b84 bump receptor to 1.0.0 GA 2021-07-13 11:47:02 -04:00
mabashian
994175f386 Properly set use_tls initial value to bool (false) 2021-07-13 11:47:02 -04:00
Alan Rominger
8772ca2e3a Development of patch for inventory source migration error 2021-07-13 11:47:01 -04:00
mabashian
3c43ed6d2d Update base docs string 2021-07-13 11:47:01 -04:00
mabashian
667121d325 Change dev brand name to Ansible AWX and remove Ansible string from about 2021-07-13 11:47:01 -04:00
Keith J. Grant
ed02f28cbe mark upload button strings for translation 2021-07-13 11:47:01 -04:00
Christian M. Adams
4ca6c1c6c5 Add more appropriate french translation for changing PROJECT_ROOTS 2021-07-13 11:47:01 -04:00
Christian M. Adams
35a5c4153c Corrected dynamic variables that got translated by accident
- Fixed extra braces & lack of braces
  - Fixed plural/singular notation that got translated by accident
2021-07-13 11:47:01 -04:00
ansible-translation-bot
11e7387055 UI translation strings for release_4.0 branch 2021-07-13 11:47:00 -04:00
Sarabraj Singh
0f51c56980 Merge pull request #10425 from sarabrajsingh/bugfix/preflight-check-postgres-version-4940
introduced a pre-flight check for postgres 12
2021-07-13 11:46:10 -04:00
Alan Rominger
3e6cbd5114 Wait until inventory is fully deleted in silent_delete 2021-07-13 07:50:58 -04:00
softwarefactory-project-zuul[bot]
486d6688e1 Merge pull request #10559 from nixocio/ui_mark_string
Mark string to be translated

Mark string to be translated

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-12 19:04:34 +00:00
softwarefactory-project-zuul[bot]
a08ca15f13 Merge pull request #10543 from nixocio/ui_issue_10553
Update last name for Resource Access List

Update last name for Resource Access List

Closes: #10533

Reviewed-by: Marliana Lara <marliana.lara@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-12 18:57:23 +00:00
softwarefactory-project-zuul[bot]
13a94dd7ac Merge pull request #10523 from nixocio/ui_fix_settings
Fix Job Settings Page Break on Firefox

Fix Job Settings Page Break on Firefox
Closes: #10332
Firefox:

Chrome:

Reviewed-by: Marliana Lara <marliana.lara@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-12 18:44:40 +00:00
Alex Corey
8198f045f9 removes unnecessary prop 2021-07-12 14:42:38 -04:00
Alex Corey
6a717a8f3c Adds functionality for expand all in lists that have list items that can be expanded 2021-07-12 14:42:19 -04:00
nixocio
212e924f9b Update EE lookup title
Update EE lookup title to be singular. Also, another reference that to EE
that should be singular.

Closes: https://github.com/ansible/awx/issues/10497
2021-07-12 14:39:30 -04:00
softwarefactory-project-zuul[bot]
45740b5ed0 Merge pull request #10520 from nixocio/ui_issue_6351
Remove custom component

Remove custom component since PF issue is now fixed.
Closes: #6351

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-12 18:32:38 +00:00
softwarefactory-project-zuul[bot]
6b865da025 Merge pull request #10512 from nixocio/ui_issue_5236
Add job status on expand row for hosts

Add job status on expand row for hosts

See: #5236

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-12 18:24:33 +00:00
softwarefactory-project-zuul[bot]
c1913b0d44 Merge pull request #10504 from nixocio/ui_issue_7524
Encode/decode question variables

Encode/decode question variables
See: #7524

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-12 17:57:50 +00:00
softwarefactory-project-zuul[bot]
e65f11c95e Merge pull request #10502 from mabashian/7668-disabled-node
Fix disabled node cover dimensions

SUMMARY
Closes #7668

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

UI

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-07-12 17:38:41 +00:00
Keith J. Grant
09751efe95 fail tests if warning is logged 2021-07-09 13:19:15 -07:00
softwarefactory-project-zuul[bot]
f05827df69 Merge pull request #10617 from AlanCoding/collection_flake8
Run flake8 on the AWX collection in CI

We kind of assumed that linter issues like this would be picked up by ansible-test sanity, but they're not.
This seems to provide meaningful value. Unused variables are reflecting a lot of history of changes, and it's good to move on to leave those in the past.

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-07-09 20:17:34 +00:00
nixocio
70ec4b915c Update login redirect to a be text input field
Update login redirect to a be text input field. Allowing values like
`/sso/login/saml/?idp=SSO`

closes: https://github.com/ansible/awx/issues/10612
2021-07-09 16:08:13 -04:00
nixocio
5964ff6c93 Fix close button alert modal
Fix close button alert modal

closes: https://github.com/ansible/awx/issues/10620
2021-07-09 15:44:56 -04:00
Keith J. Grant
0185269d97 remove 4th batch of unmount() calls 2021-07-09 11:50:19 -07:00
Keith J. Grant
81c16f4fa7 remove 3rd batch of unmount calls 2021-07-09 11:04:18 -07:00
Alan Rominger
122f282e5d Add back in fixture 2021-07-09 13:32:31 -04:00
Alan Rominger
9b319cf2bf Fix pep8 failure 2021-07-09 13:08:57 -04:00
Alan Rominger
cb8441ed3d Remove added assertion that was wrong 2021-07-09 12:30:06 -04:00
Alan Rominger
08cb497689 Run flake8 on the AWX collection in CI 2021-07-09 12:01:28 -04:00
softwarefactory-project-zuul[bot]
68e309ee32 Merge pull request #10607 from AlanCoding/unused_exception
Remove unused exception about custom venvs

random cleanup

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-07-09 15:43:00 +00:00
Bill Nottingham
84b32a91f0 Delete some old code related to reencryption
We've moved past the point where this code would still be live.
2021-07-08 23:20:33 -04:00
Keith J. Grant
bf7663a0a1 remove 2nd batch of unecessary unmount calls 2021-07-08 17:06:15 -07:00
Keith J. Grant
86fcfdf69a remove 1st batch of unnecessary unmount calls 2021-07-08 16:51:46 -07:00
Keith J. Grant
58d64045a1 fix About test network call 2021-07-08 15:52:21 -07:00
Keith J. Grant
0e12c7deb4 fix flakey unit tests I hope 2021-07-08 14:33:38 -07:00
Keith J. Grant
78d6e21256 fix final logged errors in tests 2021-07-08 14:33:38 -07:00
Keith J. Grant
226ffafbd6 fix test errors (Sort, CredentialEdit, InventoryHost, JobTemplateEdit, etc) 2021-07-08 14:33:38 -07:00
Keith J. Grant
1b5fa9c799 fix errors logged in tests (scheduls/organization) 2021-07-08 14:33:38 -07:00
Keith J. Grant
ad2f042f97 fix tests with errors 2021-07-08 14:33:38 -07:00
Keith J. Grant
4b41bbbf34 fail tests if anything logs an error 2021-07-08 14:33:37 -07:00
nixocio
fb64df21c5 Disable remove button if row is being dragged
Disable remove button if row is being dragged.
Also, disable drag button there is just one item selected.

closes: https://github.com/ansible/awx/issues/10548
2021-07-08 15:13:29 -04:00
softwarefactory-project-zuul[bot]
adb6661015 Merge pull request #10589 from AlanCoding/null_traceback
No result_traceback is blank, not null

I kept staring at a failure where:

cannot create resource

was expected in result_traceback, but it was blank. The job had "error" status, sure enough.
Then I re-created, sure enough, the job was right there - error status, no explanation, no traceback, no indication of what happened. We did have logs though (which I still can't fully disambiguate).
After that initial confusion, I realized this is a server-side bug. The test is happy with what happens after this change.
I can re-organize this diff if needed.

Reviewed-by: Elijah DeLee <kdelee@redhat.com>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-07-07 19:41:27 +00:00
Alan Rominger
17f9b57028 Remove unused exception about custom venvs 2021-07-07 11:38:37 -04:00
Alan Rominger
e96080a512 No result_traceback is blank, not null 2021-07-07 11:37:30 -04:00
nixocio
9295496949 Display full keys advanced search smart inventory
Display full keys advanced search smart inventory

closes: https://github.com/ansible/awx/issues/10595
2021-07-07 11:33:20 -04:00
tpage
62fc62a3c5 Default source_project for inventory source to organization
Signed-off-by: tpage <tpage@redhat.com>
2021-07-07 15:31:32 +01:00
nixocio
267f0a7bbd Update RBAC sidebar
Update RBAC sidebar. Do the following:

* Expose read-only applications to normal users in the UI
* Expose read-only credential types to normal users in the UI

closes:https://github.com/ansible/awx/issues/10432
closes:https://github.com/ansible/awx/issues/10433
2021-07-07 10:18:45 -04:00
nixocio
6d9996cd0e Update inventory prompt string for workflows
Update inventory prompt string for workflows

closes: https://github.com/ansible/awx/issues/2961
2021-07-06 17:16:24 -04:00
Alex Corey
0a0c635de8 fixes missing key values in ad hoc credental step advanced search 2021-07-06 16:34:47 -04:00
Alex Corey
869b649b66 prevents submission of jtform if name is > 512 characters 2021-07-02 14:17:51 -04:00
Alex Corey
b41e70f9aa removes tabs from survey form 2021-07-02 09:40:22 -04:00
Bill Nottingham
a98ae2a87d Point REST API favicon at the one the UI uses 2021-07-01 16:10:33 -04:00
nixocio
f422677145 Display error message if schedule does not exist
Display error message if schedule does not exist when redirecting to
details page.

See: https://github.com/ansible/awx/issues/9550
2021-07-01 15:15:22 -04:00
softwarefactory-project-zuul[bot]
bc8e19b51d Merge pull request #10575 from AlexSCorey/fixesFailingUnitTest
Fixes failing test

SUMMARY
Fixes a failing unit test

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
2021-07-01 17:16:38 +00:00
softwarefactory-project-zuul[bot]
64631fca56 Merge pull request #10574 from ansible/jakemcdermott-patch-bug-template-2
Remove bug template title field

Leaving it blank disables the template.

Reviewed-by: Alex Corey <Alex.swansboro@gmail.com>
2021-07-01 16:22:12 +00:00
Alex Corey
49c84e6ca9 fixes failing test 2021-07-01 11:56:32 -04:00
Jake McDermott
c0f587a2bf Remove title field from bug template 2021-07-01 11:44:26 -04:00
softwarefactory-project-zuul[bot]
28147b71c5 Merge pull request #10567 from ansible/jakemcdermott-patch-bug-template
Remove default text from bug title

SUMMARY
We use labels for these, so the extra text isn't needed.
ADDITIONAL INFORMATION

Reviewed-by: Kersom <None>
2021-07-01 14:19:38 +00:00
softwarefactory-project-zuul[bot]
be93178e65 Merge pull request #10564 from sarabrajsingh/bump-django-to-2.2.20
bumped django version to 2.2.20 in devel

SUMMARY


Bumped Django version from 2.2.16 -> 2.2.20 for the devel environment. All builds, tests and tests consuming the AWX_USE_FIPS flag passed in Jenkins.
AWX Issue - ansible/tower#4930
ISSUE TYPE


Feature Pull Request

COMPONENT NAME


API

AWX VERSION

awx: 19.2.2

Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-07-01 14:11:15 +00:00
Jake McDermott
147e50730d Remove default text from bug title 2021-07-01 09:01:45 -04:00
softwarefactory-project-zuul[bot]
f88b3806f2 Merge pull request #10508 from jakemcdermott/bug-report-form
Add bug report form for github issues

SUMMARY

Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-07-01 12:39:57 +00:00
daniele strollo
24a8653fab Update webhook_backend.py
At the request via webhook just uses default pre configured headers (with Agent/ContentType) by ignoring at all customer provided headers (self.headers).
Thus the OAuth authentication via Bearer cannot be implemented since custom headers are not sent to service so receiving Unauthorized response.

Solution is merging the default headers with custom ones (custom headers will override default ones in case of key clash).
2021-07-01 12:08:14 +02:00
Hideki Saito
70f9d6f015 Fix to handle parameters with Boolean values correctly
* Addresses the issue #10057

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-07-01 13:39:51 +09:00
Sarabraj Singh
46cd62f3f0 bumped django version to 2.2.20 in devel 2021-06-30 17:10:40 -04:00
nixocio
6f6f601ca8 Fix Job Settings Page Break on Firefox
Fix Job Settings Page Break on Firefox

Closes: https://github.com/ansible/awx/issues/10332
2021-06-30 16:11:58 -04:00
softwarefactory-project-zuul[bot]
9ea6696bf9 Merge pull request #10561 from fosterseth/fix_collection_sanity_pylint
Fix pylint 2.9 errors in awx collection

SUMMARY

fixes errors like these
ERROR: plugins/modules/workflow_launch.py:131:4: consider-using-dict-items: Consider iterating with .items()

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


API

AWX VERSION

awx: 19.2.2

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-06-30 20:08:57 +00:00
Seth Foster
a9013c43fa fix pylint 2.9 errors in awx collection 2021-06-30 14:28:35 -04:00
nixocio
48dc1dfa17 Mark string to be translated
Mark string to be translated
2021-06-30 11:25:29 -04:00
softwarefactory-project-zuul[bot]
a58d571858 Merge pull request #10422 from AlanCoding/quay_default
Make quay.io the registry URL default

SUMMARY
It's unclear what format the registry "Authentication URL" should be.

It's too late to change the strings because of translations, ping @rooftopcellist, but this change would clarify the format without adding wording.
ISSUE TYPE

Feature Pull Request
Docs Pull Request

COMPONENT NAME

API

ADDITIONAL INFORMATION
Seems to behave pretty good in the UI.

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Jeff Bradberry <None>
Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-06-29 18:06:39 +00:00
Alan Rominger
b329d9cbf4 Make quay.io the registry URL default 2021-06-29 13:26:51 -04:00
nixocio
5c0c788d10 Update last name for Resource Access List
Update last name for Resource Access List

Closes: https://github.com/ansible/awx/issues/10533
2021-06-29 13:14:14 -04:00
softwarefactory-project-zuul[bot]
772e9f0d6b Merge pull request #10430 from AlanCoding/awxkit_tox
Run flake8 on awxkit

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
2021-06-29 16:09:09 +00:00
Alan Rominger
f0cd6b2457 Run flake8 on awxkit 2021-06-29 11:32:59 -04:00
softwarefactory-project-zuul[bot]
9cd5566869 Merge pull request #10538 from AlanCoding/collection_pep
Fix ansible-test pep8 bug and add notable release

Fixes
Error Message
The test `ansible-test sanity --test pep8` failed with 1 error:
Stacktrace
test/awx/test_project.py:28:1: E302: expected 2 blank lines, found 1

And add a notable release to the https://galaxy.ansible.com/awx/awx page

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Seth Foster <None>
Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-06-29 15:13:14 +00:00
softwarefactory-project-zuul[bot]
747231d350 Merge pull request #10537 from chrismeyersfsu/fix-fork
reload settings on fork or new thread

Reloading settings will re-import cache. Django cache is thread aware,
but keeping an old reference to the cache avoids the awareness.

The performance team that was hitting this every time before. With this change they are unable to recreated.

Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-06-29 12:53:30 +00:00
Alan Rominger
b8f5dda6da Fix ansible-test pep8 bug and add notable release 2021-06-28 22:37:10 -04:00
nixocio
21de95862e Add job status on expand row for hosts
Add job status on expand row for hosts.

Also, update HostDetail to remove the addition of `type=job` since it is
already present on the API hosts endpoint.

See: https://github.com/ansible/awx/issues/5236
2021-06-28 16:01:59 -04:00
Chris Meyers
84116349ab reload settings on fork or new thread
* Reloading settings will re-import cache. Django cache is thread aware,
but keeping an old reference to the cache avoids the awareness.
2021-06-28 13:53:11 -04:00
nixocio
18e63ae6da Remove custom component
Remove custom component since PF issue is now fixed.

See: https://github.com/ansible/awx/issues/6351
2021-06-25 13:47:40 -04:00
Jake McDermott
bb78a0b4ec Add bug report form 2021-06-25 08:41:54 -04:00
Seth Foster
7bc7c9c4bd haproxy specify user 2021-06-24 13:54:24 -04:00
nixocio
804bd840f1 Encode/decode question variables
Encode/decode question variables

See: https://github.com/ansible/awx/issues/7524
2021-06-23 16:08:33 -04:00
mabashian
e4a52703f9 Fix disabled node cover dimensions 2021-06-23 12:49:40 -04:00
Chris Meyers
5975082954 only get active long running queries
Getting all connections that have been alive > 5 minutes is noisy. Instead, we want only queries that are active and have been alive for more than 5 minutes. This will filter out any idle connections.
2021-06-21 09:57:29 -04:00
Brigzzy
c1409f3dc7 Reorder docker compose up options 2021-06-20 12:29:43 -07:00
AlanCoding
51f4a40cd4 Allow preserving schedules with prevent_teardown 2021-04-19 12:34:14 -04:00
Marcelo Moreira de Mello
fd3475a813 Only update LDAP user when necessary 2021-03-25 11:10:11 -04:00
mcharanrm
412015b7bd tools/scripts/firehose.py: capture all job ids, attach events to all jobs ids and distribute the events 2021-02-19 19:10:34 +05:30
tp48cf
58ce89fc0b improve logging migrate or instance not registered 2020-08-27 09:15:13 +02:00
jamesmarshall24
2394c0cb3d Remove query_parameters from within loop duplicating parameters in URL request 2020-06-05 18:12:10 -07:00
2887 changed files with 281197 additions and 256874 deletions

View File

@@ -1,3 +1,3 @@
awx/ui/node_modules awx/ui/node_modules
awx/ui_next/node_modules
Dockerfile Dockerfile
.git

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
workflows/e2e_test.yml @tiagodread @shanemcd @jakemcdermott

View File

@@ -16,7 +16,7 @@ https://www.ansible.com/security
<!-- Pick the area of AWX for this issue, you can have multiple, delete the rest: --> <!-- Pick the area of AWX for this issue, you can have multiple, delete the rest: -->
- API - API
- UI - UI
- Installer - Collection
##### SUMMARY ##### SUMMARY
<!-- Briefly describe the problem. --> <!-- Briefly describe the problem. -->

View File

@@ -1,41 +0,0 @@
---
name: "\U0001F41B Bug report"
about: Create a report to help us improve
---
<!-- Issues are for **concrete, actionable bugs and feature requests** only - if you're just asking for debugging help or technical support, please use:
- http://web.libera.chat/?channels=#ansible-awx
- https://groups.google.com/forum/#!forum/awx-project
We have to limit this because of limited volunteer time to respond to issues! -->
##### ISSUE TYPE
- Bug Report
##### SUMMARY
<!-- Briefly describe the problem. -->
##### ENVIRONMENT
* AWX version: X.Y.Z
* AWX install method: openshift, minishift, docker on linux, docker for mac, boot2docker
* Ansible version: X.Y.Z
* Operating System:
* Web Browser:
##### STEPS TO REPRODUCE
<!-- Please describe exactly how to reproduce the problem. -->
##### EXPECTED RESULTS
<!-- What did you expect to happen when running the steps above? -->
##### ACTUAL RESULTS
<!-- What actually happened? -->
##### ADDITIONAL INFORMATION
<!-- Include any links to sosreport, database dumps, screenshots or other
information. -->

142
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,142 @@
---
name: Bug Report
description: Create a report to help us improve
body:
- type: markdown
attributes:
value: |
Issues are for **concrete, actionable bugs and feature requests** only. For debugging help or technical support, please use:
- The #ansible-awx channel on irc.libera.chat
- The awx project mailing list, https://groups.google.com/forum/#!forum/awx-project
- type: checkboxes
id: terms
attributes:
label: Please confirm the following
options:
- label: I agree to follow this project's [code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html).
required: true
- label: I have checked the [current issues](https://github.com/ansible/awx/issues) for duplicates.
required: true
- label: I understand that AWX is open source software provided for free and that I might not receive a timely response.
required: true
- type: textarea
id: summary
attributes:
label: Summary
description: Briefly describe the problem.
validations:
required: false
- type: input
id: awx-version
attributes:
label: AWX version
description: What version of AWX are you running?
validations:
required: true
- type: checkboxes
id: components
attributes:
label: Select the relevant components
options:
- label: UI
- label: API
- label: Docs
- type: dropdown
id: awx-install-method
attributes:
label: Installation method
description: How did you install AWX?
multiple: false
options:
- kubernetes
- minikube
- openshift
- minishift
- docker on linux
- docker for mac
- boot2docker
validations:
required: true
- type: dropdown
id: modified-architecture
attributes:
label: Modifications
description: >-
Have you modified the installation, deployment topology, or container images in any way? If yes, please
explain in the "additional information" field at the bottom of the form.
multiple: false
options:
- "no"
- "yes"
validations:
required: true
- type: input
id: ansible-version
attributes:
label: Ansible version
description: What version of Ansible are you running?
validations:
required: false
- type: input
id: operating-system
attributes:
label: Operating system
description: What operating system are you using?
validations:
required: false
- type: dropdown
id: browsers
attributes:
label: Web browser
description: Which browsers are affected?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Edge
validations:
required: false
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: >-
Starting from a new installation of the system, describe exactly how a developer or quality engineer can reproduce the bug
on infrastructure that isn't yours. Include any and all resources created, input values, test users, roles assigned, playbooks used, etc.
validations:
required: true
- type: textarea
id: expected-results
attributes:
label: Expected results
description: What did you expect to happpen when running the steps above?
validations:
required: true
- type: textarea
id: actual-results
attributes:
label: Actual results
description: What actually happened?
validations:
required: true
- type: textarea
id: additional-information
attributes:
label: Additional information
description: Include any relevant log output, links to sosreport, database dumps, screenshots, or other information.
validations:
required: false

View File

@@ -1,3 +1,11 @@
<!--- changelog-entry
# Fill in 'msg' below to have an entry automatically added to the next release changelog.
# Leaving 'msg' blank will not generate a changelog entry for this PR.
# Please ensure this is a simple (and readable) one-line string.
---
msg: ""
-->
##### SUMMARY ##### SUMMARY
<!--- Describe the change, including rationale and design decisions --> <!--- Describe the change, including rationale and design decisions -->
@@ -17,6 +25,7 @@ the change does.
<!--- Name of the module/plugin/module/task --> <!--- Name of the module/plugin/module/task -->
- API - API
- UI - UI
- Collection
##### AWX VERSION ##### AWX VERSION
<!--- Paste verbatim output from `make VERSION` between quotes below --> <!--- Paste verbatim output from `make VERSION` between quotes below -->

12
.github/issue_labeler.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
needs_triage:
- '.*'
"type:bug":
- "Please confirm the following"
"type:enhancement":
- "Feature Idea"
"component:ui":
- "\\[X\\] UI"
"component:api":
- "\\[X\\] API"
"component:docs":
- "\\[X\\] Docs"

14
.github/pr_labeler.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
"component:api":
- any: ['awx/**/*', '!awx/ui/*']
"component:ui":
- any: ['awx/ui/**/*']
"component:docs":
- any: ['docs/**/*']
"component:cli":
- any: ['awxkit/**/*']
"component:collection":
- any: ['awx_collection/**/*']

104
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,104 @@
---
name: CI
env:
BRANCH: ${{ github.base_ref || 'devel' }}
on:
pull_request:
jobs:
common_tests:
name: ${{ matrix.tests.name }}
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
fail-fast: false
matrix:
tests:
- name: api-test
command: /start_tests.sh
label: Run API Tests
- name: api-lint
command: /var/lib/awx/venv/awx/bin/tox -e linters
label: Run API Linters
- name: api-swagger
command: /start_tests.sh swagger
label: Generate API Reference
- name: awx-collection
command: /start_tests.sh test_collection_all
label: Run Collection Tests
- name: api-schema
label: Check API Schema
command: /start_tests.sh detect-schema-change SCHEMA_DIFF_BASE_BRANCH=${{ github.event.pull_request.base.ref }}
- name: ui-lint
label: Run UI Linters
command: make ui-lint
- name: ui-test
label: Run UI Tests
command: make ui-test
steps:
- uses: actions/checkout@v2
- name: Get python version from Makefile
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
- name: Install python ${{ env.py_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.py_version }}
- name: Log in to registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Pre-pull image to warm build cache
run: |
docker pull ghcr.io/${{ github.repository_owner }}/awx_devel:${{ env.BRANCH }} || :
- name: Build image
run: |
DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} COMPOSE_TAG=${{ env.BRANCH }} make docker-compose-build
- name: ${{ matrix.texts.label }}
run: |
docker run -u $(id -u) --rm -v ${{ github.workspace}}:/awx_devel/:Z \
--workdir=/awx_devel ghcr.io/${{ github.repository_owner }}/awx_devel:${{ env.BRANCH }} ${{ matrix.tests.command }}
awx-operator:
runs-on: ubuntu-latest
steps:
- name: Checkout awx
uses: actions/checkout@v2
with:
path: awx
- name: Checkout awx-operator
uses: actions/checkout@v2
with:
repository: ansible/awx-operator
path: awx-operator
- name: Install playbook dependencies
run: |
python3 -m pip install docker
- name: Build AWX image
working-directory: awx
run: |
ansible-playbook -v tools/ansible/build.yml \
-e headless=yes \
-e awx_image=awx \
-e awx_image_tag=ci \
-e ansible_python_interpreter=$(which python3)
- name: Run test deployment with awx-operator
working-directory: awx-operator
run: |
python3 -m pip install -r molecule/requirements.txt
ansible-galaxy collection install -r molecule/requirements.yml
sudo rm -f $(which kustomize)
make kustomize
KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule -v test -s kind
env:
AWX_TEST_IMAGE: awx
AWX_TEST_VERSION: ci

38
.github/workflows/devel_image.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: Push Development Image
on:
push:
branches:
- devel
jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- name: Get python version from Makefile
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
- name: Install python ${{ env.py_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.py_version }}
- name: Log in to registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Pre-pull image to warm build cache
run: |
docker pull ghcr.io/${{ github.repository_owner }}/awx_devel:${GITHUB_REF##*/}
- name: Build image
run: |
DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} COMPOSE_TAG=${GITHUB_REF##*/} make docker-compose-build
- name: Push image
run: |
docker push ghcr.io/${{ github.repository_owner }}/awx_devel:${GITHUB_REF##*/}

108
.github/workflows/e2e_test.yml vendored Normal file
View File

@@ -0,0 +1,108 @@
---
name: E2E Tests
on:
pull_request_target:
types: [labeled]
jobs:
e2e-test:
if: contains(github.event.pull_request.labels.*.name, 'qe:e2e')
runs-on: ubuntu-latest
timeout-minutes: 40
permissions:
packages: write
contents: read
strategy:
matrix:
job: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
steps:
- uses: actions/checkout@v2
- name: Get python version from Makefile
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
- name: Install python ${{ env.py_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.py_version }}
- name: Install system deps
run: sudo apt-get install -y gettext
- name: Log in to registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Pre-pull image to warm build cache
run: |
docker pull ghcr.io/${{ github.repository_owner }}/awx_devel:${{ github.base_ref }}
- name: Build UI
run: |
DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} COMPOSE_TAG=${{ github.base_ref }} make ui-devel
- name: Start AWX
run: |
DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} COMPOSE_TAG=${{ github.base_ref }} make docker-compose &> make-docker-compose-output.log &
- name: Pull awx_cypress_base image
run: |
docker pull quay.io/awx/awx_cypress_base:latest
- name: Checkout test project
uses: actions/checkout@v2
with:
repository: ${{ github.repository_owner }}/tower-qa
ssh-key: ${{ secrets.QA_REPO_KEY }}
path: tower-qa
ref: devel
- name: Build cypress
run: |
cd ${{ secrets.E2E_PROJECT }}/ui-tests/awx-pf-tests
docker build -t awx-pf-tests .
- name: Update default AWX password
run: |
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' -k https://localhost:8043/api/v2/ping/)" != "200" ]]
do
echo "Waiting for AWX..."
sleep 5;
done
echo "AWX is up, updating the password..."
docker exec -i tools_awx_1 sh <<-EOSH
awx-manage update_password --username=admin --password=password
EOSH
- name: Run E2E tests
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
run: |
export COMMIT_INFO_BRANCH=$GITHUB_HEAD_REF
export COMMIT_INFO_AUTHOR=$GITHUB_ACTOR
export COMMIT_INFO_SHA=$GITHUB_SHA
export COMMIT_INFO_REMOTE=$GITHUB_REPOSITORY_OWNER
cd ${{ secrets.E2E_PROJECT }}/ui-tests/awx-pf-tests
AWX_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' tools_awx_1)
printenv > .env
echo "Executing tests:"
docker run \
--network '_sources_default' \
--ipc=host \
--env-file=.env \
-e CYPRESS_baseUrl="https://$AWX_IP:8043" \
-e CYPRESS_AWX_E2E_USERNAME=admin \
-e CYPRESS_AWX_E2E_PASSWORD='password' \
-e COMMAND="npm run cypress-concurrently-gha" \
-v /dev/shm:/dev/shm \
-v $PWD:/e2e \
-w /e2e \
awx-pf-tests run --project .
- name: Save AWX logs
uses: actions/upload-artifact@v2
with:
name: AWX-logs-${{ matrix.job }}
path: make-docker-compose-output.log

22
.github/workflows/label_issue.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Label Issue
on:
issues:
types:
- opened
- reopened
- edited
jobs:
triage:
runs-on: ubuntu-latest
name: Label Issue
steps:
- name: Label Issue
uses: github/issue-labeler@v2.4.1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
not-before: 2021-12-07T07:00:00Z
configuration-path: .github/issue_labeler.yml
enable-versioned-regex: 0

20
.github/workflows/label_pr.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Label PR
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
jobs:
triage:
runs-on: ubuntu-latest
name: Label PR
steps:
- name: Label PR
uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/pr_labeler.yml

26
.github/workflows/promote.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
---
name: Promote Release
on:
release:
types: [published]
jobs:
promote:
runs-on: ubuntu-latest
steps:
- name: Log in to GHCR
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Log in to Quay
run: |
echo ${{ secrets.QUAY_TOKEN }} | docker login quay.io -u ${{ secrets.QUAY_USER }} --password-stdin
- name: Re-tag and promote awx image
run: |
docker pull ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:latest
docker push quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
docker push quay.io/${{ github.repository }}:latest

131
.github/workflows/stage.yml vendored Normal file
View File

@@ -0,0 +1,131 @@
---
name: Stage Release
on:
workflow_dispatch:
inputs:
version:
description: 'AWX version.'
required: true
default: ''
operator_version:
description: 'Operator version. Leave blank to skip staging awx-operator.'
default: ''
confirm:
description: 'Are you sure? Set this to yes.'
required: true
default: 'no'
jobs:
stage:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Verify inputs
run: |
set -e
if [[ ${{ github.event.inputs.confirm }} != "yes" ]]; then
>&2 echo "Confirm must be 'yes'"
exit 1
fi
if [[ ${{ github.event.inputs.version }} == "" ]]; then
>&2 echo "Set version to continue."
exit 1
fi
exit 0
- name: Checkout awx
uses: actions/checkout@v2
with:
path: awx
- name: Get python version from Makefile
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
- name: Install python ${{ env.py_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.py_version }}
- name: Checkout awx-logos
uses: actions/checkout@v2
with:
repository: ansible/awx-logos
path: awx-logos
- name: Checkout awx-operator
uses: actions/checkout@v2
with:
repository: ${{ github.repository_owner }}/awx-operator
path: awx-operator
- name: Install playbook dependencies
run: |
python3 -m pip install docker
- name: Build and stage AWX
working-directory: awx
run: |
ansible-playbook -v tools/ansible/build.yml \
-e registry=ghcr.io \
-e registry_username=${{ github.actor }} \
-e registry_password=${{ secrets.GITHUB_TOKEN }} \
-e awx_image=${{ github.repository }} \
-e awx_version=${{ github.event.inputs.version }} \
-e ansible_python_interpreter=$(which python3) \
-e push=yes \
-e awx_official=yes
- name: Build and stage awx-operator
working-directory: awx-operator
run: |
BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=${{ github.event.inputs.version }}" \
IMAGE_TAG_BASE=ghcr.io/${{ github.repository_owner }}/awx-operator \
VERSION=${{ github.event.inputs.operator_version }} make docker-build docker-push
- name: Run test deployment with awx-operator
working-directory: awx-operator
run: |
python3 -m pip install -r molecule/requirements.txt
ansible-galaxy collection install -r molecule/requirements.yml
sudo rm -f $(which kustomize)
make kustomize
KUSTOMIZE_PATH=$(readlink -f bin/kustomize) molecule test -s kind
env:
AWX_TEST_IMAGE: ${{ github.repository }}
AWX_TEST_VERSION: ${{ github.event.inputs.version }}
- name: Generate changelog
uses: shanemcd/simple-changelog-generator@v1
id: changelog
with:
repo: "${{ github.repository }}"
- name: Write changelog to file
run: |
cat << 'EOF' > /tmp/awx-changelog
${{ steps.changelog.outputs.changelog }}
EOF
- name: Create draft release for AWX
working-directory: awx
run: |
ansible-playbook -v tools/ansible/stage.yml \
-e changelog_path=/tmp/awx-changelog \
-e repo=${{ github.repository }} \
-e awx_image=ghcr.io/${{ github.repository }} \
-e version=${{ github.event.inputs.version }} \
-e github_token=${{ secrets.GITHUB_TOKEN }}
- name: Create draft release for awx-operator
if: ${{ github.event.inputs.operator_version != '' }}
working-directory: awx
run: |
ansible-playbook tools/ansible/stage.yml \
-e version=${{ github.event.inputs.operator_version }} \
-e repo=${{ github.repository_owner }}/awx-operator \
-e github_token=${{ secrets.AWX_OPERATOR_RELEASE_TOKEN }}

52
.github/workflows/upload_schema.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
---
name: Upload API Schema
on:
push:
branches:
- devel
- release_4.1
jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- name: Get python version from Makefile
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
- name: Install python ${{ env.py_version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.py_version }}
- name: Log in to registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Pre-pull image to warm build cache
run: |
docker pull ghcr.io/${{ github.repository_owner }}/awx_devel:${GITHUB_REF##*/} || :
- name: Build image
run: |
DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} COMPOSE_TAG=${GITHUB_REF##*/} make docker-compose-build
- name: Generate API Schema
run: |
docker run -u $(id -u) --rm -v ${{ github.workspace }}:/awx_devel/:Z \
--workdir=/awx_devel ghcr.io/${{ github.repository_owner }}/awx_devel:${GITHUB_REF##*/} /start_tests.sh genschema
- name: Upload API Schema
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: 'us-east-1'
run: |
ansible localhost -c local, -m command -a "{{ ansible_python_interpreter + ' -m pip install boto3'}}"
ansible localhost -c local -m aws_s3 \
-a "src=${{ github.workspace }}/schema.json bucket=awx-public-ci-files object=${GITHUB_REF##*/}/schema.json mode=put permission=public-read"

19
.gitignore vendored
View File

@@ -28,12 +28,12 @@ awx/ui/build_test
awx/ui/client/languages awx/ui/client/languages
awx/ui/templates/ui/index.html awx/ui/templates/ui/index.html
awx/ui/templates/ui/installing.html awx/ui/templates/ui/installing.html
awx/ui_next/node_modules/ awx/ui/node_modules/
awx/ui_next/src/locales/*/messages.js awx/ui/src/locales/*/messages.js
awx/ui_next/coverage/ awx/ui/coverage/
awx/ui_next/build awx/ui/build
awx/ui_next/.env.local awx/ui/.env.local
awx/ui_next/instrumented awx/ui/instrumented
rsyslog.pid rsyslog.pid
tools/prometheus/data tools/prometheus/data
tools/docker-compose/ansible/awx_dump.sql tools/docker-compose/ansible/awx_dump.sql
@@ -41,6 +41,8 @@ tools/docker-compose/Dockerfile
tools/docker-compose/_build tools/docker-compose/_build
tools/docker-compose/_sources tools/docker-compose/_sources
tools/docker-compose/overrides/ tools/docker-compose/overrides/
tools/docker-compose-minikube/_sources
tools/docker-compose/keycloak.awx.realm.json
# Tower setup playbook testing # Tower setup playbook testing
setup/test/roles/postgresql setup/test/roles/postgresql
@@ -57,19 +59,18 @@ __pycache__
/dist /dist
/*.egg-info /*.egg-info
*.py[c,o] *.py[c,o]
/.eggs
# JavaScript # JavaScript
/Gruntfile.js /Gruntfile.js
/Brocfile.js /Brocfile.js
/bower.json /bower.json
/package.json
/testem.yml /testem.yml
**/coverage **/coverage
/.istanbul.yml /.istanbul.yml
**/node_modules/** **/node_modules/**
/tmp /tmp
**/npm-debug.log* **/npm-debug.log*
**/package-lock.json
# UI build flag files # UI build flag files
awx/ui/.deps_built awx/ui/.deps_built
@@ -153,7 +154,7 @@ use_dev_supervisor.txt
.idea/* .idea/*
*.unison.tmp *.unison.tmp
*.# *.#
/awx/ui_next/.ui-built /awx/ui/.ui-built
/Dockerfile /Dockerfile
/_build/ /_build/
/_build_kube_dev/ /_build_kube_dev/

View File

@@ -1,12 +1,16 @@
--- ---
ignore: | ignore: |
.github
.tox .tox
awx/main/tests/data/inventory/plugins/** awx/main/tests/data/inventory/plugins/**
# vault files # vault files
awx/main/tests/data/ansible_utils/playbooks/valid/vault.yml awx/main/tests/data/ansible_utils/playbooks/valid/vault.yml
awx/ui/test/e2e/tests/smoke-vars.yml awx/ui/test/e2e/tests/smoke-vars.yml
awx/ui/node_modules
tools/docker-compose/_sources
extends: default extends: default
rules: rules:
line-length: disable line-length: disable
truthy: disable

View File

@@ -1,501 +1,7 @@
# Changelog # Changelog
# 19.2.2 (June 28, 2021) **Note:** This file is deprecated and will be removed at some point in a future release.
- Fixed bug where symlinks pointing to directories were not preserved (https://github.com/ansible/ansible-runner/pull/736) Starting with AWX 20, release notes are published to [GitHub Releases](https://github.com/ansible/awx/releases).
- Various bugfixes found during testing (https://github.com/ansible/awx/pull/10532)
# 19.2.1 (June 17, 2021) For older release notes, see https://github.com/ansible/awx/blob/19.3.0/CHANGELOG.md.
- There are now 2 default Instance Groups: 'controlplane' and 'default' (https://github.com/ansible/awx/pull/10324)
- Removed deprecated modules: `tower_send`, `tower_receive`, `tower_workflow_template` (https://github.com/ansible/awx/pull/9980)
- Improved UI performance when a large amount of events are being emitted by jobs (https://github.com/ansible/awx/pull/10053)
- Settings UI Revert All button now issues a DELETE instead of PATCHing all fields (https://github.com/ansible/awx/pull/10376)
- Fixed a bug with the schedule date/time picker in Firefox (https://github.com/ansible/awx/pull/10291)
- UI now preselects the system default Galaxy credential when creating a new organization (https://github.com/ansible/awx/pull/10395)
- Added favicon (https://github.com/ansible/awx/pull/10388)
- Removed `not` option from smart inventory host filter search as it's not supported by the API (https://github.com/ansible/awx/pull/10380)
- Added button to allow user to refetch project revision after project sync has finished (https://github.com/ansible/awx/pull/10334)
- Fixed bug where extraneous CONFIG requests were made on logout (https://github.com/ansible/awx/pull/10379)
- Fixed bug where users were unable to cancel inventory syncs (https://github.com/ansible/awx/pull/10346)
- Added missing dashboard graph filters (https://github.com/ansible/awx/pull/10349)
- Added support for typing in to single select lookup form fields (https://github.com/ansible/awx/pull/10257)
- Fixed various bugs related to user sessions (https://github.com/ansible/awx/pull/9908)
- Fixed bug where sorting in modals would close the modal (https://github.com/ansible/awx/pull/10215)
- Added support for Red Hat Insights as an inventory source (https://github.com/ansible/awx/pull/8650)
- Fixed bugs when selecting items in a list then sorting/paginating (https://github.com/ansible/awx/pull/10329)
# 19.2.0 (June 1, 2021)
- Fixed race condition that would sometimes cause jobs to error out at the very end of an otherwise successful run (https://github.com/ansible/receptor/pull/328)
- Fixes bug where users were unable to click on text next to checkboxes in modals (https://github.com/ansible/awx/pull/10279)
- Have the project update playbook warn if role/collection syncing is disabled. (https://github.com/ansible/awx/pull/10068)
- Move irc references to point to irc.libera.chat (https://github.com/ansible/awx/pull/10295)
- Fixes bug where activity stream changes were displaying as [object object] (https://github.com/ansible/awx/pull/10267)
- Update awxkit to enable export of Galaxy credentials associated to organizations (https://github.com/ansible/awx/pull/10271)
- Bump receptor and receptorctl versions to 1.0.0a2 (https://github.com/ansible/awx/pull/10261)
- Add the ability to disable local authentication (https://github.com/ansible/awx/pull/10102)
- Show error if no Execution Environment is found on project sync/job run (https://github.com/ansible/awx/pull/10183)
- Allow for editing and deleting managed_by_tower EEs from API/UI (https://github.com/ansible/awx/pull/10173)
# 19.1.0 (May 1, 2021)
- Custom inventory scripts have been removed from the API https://github.com/ansible/awx/pull/9822
- Old scripts can be exported via `awx-manage export_custom_scripts`
- Fixed a bug where ad-hoc commands targeted against multiple hosts would run against only 1 host https://github.com/ansible/awx/pull/9973
- AWX will now look for a top-level requirements.yml when installing collections / roles in project updates https://github.com/ansible/awx/pull/9945
- Improved error handling when Container Group pods fail to launch https://github.com/ansible/awx/pull/10025
- Added ability to set server-side password policies using Django's AUTH_PASSWORD_VALIDATORS setting https://github.com/ansible/awx/pull/9999
- Bumped versions of Ansible Runner & AWX EE https://github.com/ansible/awx/pull/10013
- If you have built any custom EEs on top of awx-ee 0.1.0, you will need to rebuild on top of 0.2.0.
- Remove legacy resource profiling code https://github.com/ansible/awx/pull/9883
# 19.0.0 (April 7, 2021)
- AWX now runs on Python 3.8 (https://github.com/ansible/awx/pull/8778/)
- Fixed inventories-from-projects when running in Kubernetes (https://github.com/ansible/awx/pull/9741)
- Fixed a bug where a slash was appended to invetory file paths in UI dropdown (https://github.com/ansible/awx/pull/9713)
- Fix a bug with large file parsing in project sync (https://github.com/ansible/awx/pull/9627)
- Fix k8s credentials that use a custom ca cert (https://github.com/ansible/awx/pull/9744)
- Fix a bug that allowed a user to attempt deleting a running job (https://github.com/ansible/awx/pull/9758)
- Fixed the Kubernetes Pod reaper to properly delete Pods launched by Receptor (https://github.com/ansible/awx/pull/9819)
- AWX Collection Modules: added ability to set instance groups for organization, job templates, and inventories. (https://github.com/ansible/awx/pull/9804)
- Fixed CSP violation errors on job details and job settings views (https://github.com/ansible/awx/pull/9818)
- Added support for convergence any/all on workflow nodes (https://github.com/ansible/awx/pull/9737)
- Fixed race condition that causes InvalidGitRepositoryError (https://github.com/ansible/awx/pull/9754)
- Added support for Execution Environments to the Activity Stream (https://github.com/ansible/awx/issues/9308)
- Fixed a bug that improperly formats OpenSSH keys specified in custom Credential Types (https://github.com/ansible/awx/issues/9361)
- Fixed an HTTP 500 error for unauthenticated users (https://github.com/ansible/awx/pull/9725)
- Added subscription wizard: https://github.com/ansible/awx/pull/9496
# 18.0.0 (March 23, 2021)
**IMPORTANT INSTALL AND UPGRADE NOTES**
Starting in version 18.0, the [AWX Operator](https://github.com/ansible/awx-operator) is the preferred way to install AWX: https://github.com/ansible/awx/blob/devel/INSTALL.md#installing-awx
If you have a pre-existing installation of AWX that utilizes the Docker-based installation method, this install method has ** notably changed** from 17.x to 18.x. For details, please see:
- https://groups.google.com/g/awx-project/c/47MjWSUQaOc/m/bCjSDn0eBQAJ
- https://github.com/ansible/awx/blob/devel/tools/docker-compose
- https://github.com/ansible/awx/blob/devel/tools/docker-compose/docs/data_migration.md
### Introducing Execution Environments
After a herculean effort from a number of contributors, we're excited to announce that AWX 18.0.0 introduces a new concept called Execution Environments.
Execution Environments are container images which consist of everything necessary to run a playbook within AWX, and which drive the entire management and lifecycle of playbook execution runtime in AWX: https://github.com/ansible/awx/issues/5157. This means that going forward, AWX no longer utilizes the [bubblewrap](https://github.com/containers/bubblewrap) project for playbook isolation, but instead utilizes a container per playbook run.
Much like custom virtualenvs, custom Execution Environments can be crafted to specify additional Python or system-level dependencies. [Ansible Builder](https://github.com/ansible/ansible-builder) outputs images you can upload to your registry which can *then* be defined in AWX and utilized for playbook runs.
To learn more about Ansible Builder and Execution Environments, see: https://www.ansible.com/blog/introduction-to-ansible-builder
### Other Notable Changes
- Removed `installer` directory.
- The Kubernetes installer has been removed in favor of [AWX Operator](https://github.com/ansible/awx-operator). Official images for Operator-based installs are no longer hosted on Docker Hub, but are instead available on [Quay](https://quay.io/repository/ansible/awx?tab=tags).
- The "Local Docker" install method has been removed in favor of the development environment. Details can be found at: https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md
- Removal of custom virtual environments https://github.com/ansible/awx/pull/9498
- Custom virtual environments have been replaced by Execution Environments https://github.com/ansible/awx/pull/9570
- The default Container Group Pod definition has changed. All custom Pod specs have been reset. https://github.com/ansible/awx/commit/05ef51f710dad8f8036bc5acee4097db4adc0d71
- Added user interface for the activity stream: https://github.com/ansible/awx/pull/9083
- Converted many of the top-level list views (Jobs, Teams, Hosts, Inventories, Projects, and more) to a new, permanent table component for substantially increased responsiveness, usability, maintainability, and other 'ility's: https://github.com/ansible/awx/pull/8970, https://github.com/ansible/awx/pull/9182 and many others!
- Added support for Centrify Vault (https://www.centrify.com) as a credential lookup plugin (https://github.com/ansible/awx/pull/9542)
- Added support for namespaces in Hashicorp Vault credential plugin (https://github.com/ansible/awx/pull/9590)
- Added click-to-expand details for job tables
- Added search filtering to job output https://github.com/ansible/awx/pull/9208
- Added the new migration, update, and "installation in progress" page https://github.com/ansible/awx/pull/9123
- Added the user interface for job settings https://github.com/ansible/awx/pull/8661
- Runtime errors from jobs are now displayed, along with an explanation for what went wrong, on the output page https://github.com/ansible/awx/pull/8726
- You can now cancel a running job from its output and details panel https://github.com/ansible/awx/pull/9199
- Fixed a bug where launch prompt inputs were unexpectedly deposited in the url: https://github.com/ansible/awx/pull/9231
- Playbook, credential type, and inventory file inputs now support type-ahead and manual type-in! https://github.com/ansible/awx/pull/9120
- Added ability to relaunch against failed hosts: https://github.com/ansible/awx/pull/9225
- Added pending workflow approval count to the application header https://github.com/ansible/awx/pull/9334
- Added user interface for management jobs: https://github.com/ansible/awx/pull/9224
- Added toast message to show notification template test result to notification templates list https://github.com/ansible/awx/pull/9318
- Replaced CodeMirror with AceEditor for editing template variables and notification templates https://github.com/ansible/awx/pull/9281
- Added support for filtering and pagination on job output https://github.com/ansible/awx/pull/9208
- Added support for html in custom login text https://github.com/ansible/awx/pull/9519
# 17.1.0 (March 9, 2021)
- Addressed a security issue in AWX (CVE-2021-20253)
- Fixed a bug permissions error related to redis in K8S-based deployments: https://github.com/ansible/awx/issues/9401
# 17.0.1 (January 26, 2021)
- Fixed pgdocker directory permissions issue with Local Docker installer: https://github.com/ansible/awx/pull/9152
- Fixed a bug in the UI which caused toggle settings to not be changed when clicked: https://github.com/ansible/awx/pull/9093
# 17.0.0 (January 22, 2021)
- AWX now requires PostgreSQL 12 by default: https://github.com/ansible/awx/pull/8943
**Note:** users who encounter permissions errors at upgrade time should `chown -R ~/.awx/pgdocker` to ensure it's owned by the user running the install playbook
- Added support for region name for OpenStack inventory: https://github.com/ansible/awx/issues/5080
- Added the ability to chain undefined attributes in custom notification templates: https://github.com/ansible/awx/issues/8677
- Dramatically simplified the `image_build` role: https://github.com/ansible/awx/pull/8980
- Fixed a bug which can cause schema migrations to fail at install time: https://github.com/ansible/awx/issues/9077
- Fixed a bug which caused the `is_superuser` user property to be out of date in certain circumstances: https://github.com/ansible/awx/pull/8833
- Fixed a bug which sometimes results in race conditions on setting access: https://github.com/ansible/awx/pull/8580
- Fixed a bug which sometimes causes an unexpected delay in stdout for some playbooks: https://github.com/ansible/awx/issues/9085
- (UI) Added support for credential password prompting on job launch: https://github.com/ansible/awx/pull/9028
- (UI) Added the ability to configure LDAP settings in the UI: https://github.com/ansible/awx/issues/8291
- (UI) Added a sync button to the Project detail view: https://github.com/ansible/awx/issues/8847
- (UI) Added a form for configuring Google Outh 2.0 settings: https://github.com/ansible/awx/pull/8762
- (UI) Added searchable keys and related keys to the Credentials list: https://github.com/ansible/awx/issues/8603
- (UI) Added support for advanced search and copying to Notification Templates: https://github.com/ansible/awx/issues/7879
- (UI) Added support for prompting on workflow nodes: https://github.com/ansible/awx/issues/5913
- (UI) Added support for session timeouts: https://github.com/ansible/awx/pull/8250
- (UI) Fixed a bug that broke websocket streaming for the insecure ws:// protocol: https://github.com/ansible/awx/pull/8877
- (UI) Fixed a bug in the user interface when a translation for the browser's preferred locale isn't available: https://github.com/ansible/awx/issues/8884
- (UI) Fixed bug where navigating from one survey question form directly to another wasn't reloading the form: https://github.com/ansible/awx/issues/7522
- (UI) Fixed a bug which can cause an uncaught error while launching a Job Template: https://github.com/ansible/awx/issues/8936
- Updated autobahn to address CVE-2020-35678
## 16.0.0 (December 10, 2020)
- AWX now ships with a reimagined user interface. **Please read this before upgrading:** https://groups.google.com/g/awx-project/c/KuT5Ao92HWo
- Removed support for syncing inventory from Red Hat CloudForms - https://github.com/ansible/awx/commit/0b701b3b2
- Removed support for Mercurial-based project updates - https://github.com/ansible/awx/issues/7932
- Upgraded NodeJS to actively maintained LTS 14.15.1 - https://github.com/ansible/awx/pull/8766
- Added Git-LFS to the default image build - https://github.com/ansible/awx/pull/8700
- Added the ability to specify `metadata.labels` in the podspec for container groups - https://github.com/ansible/awx/issues/8486
- Added support for Kubernetes pod annotations - https://github.com/ansible/awx/pull/8434
- Added the ability to label the web container in local Docker installs - https://github.com/ansible/awx/pull/8449
- Added additional metadata (as an extra var) to playbook runs to report the SCM branch name - https://github.com/ansible/awx/pull/8433
- Fixed a bug that caused k8s installations to fail due to an incorrect Helm repo - https://github.com/ansible/awx/issues/8715
- Fixed a bug that prevented certain Workflow Approval resources from being deleted - https://github.com/ansible/awx/pull/8612
- Fixed a bug that prevented the deletion of inventories stuck in "pending deletion" state - https://github.com/ansible/awx/issues/8525
- Fixed a display bug in webhook notifications with certain unicode characters - https://github.com/ansible/awx/issues/7400
- Improved support for exporting dependent objects (Inventory Hosts and Groups) in the `awx export` CLI tool - https://github.com/ansible/awx/commit/607bc0788
## 15.0.1 (October 20, 2020)
- Added several optimizations to improve performance for a variety of high-load simultaneous job launch use cases https://github.com/ansible/awx/pull/8403
- Added the ability to source roles and collections from requirements.yaml files (not just requirements.yml) - https://github.com/ansible/awx/issues/4540
- awx.awx collection modules now provide a clearer error message for incompatible versions of awxkit - https://github.com/ansible/awx/issues/8127
- Fixed a bug in notification messages that contain certain unicode characters - https://github.com/ansible/awx/issues/7400
- Fixed a bug that prevents the deletion of Workflow Approval records - https://github.com/ansible/awx/issues/8305
- Fixed a bug that broke the selection of webhook credentials - https://github.com/ansible/awx/issues/7892
- Fixed a bug which can cause confusing behavior for social auth logins across distinct browser tabs - https://github.com/ansible/awx/issues/8154
- Fixed several bugs in the output of Workflow Job Templates using the `awx export` tool - https://github.com/ansible/awx/issues/7798 https://github.com/ansible/awx/pull/7847
- Fixed a race condition that can lead to missing hosts when running parallel inventory syncs - https://github.com/ansible/awx/issues/5571
- Fixed an HTTP 500 error when certain LDAP group parameters aren't properly set - https://github.com/ansible/awx/issues/7622
- Updated a few dependencies in response to several CVEs:
* CVE-2020-7720
* CVE-2020-7743
* CVE-2020-7676
## 15.0.0 (September 30, 2020)
- Added improved support for fetching Ansible collections from private Galaxy content sources (such as https://github.com/ansible/galaxy_ng) - https://github.com/ansible/awx/issues/7813
**Note:** as part of this change, new Organizations created in the AWX API will _no longer_ automatically synchronize roles and collections from galaxy.ansible.com by default. More details on this change can be found at: https://github.com/ansible/awx/issues/8341#issuecomment-707310633
- AWX now utilizes a version of certifi that auto-discovers certificates in the system certificate store - https://github.com/ansible/awx/pull/8242
- Added support for arbitrary custom inventory plugin configuration: https://github.com/ansible/awx/issues/5150
- Added an optional setting to disable the auto-creation of organizations and teams on successful SAML login. - https://github.com/ansible/awx/pull/8069
- Added a number of optimizations to AWX's callback receiver to improve the speed of stdout processing for simultaneous playbooks runs - https://github.com/ansible/awx/pull/8193 https://github.com/ansible/awx/pull/8191
- Added the ability to use `!include` and `!import` constructors when constructing YAML for use with the AWX CLI - https://github.com/ansible/awx/issues/8135
- Fixed a bug that prevented certain users from being able to edit approval nodes in Workflows - https://github.com/ansible/awx/pull/8253
- Fixed a bug that broke password prompting for credentials in certain cases - https://github.com/ansible/awx/issues/8202
- Fixed a bug which can cause PostgreSQL deadlocks when running many parallel playbooks against large shared inventories - https://github.com/ansible/awx/issues/8145
- Fixed a bug which can cause delays in AWX's task manager when large numbers of simultaneous jobs are scheduled - https://github.com/ansible/awx/issues/7655
- Fixed a bug which can cause certain scheduled jobs - those that run every X minute(s) or hour(s) - to fail to run at the proper time - https://github.com/ansible/awx/issues/8071
- Fixed a performance issue for playbooks that store large amounts of data using the `set_stats` module - https://github.com/ansible/awx/issues/8006
- Fixed a bug related to AWX's handling of the auth_path argument for the HashiVault KeyValue credential plugin - https://github.com/ansible/awx/pull/7991
- Fixed a bug that broke support for Remote Archive SCM Type project syncs on platforms that utilize Python2 - https://github.com/ansible/awx/pull/8057
- Updated to the latest version of Django Rest Framework to address CVE-2020-25626
- Updated to the latest version of Django to address CVE-2020-24583 and CVE-2020-24584
- Updated to the latest verson of channels_redis to address a bug that slowly causes Daphne processes to leak memory over time - https://github.com/django/channels_redis/issues/212
## 14.1.0 (Aug 25, 2020)
- AWX images can now be built on ARM64 - https://github.com/ansible/awx/pull/7607
- Added the Remote Archive SCM Type to support using immutable artifacts and releases (such as tarballs and zip files) as projects - https://github.com/ansible/awx/issues/7954
- Deprecated official support for Mercurial-based project updates - https://github.com/ansible/awx/issues/7932
- Added resource import/export support to the official AWX collection - https://github.com/ansible/awx/issues/7329
- Added the ability to import YAML-based resources (instead of just JSON) when using the AWX CLI - https://github.com/ansible/awx/pull/7808
- Users upgrading from older versions of AWX may encounter an issue that causes their postgres container to restart in a loop (https://github.com/ansible/awx/issues/7854) - if you encounter this, bring your containers down and then back up (e.g., `docker-compose down && docker-compose up -d`) after upgrading to 14.1.0.
- Updated the AWX CLI to export labels associated with Workflow Job Templates - https://github.com/ansible/awx/pull/7847
- Updated to the latest python-ldap to address a bug - https://github.com/ansible/awx/issues/7868
- Upgraded git-python to fix a bug that caused workflows to sometimes fail - https://github.com/ansible/awx/issues/6119
- Worked around a bug in the channels_redis library that slowly causes Daphne processes to leak memory over time - https://github.com/django/channels_redis/issues/212
- Fixed a bug in the AWX CLI that prevented Workflow nodes from importing properly - https://github.com/ansible/awx/issues/7793
- Fixed a bug in the awx.awx collection release process that templated the wrong version - https://github.com/ansible/awx/issues/7870
- Fixed a bug that caused errors rendering stdout that contained UTF-16 surrogate pairs - https://github.com/ansible/awx/pull/7918
## 14.0.0 (Aug 6, 2020)
- As part of our commitment to inclusivity in open source, we recently took some time to audit AWX's source code and user interface and replace certain terminology with more inclusive language. Strictly speaking, this isn't a bug or a feature, but we think it's important and worth calling attention to:
* https://github.com/ansible/awx/commit/78229f58715fbfbf88177e54031f532543b57acc
* https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language
- Installing roles and collections via requirements.yml as part of Project Updates now requires at least Ansible 2.9 - https://github.com/ansible/awx/issues/7769
- Deprecated the use of the `PRIMARY_GALAXY_USERNAME` and `PRIMARY_GALAXY_PASSWORD` settings. We recommend using tokens to access Galaxy or Automation Hub.
- Added local caching for downloaded roles and collections so they are not re-downloaded on nodes where they are up to date with the project - https://github.com/ansible/awx/issues/5518
- Added the ability to associate K8S/OpenShift credentials to Job Template for playbook interaction with the `community.kubernetes` collection - https://github.com/ansible/awx/issues/5735
- Added the ability to include HTML in the Custom Login Info presented on the login page - https://github.com/ansible/awx/issues/7600
- Fixed https://access.redhat.com/security/cve/cve-2020-14327 - Server-side request forgery on credentials
- Fixed https://access.redhat.com/security/cve/cve-2020-14328 - Server-side request forgery on webhooks
- Fixed https://access.redhat.com/security/cve/cve-2020-14329 - Sensitive data exposure on labels
- Fixed https://access.redhat.com/security/cve/cve-2020-14337 - Named URLs allow for testing the presence or absence of objects
- Fixed a number of bugs in the user interface related to an upgrade of jQuery:
* https://github.com/ansible/awx/issues/7530
* https://github.com/ansible/awx/issues/7546
* https://github.com/ansible/awx/issues/7534
* https://github.com/ansible/awx/issues/7606
- Fixed a bug that caused the `-f yaml` flag of the AWX CLI to not print properly formatted YAML - https://github.com/ansible/awx/issues/7795
- Fixed a bug in the installer that caused errors when `docker_registry_password` was set - https://github.com/ansible/awx/issues/7695
- Fixed a permissions error that prevented certain users from starting AWX services - https://github.com/ansible/awx/issues/7545
- Fixed a bug that allows superusers to run unsafe Jinja code when defining custom Credential Types - https://github.com/ansible/awx/pull/7584/
- Fixed a bug that prevented users from creating (or editing) custom Credential Types containing boolean fields - https://github.com/ansible/awx/issues/7483
- Fixed a bug that prevented users with postgres usernames containing uppercase letters from restoring backups succesfully - https://github.com/ansible/awx/pull/7519
- Fixed a bug which allowed the creation (in the Tower API) of Groups and Hosts with the same name - https://github.com/ansible/awx/issues/4680
## 13.0.0 (Jun 23, 2020)
- Added import and export commands to the official AWX CLI, replacing send and receive from the old tower-cli (https://github.com/ansible/awx/pull/6125).
- Removed scripts as a means of running inventory updates of built-in types (https://github.com/ansible/awx/pull/6911)
- Ansible 2.8 is now partially unsupported; some inventory source types are known to no longer work.
- Fixed an issue where the vmware inventory source ssl_verify source variable was not recognized (https://github.com/ansible/awx/pull/7360)
- Fixed a bug that caused redis' listen socket to have too-permissive file permissions (https://github.com/ansible/awx/pull/7317)
- Fixed a bug that caused rsyslogd's configuration file to have world-readable file permissions, potentially leaking secrets (CVE-2020-10782)
## 12.0.0 (Jun 9, 2020)
- Removed memcached as a dependency of AWX (https://github.com/ansible/awx/pull/7240)
- Moved to a single container image build instead of separate awx_web and awx_task images. The container image is just `awx` (https://github.com/ansible/awx/pull/7228)
- Official AWX container image builds now use a two-stage container build process that notably reduces the size of our published images (https://github.com/ansible/awx/pull/7017)
- Removed support for HipChat notifications ([EoL announcement](https://www.atlassian.com/partnerships/slack/faq#faq-98b17ca3-247f-423b-9a78-70a91681eff0)); all previously-created HipChat notification templates will be deleted due to this removal.
- Fixed a bug which broke AWX installations with oc version 4.3 (https://github.com/ansible/awx/pull/6948/)
- Fixed a performance issue that caused notable delay of stdout processing for playbooks run against large numbers of hosts (https://github.com/ansible/awx/issues/6991)
- Fixed a bug that caused CyberArk AIM credential plugin looks to hang forever in some environments (https://github.com/ansible/awx/issues/6986)
- Fixed a bug that caused ANY/ALL converage settings not to properly save when editing approval nodes in the UI (https://github.com/ansible/awx/issues/6998)
- Fixed a bug that broke support for the satellite6_group_prefix source variable (https://github.com/ansible/awx/issues/7031)
- Fixed a bug that prevented changes to workflow node convergence settings when approval nodes were in use (https://github.com/ansible/awx/issues/7063)
- Fixed a bug that caused notifications to fail on newer version of Mattermost (https://github.com/ansible/awx/issues/7264)
- Fixed a bug (by upgrading to 0.8.1 of the foreman collection) that prevented host_filters from working properly with Foreman-based inventory (https://github.com/ansible/awx/issues/7225)
- Fixed a bug that prevented the usage of the Conjur credential plugin with secrets that contain spaces (https://github.com/ansible/awx/issues/7191)
- Fixed a bug in awx-manage run_wsbroadcast --status in kubernetes (https://github.com/ansible/awx/pull/7009)
- Fixed a bug that broke notification toggles for system jobs in the UI (https://github.com/ansible/awx/pull/7042)
- Fixed a bug that broke local pip installs of awxkit (https://github.com/ansible/awx/issues/7107)
- Fixed a bug that prevented PagerDuty notifications from sending for workflow job template approvals (https://github.com/ansible/awx/issues/7094)
- Fixed a bug that broke external log aggregation support for URL paths that include the = character (such as the tokens for SumoLogic) (https://github.com/ansible/awx/issues/7139)
- Fixed a bug that prevented organization admins from removing labels from workflow job templates (https://github.com/ansible/awx/pull/7143)
## 11.2.0 (Apr 29, 2020)
- Inventory updates now use collection-based plugins by default (in Ansible 2.9+):
- amazon.aws.aws_ec2
- community.vmware.vmware_vm_inventory
- azure.azcollection.azure_rm
- google.cloud.gcp_compute
- theforeman.foreman.foreman
- openstack.cloud.openstack
- ovirt.ovirt_collection.ovirt
- awx.awx.tower
- Added support for Approle and LDAP/AD mechanisms to the Hashicorp Vault credential plugin (https://github.com/ansible/awx/issues/5076)
- Added Project (Domain Name) support for the OpenStack Keystone v3 API (https://github.com/ansible/awx/issues/6831)
- Added a new setting for raising log verbosity for rsyslogd (https://github.com/ansible/awx/pull/6818)
- Added the ability to monitor stdout in the CLI for running jobs and workflow jobs (https://github.com/ansible/awx/issues/6165)
- Fixed a bug which prevented the AWX CLI from properly installing with newer versions of pip (https://github.com/ansible/awx/issues/6870)
- Fixed a bug which broke AWX's external logging support when configured with HTTPS endpoints that utilize self-signed certificates (https://github.com/ansible/awx/issues/6851)
- Fixed a local docker installer bug that mistakenly attempted to upgrade PostgreSQL when an external pg_hostname is specified (https://github.com/ansible/awx/pull/5398)
- Fixed a race condition that caused task container crashes when pods are quickly brought down and back up (https://github.com/ansible/awx/issues/6750)
- Fixed a bug that caused 404 errors when attempting to view the second page of the workflow approvals view (https://github.com/ansible/awx/issues/6803)
- Fixed a bug that prevented the use of ANSIBLE_SSH_ARGS for ad-hoc-commands (https://github.com/ansible/awx/pull/6811)
- Fixed a bug that broke AWX installs/upgrades on Red Hat OpenShift (https://github.com/ansible/awx/issues/6791)
## 11.1.0 (Apr 22, 2020)
- Changed rsyslogd to persist queued events to disk (to prevent a risk of out-of-memory errors) (https://github.com/ansible/awx/issues/6746)
- Added the ability to configure the destination and maximum disk size of rsyslogd spool (in the event of a log aggregator outage) (https://github.com/ansible/awx/pull/6763)
- Added the ability to discover playbooks in project clones from symlinked directories (https://github.com/ansible/awx/pull/6773)
- Fixed a bug that caused certain log aggregator settings to break logging integration (https://github.com/ansible/awx/issues/6760)
- Fixed a bug that caused playbook execution in container groups to sometimes unexpectedly deadlock (https://github.com/ansible/awx/issues/6692)
- Improved stability of the new redis clustering implementation (https://github.com/ansible/awx/pull/6739 https://github.com/ansible/awx/pull/6720)
- Improved stability of the new rsyslogd-based logging implementation (https://github.com/ansible/awx/pull/6796)
## 11.0.0 (Apr 16, 2020)
- As of AWX 11.0.0, Kubernetes-based deployments use a Deployment rather than a StatefulSet.
- Reimplemented external logging support using rsyslogd to improve reliability and address a number of issues (https://github.com/ansible/awx/issues/5155)
- Changed activity stream logs to include summary fields for related objects (https://github.com/ansible/awx/issues/1761)
- Added code to more gracefully attempt to reconnect to redis if it restarts/becomes unavailable (https://github.com/ansible/awx/pull/6670)
- Fixed a bug that caused REFRESH_TOKEN_EXPIRE_SECONDS to not properly be respected for OAuth2.0 refresh tokens generated by AWX (https://github.com/ansible/awx/issues/6630)
- Fixed a bug that broke schedules containing RRULES with very old DTSTART dates (https://github.com/ansible/awx/pull/6550)
- Fixed a bug that broke installs on older versions of Ansible packaged with certain Linux distributions (https://github.com/ansible/awx/issues/5501)
- Fixed a bug that caused the activity stream to sometimes report the incorrect actor when associating user membership on SAML login (https://github.com/ansible/awx/pull/6525)
- Fixed a bug in AWX's Grafana notification support when annotation tags are omitted (https://github.com/ansible/awx/issues/6580)
- Fixed a bug that prevented some users from searching for Source Control credentials in the AWX user interface (https://github.com/ansible/awx/issues/6600)
- Fixed a bug that prevented disassociating orphaned users from credentials (https://github.com/ansible/awx/pull/6554)
- Updated Twisted to address CVE-2020-10108 and CVE-2020-10109.
## 10.0.0 (Mar 30, 2020)
- As of AWX 10.0.0, the official AWX CLI no longer supports Python 2 (it requires at least Python 3.6) (https://github.com/ansible/awx/pull/6327)
- AWX no longer relies on RabbitMQ; Redis is added as a new dependency (https://github.com/ansible/awx/issues/5443)
- Altered AWX's event tables to allow more than ~2 billion total events (https://github.com/ansible/awx/issues/6010)
- Improved the performance (time to execute, and memory consumption) of the periodic job cleanup system job (https://github.com/ansible/awx/pull/6166)
- Updated Job Templates so they now have an explicit Organization field (it is no longer inferred from the associated Project) (https://github.com/ansible/awx/issues/3903)
- Updated social-auth-core to address an upcoming GitHub API deprecation (https://github.com/ansible/awx/issues/5970)
- Updated to ansible-runner 1.4.6 to address various bugs.
- Updated Django to address CVE-2020-9402
- Updated pyyaml version to address CVE-2017-18342
- Fixed a bug which prevented the new `scm_branch` field from being used in custom notification templates (https://github.com/ansible/awx/issues/6258)
- Fixed a race condition that sometimes causes success/failure notifications to include an incomplete list of hosts (https://github.com/ansible/awx/pull/6290)
- Fixed a bug that can cause certain setting pages to lose unsaved form edits when a playbook is launched (https://github.com/ansible/awx/issues/5265)
- Fixed a bug that can prevent the "Use TLS/SSL" field from properly saving when editing email notification templates (https://github.com/ansible/awx/issues/6383)
- Fixed a race condition that sometimes broke event/stdout processing for jobs launched in container groups (https://github.com/ansible/awx/issues/6280)
## 9.3.0 (Mar 12, 2020)
- Added the ability to specify an OAuth2 token description in the AWX CLI (https://github.com/ansible/awx/issues/6122)
- Added support for K8S service account annotations to the installer (https://github.com/ansible/awx/pull/6007)
- Added support for K8S imagePullSecrets to the installer (https://github.com/ansible/awx/pull/5989)
- Launching jobs (and workflows) using the --monitor flag in the AWX CLI now returns a non-zero exit code on job failure (https://github.com/ansible/awx/issues/5920)
- Improved UI performance for various job views when many simultaneous users are logged into AWX (https://github.com/ansible/awx/issues/5883)
- Updated to the latest version of Django to address a few open CVEs (https://github.com/ansible/awx/pull/6080)
- Fixed a critical bug which can cause AWX to hang and stop launching playbooks after a periodic of time (https://github.com/ansible/awx/issues/5617)
- Fixed a bug which caused delays in project update stdout for certain large SCM clones (as of Ansible 2.9+) (https://github.com/ansible/awx/pull/6254)
- Fixed a bug which caused certain smart inventory filters to mistakenly return duplicate hosts (https://github.com/ansible/awx/pull/5972)
- Fixed an unclear server error when creating smart inventories with the AWX collection (https://github.com/ansible/awx/issues/6250)
- Fixed a bug that broke Grafana notification support (https://github.com/ansible/awx/issues/6137)
- Fixed a UI bug which prevent users with read access to an organization from editing credentials for that organization (https://github.com/ansible/awx/pull/6241)
- Fixed a bug which prevent workflow approval records from recording a `started` and `elapsed` date (https://github.com/ansible/awx/issues/6202)
- Fixed a bug which caused workflow nodes to have a confusing option for `verbosity` (https://github.com/ansible/awx/issues/6196)
- Fixed an RBAC bug which prevented projects and inventory schedules from being created by certain users in certain contexts (https://github.com/ansible/awx/issues/5717)
- Fixed a bug that caused `role_path` in a project's config to not be respected due to an error processing `/etc/ansible/ansible.cfg` (https://github.com/ansible/awx/pull/6038)
- Fixed a bug that broke inventory updates for installs with custom home directories for the awx user (https://github.com/ansible/awx/pull/6152)
- Fixed a bug that broke fact data collection when AWX encounters invalid/unexpected fact data (https://github.com/ansible/awx/issues/5935)
## 9.2.0 (Feb 12, 2020)
- Added the ability to configure the convergence behavior of workflow nodes https://github.com/ansible/awx/issues/3054
- AWX now allows for a configurable global limit for fork count (per-job run). The default maximum is 200. https://github.com/ansible/awx/pull/5604
- Added the ability to specify AZURE_PUBLIC_CLOUD (for e.g., Azure Government KeyVault support) for the Azure credential plugin https://github.com/ansible/awx/issues/5138
- Added support for several additional parameters for Satellite dynamic inventory https://github.com/ansible/awx/pull/5598
- Added a new field to jobs for tracking the date/time a job is cancelled https://github.com/ansible/awx/pull/5610
- Made a series of additional optimizations to the callback receiver to further improve stdout write speed for running playbooks https://github.com/ansible/awx/pull/5677 https://github.com/ansible/awx/pull/5739
- Updated AWX to be compatible with Helm 3.x (https://github.com/ansible/awx/pull/5776)
- Optimized AWX's job dependency/scheduling code to drastically improve processing time in scenarios where there are many pending jobs scheduled simultaneously https://github.com/ansible/awx/issues/5154
- Fixed a bug which could cause SCM authentication details (basic auth passwords) to be reported to external loggers in certain failure scenarios (e.g., when a git clone fails and ansible itself prints an error message to stdout) https://github.com/ansible/awx/pull/5812
- Fixed a k8s installer bug that caused installs to fail in certain situations https://github.com/ansible/awx/issues/5574
- Fixed a number of issues that caused analytics gathering and reporting to run more often than necessary https://github.com/ansible/awx/pull/5721
- Fixed a bug in the AWX CLI that prevented JSON-type settings from saving properly https://github.com/ansible/awx/issues/5528
- Improved support for fetching custom virtualenv dependencies when AWX is installed behind a proxy https://github.com/ansible/awx/pull/5805
- Updated the bundled version of openstacksdk to address a known issue https://github.com/ansible/awx/issues/5821
- Updated the bundled vmware_inventory plugin to the latest version to address a bug https://github.com/ansible/awx/pull/5668
- Fixed a bug that can cause inventory updates to fail to properly save their output when run within a workflow https://github.com/ansible/awx/pull/5666
- Removed a number of pre-computed fields from the Host and Group models to improve AWX performance. As part of this change, inventory group UIs throughout the interface no longer display status icons https://github.com/ansible/awx/pull/5448
## 9.1.1 (Jan 14, 2020)
- Fixed a bug that caused database migrations on Kubernetes installs to hang https://github.com/ansible/awx/pull/5579
- Upgraded Python-level app dependencies in AWX virtual environment https://github.com/ansible/awx/pull/5407
- Running jobs no longer block associated inventory updates https://github.com/ansible/awx/pull/5519
- Fixed invalid_response SAML error https://github.com/ansible/awx/pull/5577
- Optimized the callback receiver to drastically improve the write speed of stdout for parallel jobs (https://github.com/ansible/awx/pull/5618)
## 9.1.0 (Dec 17, 2019)
- Added a command to generate a new SECRET_KEY and rekey the secrets in the database
- Removed project update locking when jobs using it are running
- Fixed slow queries for /api/v2/instances and /api/v2/instance_groups when smart inventories are used
- Fixed a partial password disclosure when special characters existed in the RabbitMQ password (CVE-2019-19342)
- Fixed hang in error handling for source control checkouts
- Fixed an error on subsequent job runs that override the branch of a project on an instance that did not have a prior project checkout
- Fixed an issue where jobs launched in isolated or container groups would incorrectly timeout
- Fixed an incorrect link to instance groups documentation in the user interface
- Fixed editing of inventory on Workflow templates
- Fixed multiple issues with OAuth2 token cleanup system jobs
- Fixed a bug that broke email notifications for workflow approval/deny https://github.com/ansible/awx/issues/5401
- Updated SAML implementation to automatically login if authorization already exists
- Updated AngularJS to 1.7.9 for CVE-2019-10768
## 9.0.1 (Nov 4, 2019)
- Fixed a bug in the installer that broke certain types of k8s installs https://github.com/ansible/awx/issues/5205
## 9.0.0 (Oct 31, 2019)
- Updated AWX images to use centos:8 as the parent image.
- Updated to ansible-runner 1.4.4 to address various bugs.
- Added oc and kubectl to the AWX images to support new container-based execution introduced in 8.0.0.
- Added some optimizations to speed up the deletion of large Inventory Groups.
- Fixed a bug that broke webhook launches for Job Templates that define a survey (https://github.com/ansible/awx/issues/5062).
- Fixed a bug in the CLI which incorrectly parsed launch time arguments for `awx job_templates launch` and `awx workflow_job_templates launch` (https://github.com/ansible/awx/issues/5093).
- Fixed a bug that caused inventory updates using "sourced from a project" to stop working (https://github.com/ansible/awx/issues/4750).
- Fixed a bug that caused Slack notifications to sometimes show the wrong bot avatar (https://github.com/ansible/awx/pull/5125).
- Fixed a bug that prevented the use of digits in AWX's URL settings (https://github.com/ansible/awx/issues/5081).
## 8.0.0 (Oct 21, 2019)
- The Ansible Tower Ansible modules have been migrated to a new official Ansible AWX collection: https://galaxy.ansible.com/awx/AWX
Please note that this functionality is only supported in Ansible 2.9+
- AWX now supports the ability to launch jobs from external webhooks (GitHub and GitLab integration are supported).
- AWX now supports Container Groups, a new feature that allows you to schedule and run playbooks on single-use kubernetes pods on-demand.
- AWX now supports sending notifications when Workflow steps are approved, denied, or time out.
- AWX now records the user who approved or denied Workflow steps.
- AWX now supports fetching Ansible Collections from private galaxy servers.
- AWX now checks the user's ansible.cfg for paths where role/collections may live when running project updates.
- AWX now uses PostgreSQL 10 by default.
- AWX now warns more loudly about underlying AMQP connectivity issues (https://github.com/ansible/awx/pull/4857).
- Added a few optimizations to drastically improve dashboard performance for larger AWX installs (installs with several hundred thousand jobs or more).
- Updated to the latest version of Ansible's VMWare inventory script (which adds support for vmware_guest_facts).
- Deprecated /api/v2/inventory_scripts/ (this endpoint - and the Custom Inventory Script feature - will be removed in a future release of AWX).
- Fixed a bug which prevented Organization Admins from removing users from their own Organization (https://github.com/ansible/awx/issues/2979)
- Fixed a bug which sometimes caused cluster nodes to fail to re-join with a cryptic error, "No instance found with the current cluster host id" (https://github.com/ansible/awx/issues/4294)
- Fixed a bug that prevented the use of launch-time passphrases when using credential plugins (https://github.com/ansible/awx/pull/4807)
- Fixed a bug that caused notifications assigned at the Organization level not to take effect for Workflows in that Organization (https://github.com/ansible/awx/issues/4712)
- Fixed a bug which caused a notable amount of CPU overhead on RabbitMQ health checks (https://github.com/ansible/awx/pull/5009)
- Fixed a bug which sometimes caused the <return> key to stop functioning in <textarea> elements (https://github.com/ansible/awx/issues/4192)
- Fixed a bug which caused request contention when the same OAuth2.0 token was used in multiple simultaneous requests (https://github.com/ansible/awx/issues/4694)
- Fixed a bug related to parsing multiple choice survey options (https://github.com/ansible/awx/issues/4452).
- Fixed a bug that caused single-sign-on icons on the login page to fail to render in certain Windows browsers (https://github.com/ansible/awx/issues/3924)
- Fixed a number of bugs that caused certain OAuth2 settings to not be properly respected, such as REFRESH_TOKEN_EXPIRE_SECONDS.
- Fixed a number of bugs in the AWX CLI, including a bug which sometimes caused long lines of stdout output to be unexpectedly truncated.
- Fixed a number of bugs on the job details UI which sometimes caused auto-scrolling stdout to become stuck.
- Fixed a bug which caused LDAP authentication to fail if the TLD of the server URL contained digits (https://github.com/ansible/awx/issues/3646)
- Fixed a bug which broke HashiCorp Vault integration on older versions of HashiCorp Vault.
## 7.0.0 (Sept 4, 2019)
- AWX now detects and installs Ansible Collections defined in your project (note - this feature only works in Ansible 2.9+) (https://github.com/ansible/awx/issues/2534)
- AWX now includes an official command line client. Keep an eye out for a follow-up email on this mailing list for information on how to install it and try it out.
- Added the ability to provide a specific SCM branch on jobs (https://github.com/ansible/awx/issues/282)
- Added support for Workflow Approval Nodes, a new feature which allows you to add "pause and wait for approval" steps into your workflows (https://github.com/ansible/awx/issues/1206)
- Added the ability to specify a specific HTTP method for webhook notifications (POST vs PUT) (https://github.com/ansible/awx/pull/4124)
- Added the ability to specify a username and password for HTTP Basic Authorization for webhook notifications (https://github.com/ansible/awx/pull/4124)
- Added support for customizing the text content of notifications (https://github.com/ansible/awx/issues/79)
- Added the ability to enable and disable hosts in dynamic inventory (https://github.com/ansible/awx/pull/4420)
- Added the description (if any) to the Job Template list (https://github.com/ansible/awx/issues/4359)
- Added new metrics for instance hostnames and pending jobs to the /api/v2/metrics/ endpoint (https://github.com/ansible/awx/pull/4375)
- Changed AWX's on/off toggle buttons to a non-text based style to simplify internationalization (https://github.com/ansible/awx/pull/4425)
- Events emitted by ansible for adhoc commands are now sent to the external log aggregrator (https://github.com/ansible/awx/issues/4545)
- Fixed a bug which allowed a user to make an organization credential in another organization without permissions to that organization (https://github.com/ansible/awx/pull/4483)
- Fixed a bug that caused `extra_vars` on workflows to break when edited (https://github.com/ansible/awx/issues/4293)
- Fixed a slow SQL query that caused performance issues when large numbers of groups exist (https://github.com/ansible/awx/issues/4461)
- Fixed a few minor bugs in survey field validation (https://github.com/ansible/awx/pull/4509) (https://github.com/ansible/awx/pull/4479)
- Fixed a bug that sometimes resulted in orphaned `ansible_runner_pi` directories in `/tmp` after playbook execution (https://github.com/ansible/awx/pull/4409)
- Fixed a bug that caused the `is_system_auditor` flag in LDAP configuration to not work (https://github.com/ansible/awx/pull/4396)
- Fixed a bug which caused schedules to disappear from the UI when toggled off (https://github.com/ansible/awx/pull/4378)
- Fixed a bug that sometimes caused stdout content to contain extraneous blank lines in newer versions of Ansible (https://github.com/ansible/awx/pull/4391)
- Updated to the latest Django security release, 2.2.4 (https://github.com/ansible/awx/pull/4410) (https://www.djangoproject.com/weblog/2019/aug/01/security-releases/)
- Updated the default version of git to a version that includes support for x509 certificates (https://github.com/ansible/awx/issues/4362)
- Removed the deprecated `credential` field from `/api/v2/workflow_job_templates/N/` (as part of the `/api/v1/` removal in prior AWX versions - https://github.com/ansible/awx/pull/4490).
## 6.1.0 (Jul 18, 2019)
- Updated AWX to use Django 2.2.2.
- Updated the provided openstacksdk version to support new functionality (such as Nova scheduler_hints)
- Added the ability to specify a custom cacert for the HashiCorp Vault credential plugin
- Fixed a number of bugs related to path lookups for the HashiCorp Vault credential plugin
- Fixed a bug which prevented signed SSH certificates from working, including the HashiCorp Vault Signed SSH backend
- Fixed a bug which prevented custom logos from displaying on the login page (as a result of a new Content Security Policy in 6.0.0)
- Fixed a bug which broke websocket connectivity in Apple Safari (as a result of a new Content Security Policy in 6.0.0)
- Fixed a bug on the job output page that occasionally caused the "up" and "down" buttons to not load additional output
- Fixed a bug on the job output page that caused quoted task names to display incorrectly
## 6.0.0 (Jul 1, 2019)
- Removed support for "Any" notification templates and their API endpoints e.g., /api/v2/job_templates/N/notification_templates/any/ (https://github.com/ansible/awx/issues/4022)
- Fixed a bug which prevented credentials from properly being applied to inventory sources (https://github.com/ansible/awx/issues/4059)
- Fixed a bug which can cause the task dispatcher to hang indefinitely when external logging support (e.g., Splunk, Logstash) is enabled (https://github.com/ansible/awx/issues/4181)
- Fixed a bug which causes slow stdout display when running jobs against smart inventories. (https://github.com/ansible/awx/issues/3106)
- Fixed a bug that caused SSL verification flags to fail to be respected for LDAP authentication in certain environments. (https://github.com/ansible/awx/pull/4190)
- Added a simple Content Security Policy (https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) to restrict access to third-party resources in the browser. (https://github.com/ansible/awx/pull/4167)
- Updated ovirt4 library dependencies to work with newer versions of oVirt (https://github.com/ansible/awx/issues/4138)
## 5.0.0 (Jun 21, 2019)
- Bump Django Rest Framework from 3.7.7 to 3.9.4
- Bump setuptools / pip dependencies
- Fixed bug where Recent Notification list would not appear
- Added notifications on job start
- Default to Ansible 2.8

View File

@@ -6,21 +6,21 @@ Have questions about this document or anything not covered here? Come chat with
## Table of contents ## Table of contents
* [Things to know prior to submitting code](#things-to-know-prior-to-submitting-code) - [Things to know prior to submitting code](#things-to-know-prior-to-submitting-code)
* [Setting up your development environment](#setting-up-your-development-environment) - [Setting up your development environment](#setting-up-your-development-environment)
* [Prerequisites](#prerequisites) - [Prerequisites](#prerequisites)
* [Docker](#docker) - [Docker](#docker)
* [Docker compose](#docker-compose) - [Docker compose](#docker-compose)
* [Frontend Development](#frontend-development) - [Frontend Development](#frontend-development)
* [Build and Run the Development Environment](#build-and-run-the-development-environment) - [Build and Run the Development Environment](#build-and-run-the-development-environment)
* [Fork and clone the AWX repo](#fork-and-clone-the-awx-repo) - [Fork and clone the AWX repo](#fork-and-clone-the-awx-repo)
* [Building API Documentation](#building-api-documentation) - [Building API Documentation](#building-api-documentation)
* [Accessing the AWX web interface](#accessing-the-awx-web-interface) - [Accessing the AWX web interface](#accessing-the-awx-web-interface)
* [Purging containers and images](#purging-containers-and-images) - [Purging containers and images](#purging-containers-and-images)
* [What should I work on?](#what-should-i-work-on) - [What should I work on?](#what-should-i-work-on)
* [Submitting Pull Requests](#submitting-pull-requests) - [Submitting Pull Requests](#submitting-pull-requests)
* [PR Checks run by Zuul](#pr-checks-run-by-zuul) - [PR Checks run by Zuul](#pr-checks-run-by-zuul)
* [Reporting Issues](#reporting-issues) - [Reporting Issues](#reporting-issues)
## Things to know prior to submitting code ## Things to know prior to submitting code
@@ -46,15 +46,15 @@ respectively.
For Linux platforms, refer to the following from Docker: For Linux platforms, refer to the following from Docker:
* **Fedora** - https://docs.docker.com/engine/installation/linux/docker-ce/fedora/ - **Fedora** - https://docs.docker.com/engine/installation/linux/docker-ce/fedora/
* **CentOS** - https://docs.docker.com/engine/installation/linux/docker-ce/centos/ - **CentOS** - https://docs.docker.com/engine/installation/linux/docker-ce/centos/
* **Ubuntu** - https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/ - **Ubuntu** - https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
* **Debian** - https://docs.docker.com/engine/installation/linux/docker-ce/debian/ - **Debian** - https://docs.docker.com/engine/installation/linux/docker-ce/debian/
* **Arch** - https://wiki.archlinux.org/index.php/Docker - **Arch** - https://wiki.archlinux.org/index.php/Docker
#### Docker Compose #### Docker Compose
@@ -66,7 +66,7 @@ If you're not using Docker for Mac, or Docker for Windows, you may need, or choo
#### Frontend Development #### Frontend Development
See [the ui development documentation](awx/ui_next/CONTRIBUTING.md). See [the ui development documentation](awx/ui/CONTRIBUTING.md).
#### Fork and clone the AWX repo #### Fork and clone the AWX repo
@@ -74,19 +74,19 @@ If you have not done so already, you'll need to fork the AWX repo on GitHub. For
### Build and Run the Development Environment ### Build and Run the Development Environment
See the [README.md](./tools/docker-compose/README.md) for docs on how to build the awx_devel image and run the development environment. See the [README.md](./tools/docker-compose/README.md) for docs on how to build the awx_devel image and run the development environment.
### Building API Documentation ### Building API Documentation
AWX includes support for building [Swagger/OpenAPI AWX includes support for building [Swagger/OpenAPI
documentation](https://swagger.io). To build the documentation locally, run: documentation](https://swagger.io). To build the documentation locally, run:
```bash ```bash
(container)/awx_devel$ make swagger (container)/awx_devel$ make swagger
``` ```
This will write a file named `swagger.json` that contains the API specification This will write a file named `swagger.json` that contains the API specification
in OpenAPI format. A variety of online tools are available for translating in OpenAPI format. A variety of online tools are available for translating
this data into more consumable formats (such as HTML). http://editor.swagger.io this data into more consumable formats (such as HTML). http://editor.swagger.io
is an example of one such service. is an example of one such service.
@@ -110,7 +110,7 @@ For feature work, take a look at the current [Enhancements](https://github.com/a
If it has someone assigned to it then that person is the person responsible for working the enhancement. If you feel like you could contribute then reach out to that person. If it has someone assigned to it then that person is the person responsible for working the enhancement. If you feel like you could contribute then reach out to that person.
Fixing bugs, adding translations, and updating the documentation are always appreciated, so reviewing the backlog of issues is always a good place to start. For extra information on debugging tools, see [Debugging](https://github.com/ansible/awx/blob/devel/docs/debugging.md). Fixing bugs, adding translations, and updating the documentation are always appreciated, so reviewing the backlog of issues is always a good place to start. For extra information on debugging tools, see [Debugging](./docs/debugging/).
**NOTE** **NOTE**
@@ -126,15 +126,15 @@ Fixes and Features for AWX will go through the Github pull request process. Subm
Here are a few things you can do to help the visibility of your change, and increase the likelihood that it will be accepted: Here are a few things you can do to help the visibility of your change, and increase the likelihood that it will be accepted:
* No issues when running linters/code checkers - No issues when running linters/code checkers
* Python: black: `(container)/awx_devel$ make black` - Python: black: `(container)/awx_devel$ make black`
* Javascript: JsHint: `(container)/awx_devel$ make jshint` - Javascript: `(container)/awx_devel$ make ui-lint`
* No issues from unit tests - No issues from unit tests
* Python: py.test: `(container)/awx_devel$ make test` - Python: py.test: `(container)/awx_devel$ make test`
* JavaScript: Jasmine: `(container)/awx_devel$ make ui-test-ci` - JavaScript: `(container)/awx_devel$ make ui-test`
* Write tests for new functionality, update/add tests for bug fixes - Write tests for new functionality, update/add tests for bug fixes
* Make the smallest change possible - Make the smallest change possible
* Write good commit messages. See [How to write a Git commit message](https://chris.beams.io/posts/git-commit/). - Write good commit messages. See [How to write a Git commit message](https://chris.beams.io/posts/git-commit/).
It's generally a good idea to discuss features with us first by engaging us in the `#ansible-awx` channel on irc.libera.chat, or on the [mailing list](https://groups.google.com/forum/#!forum/awx-project). It's generally a good idea to discuss features with us first by engaging us in the `#ansible-awx` channel on irc.libera.chat, or on the [mailing list](https://groups.google.com/forum/#!forum/awx-project).
@@ -146,21 +146,24 @@ Sometimes it might take us a while to fully review your PR. We try to keep the `
All submitted PRs will have the linter and unit tests run against them via Zuul, and the status reported in the PR. All submitted PRs will have the linter and unit tests run against them via Zuul, and the status reported in the PR.
## PR Checks run by Zuul ## PR Checks run by Zuul
Zuul jobs for awx are defined in the [zuul-jobs](https://github.com/ansible/zuul-jobs) repo. Zuul jobs for awx are defined in the [zuul-jobs](https://github.com/ansible/zuul-jobs) repo.
Zuul runs the following checks that must pass: Zuul runs the following checks that must pass:
1) `tox-awx-api-lint`
2) `tox-awx-ui-lint` 1. `tox-awx-api-lint`
3) `tox-awx-api` 2. `tox-awx-ui-lint`
4) `tox-awx-ui` 3. `tox-awx-api`
5) `tox-awx-swagger` 4. `tox-awx-ui`
5. `tox-awx-swagger`
Zuul runs the following checks that are non-voting (can not pass but serve to inform PR reviewers): Zuul runs the following checks that are non-voting (can not pass but serve to inform PR reviewers):
1) `tox-awx-detect-schema-change`
This check generates the schema and diffs it against a reference copy of the `devel` version of the schema. 1. `tox-awx-detect-schema-change`
Reviewers should inspect the `job-output.txt.gz` related to the check if their is a failure (grep for `diff -u -b` to find beginning of diff). This check generates the schema and diffs it against a reference copy of the `devel` version of the schema.
If the schema change is expected and makes sense in relation to the changes made by the PR, then you are good to go! Reviewers should inspect the `job-output.txt.gz` related to the check if their is a failure (grep for `diff -u -b` to find beginning of diff).
If not, the schema changes should be fixed, but this decision must be enforced by reviewers. If the schema change is expected and makes sense in relation to the changes made by the PR, then you are good to go!
If not, the schema changes should be fixed, but this decision must be enforced by reviewers.
## Reporting Issues ## Reporting Issues

View File

@@ -4,8 +4,8 @@ recursive-include awx *.mo
recursive-include awx/static * recursive-include awx/static *
recursive-include awx/templates *.html recursive-include awx/templates *.html
recursive-include awx/api/templates *.md *.html recursive-include awx/api/templates *.md *.html
recursive-include awx/ui_next/build *.html recursive-include awx/ui/build *.html
recursive-include awx/ui_next/build * recursive-include awx/ui/build *
recursive-include awx/playbooks *.yml recursive-include awx/playbooks *.yml
recursive-include awx/lib/site-packages * recursive-include awx/lib/site-packages *
recursive-include awx/plugins *.ps1 recursive-include awx/plugins *.ps1

212
Makefile
View File

@@ -1,61 +1,40 @@
PYTHON ?= python3.8 PYTHON ?= python3.9
PYTHON_VERSION = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_version; print(get_python_version())")
SITELIB=$(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
OFFICIAL ?= no OFFICIAL ?= no
PACKER ?= packer
PACKER_BUILD_OPTS ?= -var 'official=$(OFFICIAL)' -var 'aw_repo_url=$(AW_REPO_URL)'
NODE ?= node NODE ?= node
NPM_BIN ?= npm NPM_BIN ?= npm
CHROMIUM_BIN=/tmp/chrome-linux/chrome CHROMIUM_BIN=/tmp/chrome-linux/chrome
DEPS_SCRIPT ?= packaging/bundle/deps.py
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD) GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
MANAGEMENT_COMMAND ?= awx-manage MANAGEMENT_COMMAND ?= awx-manage
IMAGE_REPOSITORY_AUTH ?= VERSION := $(shell $(PYTHON) setup.py --version)
IMAGE_REPOSITORY_BASE ?= https://gcr.io COLLECTION_VERSION := $(shell $(PYTHON) setup.py --version | cut -d . -f 1-3)
VERSION := $(shell cat VERSION)
# NOTE: This defaults the container image version to the branch that's active # NOTE: This defaults the container image version to the branch that's active
COMPOSE_TAG ?= $(GIT_BRANCH) COMPOSE_TAG ?= $(GIT_BRANCH)
COMPOSE_HOST ?= $(shell hostname) MAIN_NODE_TYPE ?= hybrid
# If set to true docker-compose will also start a keycloak instance
KEYCLOAK ?= false
VENV_BASE ?= /var/lib/awx/venv/ VENV_BASE ?= /var/lib/awx/venv
SCL_PREFIX ?=
CELERY_SCHEDULE_FILE ?= /var/lib/awx/beat.db
DEV_DOCKER_TAG_BASE ?= quay.io/awx DEV_DOCKER_TAG_BASE ?= quay.io/awx
DEVEL_IMAGE_NAME ?= $(DEV_DOCKER_TAG_BASE)/awx_devel:$(COMPOSE_TAG) DEVEL_IMAGE_NAME ?= $(DEV_DOCKER_TAG_BASE)/awx_devel:$(COMPOSE_TAG)
RECEPTOR_IMAGE ?= quay.io/ansible/receptor:devel
# Python packages to install only from source (not from binary wheels) # Python packages to install only from source (not from binary wheels)
# Comma separated list # Comma separated list
SRC_ONLY_PKGS ?= cffi,pycparser,psycopg2,twilio SRC_ONLY_PKGS ?= cffi,pycparser,psycopg2,twilio
# These should be upgraded in the AWX and Ansible venv before attempting # These should be upgraded in the AWX and Ansible venv before attempting
# to install the actual requirements # to install the actual requirements
VENV_BOOTSTRAP ?= pip==19.3.1 setuptools==41.6.0 wheel==0.36.2 VENV_BOOTSTRAP ?= pip==21.2.4 setuptools==58.2.0 wheel==0.36.2
# Determine appropriate shasum command
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
SHASUM_BIN ?= sha256sum
endif
ifeq ($(UNAME_S),Darwin)
SHASUM_BIN ?= shasum -a 256
endif
# Get the branch information from git
GIT_DATE := $(shell git log -n 1 --format="%ai")
DATE := $(shell date -u +%Y%m%d%H%M)
NAME ?= awx NAME ?= awx
GIT_REMOTE_URL = $(shell git config --get remote.origin.url)
# TAR build parameters # TAR build parameters
SDIST_TAR_NAME=$(NAME)-$(VERSION) SDIST_TAR_NAME=$(NAME)-$(VERSION)
WHEEL_NAME=$(NAME)-$(VERSION)
SDIST_COMMAND ?= sdist SDIST_COMMAND ?= sdist
WHEEL_COMMAND ?= bdist_wheel
SDIST_TAR_FILE ?= $(SDIST_TAR_NAME).tar.gz SDIST_TAR_FILE ?= $(SDIST_TAR_NAME).tar.gz
WHEEL_FILE ?= $(WHEEL_NAME)-py2-none-any.whl
I18N_FLAG_FILE = .i18n_built I18N_FLAG_FILE = .i18n_built
@@ -64,7 +43,7 @@ I18N_FLAG_FILE = .i18n_built
receiver test test_unit test_coverage coverage_html \ receiver test test_unit test_coverage coverage_html \
dev_build release_build sdist \ dev_build release_build sdist \
ui-release ui-devel \ ui-release ui-devel \
VERSION docker-compose-sources \ VERSION PYTHON_VERSION docker-compose-sources \
.git/hooks/pre-commit .git/hooks/pre-commit
clean-tmp: clean-tmp:
@@ -83,7 +62,7 @@ clean-schema:
clean-languages: clean-languages:
rm -f $(I18N_FLAG_FILE) rm -f $(I18N_FLAG_FILE)
find . -type f -regex ".*\.mo$$" -delete find ./awx/locale/ -type f -regex ".*\.mo$" -delete
# Remove temporary build files, compiled Python files. # Remove temporary build files, compiled Python files.
clean: clean-ui clean-api clean-awxkit clean-dist clean: clean-ui clean-api clean-awxkit clean-dist
@@ -166,15 +145,6 @@ version_file:
fi; \ fi; \
$(PYTHON) -c "import awx; print(awx.__version__)" > /var/lib/awx/.awx_version; \ $(PYTHON) -c "import awx; print(awx.__version__)" > /var/lib/awx/.awx_version; \
# Do any one-time init tasks.
comma := ,
init:
if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
fi; \
$(MANAGEMENT_COMMAND) provision_instance --hostname=$(COMPOSE_HOST); \
$(MANAGEMENT_COMMAND) register_queue --queuename=controlplane --instance_percent=100;
# Refresh development environment after pulling new code. # Refresh development environment after pulling new code.
refresh: clean requirements_dev version_file develop migrate refresh: clean requirements_dev version_file develop migrate
@@ -295,17 +265,16 @@ api-lint:
awx-link: awx-link:
[ -d "/awx_devel/awx.egg-info" ] || $(PYTHON) /awx_devel/setup.py egg_info_dev [ -d "/awx_devel/awx.egg-info" ] || $(PYTHON) /awx_devel/setup.py egg_info_dev
cp -f /tmp/awx.egg-link /var/lib/awx/venv/awx/lib/python$(PYTHON_VERSION)/site-packages/awx.egg-link cp -f /tmp/awx.egg-link /var/lib/awx/venv/awx/lib/$(PYTHON)/site-packages/awx.egg-link
TEST_DIRS ?= awx/main/tests/unit awx/main/tests/functional awx/conf/tests awx/sso/tests TEST_DIRS ?= awx/main/tests/unit awx/main/tests/functional awx/conf/tests awx/sso/tests
PYTEST_ARGS ?= -n auto
# Run all API unit tests. # Run all API unit tests.
test: test:
if [ "$(VENV_BASE)" ]; then \ if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \ . $(VENV_BASE)/awx/bin/activate; \
fi; \ fi; \
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS) PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider $(PYTEST_ARGS) $(TEST_DIRS)
cmp VERSION awxkit/VERSION || "VERSION and awxkit/VERSION *must* match"
cd awxkit && $(VENV_BASE)/awx/bin/tox -re py3 cd awxkit && $(VENV_BASE)/awx/bin/tox -re py3
awx-manage check_migrations --dry-run --check -n 'missing_migration_file' awx-manage check_migrations --dry-run --check -n 'missing_migration_file'
@@ -337,12 +306,16 @@ symlink_collection:
ln -s $(shell pwd)/awx_collection $(COLLECTION_INSTALL) ln -s $(shell pwd)/awx_collection $(COLLECTION_INSTALL)
build_collection: build_collection:
ansible-playbook -i localhost, awx_collection/tools/template_galaxy.yml -e collection_package=$(COLLECTION_PACKAGE) -e collection_namespace=$(COLLECTION_NAMESPACE) -e collection_version=$(VERSION) -e '{"awx_template_version":false}' ansible-playbook -i localhost, awx_collection/tools/template_galaxy.yml \
-e collection_package=$(COLLECTION_PACKAGE) \
-e collection_namespace=$(COLLECTION_NAMESPACE) \
-e collection_version=$(COLLECTION_VERSION) \
-e '{"awx_template_version":false}'
ansible-galaxy collection build awx_collection_build --force --output-path=awx_collection_build ansible-galaxy collection build awx_collection_build --force --output-path=awx_collection_build
install_collection: build_collection install_collection: build_collection
rm -rf $(COLLECTION_INSTALL) rm -rf $(COLLECTION_INSTALL)
ansible-galaxy collection install awx_collection_build/$(COLLECTION_NAMESPACE)-$(COLLECTION_PACKAGE)-$(VERSION).tar.gz ansible-galaxy collection install awx_collection_build/$(COLLECTION_NAMESPACE)-$(COLLECTION_PACKAGE)-$(COLLECTION_VERSION).tar.gz
test_collection_sanity: install_collection test_collection_sanity: install_collection
cd $(COLLECTION_INSTALL) && ansible-test sanity cd $(COLLECTION_INSTALL) && ansible-test sanity
@@ -383,45 +356,51 @@ bulk_data:
# UI TASKS # UI TASKS
# -------------------------------------- # --------------------------------------
UI_BUILD_FLAG_FILE = awx/ui_next/.ui-built UI_BUILD_FLAG_FILE = awx/ui/.ui-built
clean-ui: clean-ui:
rm -rf node_modules rm -rf node_modules
rm -rf awx/ui_next/node_modules rm -rf awx/ui/node_modules
rm -rf awx/ui_next/build rm -rf awx/ui/build
rm -rf awx/ui_next/src/locales/_build rm -rf awx/ui/src/locales/_build
rm -rf $(UI_BUILD_FLAG_FILE) rm -rf $(UI_BUILD_FLAG_FILE)
awx/ui_next/node_modules: awx/ui/node_modules:
NODE_OPTIONS=--max-old-space-size=4096 $(NPM_BIN) --prefix awx/ui_next --loglevel warn ci NODE_OPTIONS=--max-old-space-size=6144 $(NPM_BIN) --prefix awx/ui --loglevel warn ci
$(UI_BUILD_FLAG_FILE): $(UI_BUILD_FLAG_FILE): awx/ui/node_modules
$(NPM_BIN) --prefix awx/ui_next --loglevel warn run compile-strings $(PYTHON) tools/scripts/compilemessages.py
$(NPM_BIN) --prefix awx/ui_next --loglevel warn run build $(NPM_BIN) --prefix awx/ui --loglevel warn run compile-strings
$(NPM_BIN) --prefix awx/ui --loglevel warn run build
mkdir -p awx/public/static/css mkdir -p awx/public/static/css
mkdir -p awx/public/static/js mkdir -p awx/public/static/js
mkdir -p awx/public/static/media mkdir -p awx/public/static/media
cp -r awx/ui_next/build/static/css/* awx/public/static/css cp -r awx/ui/build/static/css/* awx/public/static/css
cp -r awx/ui_next/build/static/js/* awx/public/static/js cp -r awx/ui/build/static/js/* awx/public/static/js
cp -r awx/ui_next/build/static/media/* awx/public/static/media cp -r awx/ui/build/static/media/* awx/public/static/media
touch $@ touch $@
ui-release: awx/ui_next/node_modules $(UI_BUILD_FLAG_FILE)
ui-devel: awx/ui_next/node_modules
ui-release: $(UI_BUILD_FLAG_FILE)
ui-devel: awx/ui/node_modules
@$(MAKE) -B $(UI_BUILD_FLAG_FILE) @$(MAKE) -B $(UI_BUILD_FLAG_FILE)
ui-devel-instrumented: awx/ui_next/node_modules ui-devel-instrumented: awx/ui/node_modules
$(NPM_BIN) --prefix awx/ui_next --loglevel warn run start-instrumented $(NPM_BIN) --prefix awx/ui --loglevel warn run start-instrumented
ui-devel-test: awx/ui_next/node_modules ui-devel-test: awx/ui/node_modules
$(NPM_BIN) --prefix awx/ui_next --loglevel warn run start $(NPM_BIN) --prefix awx/ui --loglevel warn run start
ui-zuul-lint-and-test: ui-lint:
$(NPM_BIN) --prefix awx/ui_next install $(NPM_BIN) --prefix awx/ui install
$(NPM_BIN) run --prefix awx/ui_next lint $(NPM_BIN) run --prefix awx/ui lint
$(NPM_BIN) run --prefix awx/ui_next prettier-check $(NPM_BIN) run --prefix awx/ui prettier-check
$(NPM_BIN) run --prefix awx/ui_next test -- --coverage --watchAll=false
ui-test:
$(NPM_BIN) --prefix awx/ui install
$(NPM_BIN) run --prefix awx/ui test
# Build a pip-installable package into dist/ with a timestamped version number. # Build a pip-installable package into dist/ with a timestamped version number.
@@ -432,33 +411,22 @@ dev_build:
release_build: release_build:
$(PYTHON) setup.py release_build $(PYTHON) setup.py release_build
dist/$(SDIST_TAR_FILE): ui-release VERSION HEADLESS ?= no
ifeq ($(HEADLESS), yes)
dist/$(SDIST_TAR_FILE):
else
dist/$(SDIST_TAR_FILE): $(UI_BUILD_FLAG_FILE)
endif
$(PYTHON) setup.py $(SDIST_COMMAND) $(PYTHON) setup.py $(SDIST_COMMAND)
ln -sf $(SDIST_TAR_FILE) dist/awx.tar.gz
dist/$(WHEEL_FILE): ui-release
$(PYTHON) setup.py $(WHEEL_COMMAND)
sdist: dist/$(SDIST_TAR_FILE) sdist: dist/$(SDIST_TAR_FILE)
echo $(HEADLESS)
@echo "#############################################" @echo "#############################################"
@echo "Artifacts:" @echo "Artifacts:"
@echo dist/$(SDIST_TAR_FILE) @echo dist/$(SDIST_TAR_FILE)
@echo "#############################################" @echo "#############################################"
wheel: dist/$(WHEEL_FILE)
@echo "#############################################"
@echo "Artifacts:"
@echo dist/$(WHEEL_FILE)
@echo "#############################################"
# Build setup bundle tarball
setup-bundle-build:
mkdir -p $@
docker-auth:
@if [ "$(IMAGE_REPOSITORY_AUTH)" ]; then \
echo "$(IMAGE_REPOSITORY_AUTH)" | docker login -u oauth2accesstoken --password-stdin $(IMAGE_REPOSITORY_BASE); \
fi;
# This directory is bind-mounted inside of the development container and # This directory is bind-mounted inside of the development container and
# needs to be pre-created for permissions to be set correctly. Otherwise, # needs to be pre-created for permissions to be set correctly. Otherwise,
# Docker will create this directory as root. # Docker will create this directory as root.
@@ -466,22 +434,34 @@ awx/projects:
@mkdir -p $@ @mkdir -p $@
COMPOSE_UP_OPTS ?= COMPOSE_UP_OPTS ?=
CLUSTER_NODE_COUNT ?= 1 COMPOSE_OPTS ?=
CONTROL_PLANE_NODE_COUNT ?= 1
EXECUTION_NODE_COUNT ?= 2
MINIKUBE_CONTAINER_GROUP ?= false
docker-compose-sources: .git/hooks/pre-commit docker-compose-sources: .git/hooks/pre-commit
@if [ $(MINIKUBE_CONTAINER_GROUP) = true ]; then\
ansible-playbook -i tools/docker-compose/inventory tools/docker-compose-minikube/deploy.yml; \
fi;
ansible-playbook -i tools/docker-compose/inventory tools/docker-compose/ansible/sources.yml \ ansible-playbook -i tools/docker-compose/inventory tools/docker-compose/ansible/sources.yml \
-e awx_image=$(DEV_DOCKER_TAG_BASE)/awx_devel \ -e awx_image=$(DEV_DOCKER_TAG_BASE)/awx_devel \
-e awx_image_tag=$(COMPOSE_TAG) \ -e awx_image_tag=$(COMPOSE_TAG) \
-e cluster_node_count=$(CLUSTER_NODE_COUNT) -e receptor_image=$(RECEPTOR_IMAGE) \
-e control_plane_node_count=$(CONTROL_PLANE_NODE_COUNT) \
-e execution_node_count=$(EXECUTION_NODE_COUNT) \
-e minikube_container_group=$(MINIKUBE_CONTAINER_GROUP) \
-e enable_keycloak=$(KEYCLOAK)
docker-compose: docker-auth awx/projects docker-compose-sources
docker-compose -f tools/docker-compose/_sources/docker-compose.yml $(COMPOSE_UP_OPTS) up
docker-compose-credential-plugins: docker-auth awx/projects docker-compose-sources docker-compose: awx/projects docker-compose-sources
docker-compose -f tools/docker-compose/_sources/docker-compose.yml $(COMPOSE_OPTS) up $(COMPOSE_UP_OPTS) --remove-orphans
docker-compose-credential-plugins: awx/projects docker-compose-sources
echo -e "\033[0;31mTo generate a CyberArk Conjur API key: docker exec -it tools_conjur_1 conjurctl account create quick-start\033[0m" echo -e "\033[0;31mTo generate a CyberArk Conjur API key: docker exec -it tools_conjur_1 conjurctl account create quick-start\033[0m"
docker-compose -f tools/docker-compose/_sources/docker-compose.yml -f tools/docker-credential-plugins-override.yml up --no-recreate awx_1 docker-compose -f tools/docker-compose/_sources/docker-compose.yml -f tools/docker-credential-plugins-override.yml up --no-recreate awx_1 --remove-orphans
docker-compose-test: docker-auth awx/projects docker-compose-sources docker-compose-test: awx/projects docker-compose-sources
docker-compose -f tools/docker-compose/_sources/docker-compose.yml run --rm --service-ports awx_1 /bin/bash docker-compose -f tools/docker-compose/_sources/docker-compose.yml run --rm --service-ports awx_1 /bin/bash
docker-compose-runtest: awx/projects docker-compose-sources docker-compose-runtest: awx/projects docker-compose-sources
@@ -490,40 +470,52 @@ docker-compose-runtest: awx/projects docker-compose-sources
docker-compose-build-swagger: awx/projects docker-compose-sources docker-compose-build-swagger: awx/projects docker-compose-sources
docker-compose -f tools/docker-compose/_sources/docker-compose.yml run --rm --service-ports --no-deps awx_1 /start_tests.sh swagger docker-compose -f tools/docker-compose/_sources/docker-compose.yml run --rm --service-ports --no-deps awx_1 /start_tests.sh swagger
SCHEMA_DIFF_BASE_BRANCH ?= devel
detect-schema-change: genschema detect-schema-change: genschema
curl https://s3.amazonaws.com/awx-public-ci-files/schema.json -o reference-schema.json curl https://s3.amazonaws.com/awx-public-ci-files/$(SCHEMA_DIFF_BASE_BRANCH)/schema.json -o reference-schema.json
# Ignore differences in whitespace with -b # Ignore differences in whitespace with -b
diff -u -b reference-schema.json schema.json diff -u -b reference-schema.json schema.json
docker-compose-clean: awx/projects docker-compose-clean: awx/projects
docker-compose -f tools/docker-compose/_sources/docker-compose.yml rm -sf docker-compose -f tools/docker-compose/_sources/docker-compose.yml rm -sf
docker-compose-container-group-clean:
@if [ -f "tools/docker-compose-minikube/_sources/minikube" ]; then \
tools/docker-compose-minikube/_sources/minikube delete; \
fi
rm -rf tools/docker-compose-minikube/_sources/
# Base development image build # Base development image build
docker-compose-build: docker-compose-build:
ansible-playbook tools/ansible/dockerfile.yml -e build_dev=True ansible-playbook tools/ansible/dockerfile.yml -e build_dev=True -e receptor_image=$(RECEPTOR_IMAGE)
DOCKER_BUILDKIT=1 docker build -t $(DEVEL_IMAGE_NAME) \ DOCKER_BUILDKIT=1 docker build -t $(DEVEL_IMAGE_NAME) \
--build-arg BUILDKIT_INLINE_CACHE=1 \ --build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from=$(DEV_DOCKER_TAG_BASE)/awx_devel:$(COMPOSE_TAG) . --cache-from=$(DEV_DOCKER_TAG_BASE)/awx_devel:$(COMPOSE_TAG) .
docker-clean: docker-clean:
$(foreach container_id,$(shell docker ps -f name=tools_awx -aq),docker stop $(container_id); docker rm -f $(container_id);) $(foreach container_id,$(shell docker ps -f name=tools_awx -aq && docker ps -f name=tools_receptor -aq),docker stop $(container_id); docker rm -f $(container_id);)
docker images | grep "awx_devel" | awk '{print $$1 ":" $$2}' | xargs docker rmi if [ "$(shell docker images | grep awx_devel)" ]; then \
docker images | grep awx_devel | awk '{print $$3}' | xargs docker rmi --force; \
fi
docker-clean-volumes: docker-compose-clean docker-clean-volumes: docker-compose-clean docker-compose-container-group-clean
docker volume rm tools_awx_db docker volume rm tools_awx_db
docker-refresh: docker-clean docker-compose docker-refresh: docker-clean docker-compose
# Docker Development Environment with Elastic Stack Connected # Docker Development Environment with Elastic Stack Connected
docker-compose-elk: docker-auth awx/projects docker-compose-sources docker-compose-elk: awx/projects docker-compose-sources
docker-compose -f tools/docker-compose/_sources/docker-compose.yml -f tools/elastic/docker-compose.logstash-link.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate docker-compose -f tools/docker-compose/_sources/docker-compose.yml -f tools/elastic/docker-compose.logstash-link.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate
docker-compose-cluster-elk: docker-auth awx/projects docker-compose-sources docker-compose-cluster-elk: awx/projects docker-compose-sources
docker-compose -f tools/docker-compose/_sources/docker-compose.yml -f tools/elastic/docker-compose.logstash-link-cluster.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate docker-compose -f tools/docker-compose/_sources/docker-compose.yml -f tools/elastic/docker-compose.logstash-link-cluster.yml -f tools/elastic/docker-compose.elastic-override.yml up --no-recreate
prometheus: prometheus:
docker run -u0 --net=tools_default --link=`docker ps | egrep -o "tools_awx(_run)?_([^ ]+)?"`:awxweb --volume `pwd`/tools/prometheus:/prometheus --name prometheus -d -p 0.0.0.0:9090:9090 prom/prometheus --web.enable-lifecycle --config.file=/prometheus/prometheus.yml docker run -u0 --net=tools_default --link=`docker ps | egrep -o "tools_awx(_run)?_([^ ]+)?"`:awxweb --volume `pwd`/tools/prometheus:/prometheus --name prometheus -d -p 0.0.0.0:9090:9090 prom/prometheus --web.enable-lifecycle --config.file=/prometheus/prometheus.yml
docker-compose-container-group:
MINIKUBE_CONTAINER_GROUP=true make docker-compose
clean-elk: clean-elk:
docker stop tools_kibana_1 docker stop tools_kibana_1
docker stop tools_logstash_1 docker stop tools_logstash_1
@@ -538,14 +530,18 @@ psql-container:
VERSION: VERSION:
@echo "awx: $(VERSION)" @echo "awx: $(VERSION)"
PYTHON_VERSION:
@echo "$(PYTHON)" | sed 's:python::'
Dockerfile: tools/ansible/roles/dockerfile/templates/Dockerfile.j2 Dockerfile: tools/ansible/roles/dockerfile/templates/Dockerfile.j2
ansible-playbook tools/ansible/dockerfile.yml ansible-playbook tools/ansible/dockerfile.yml -e receptor_image=$(RECEPTOR_IMAGE)
Dockerfile.kube-dev: tools/ansible/roles/dockerfile/templates/Dockerfile.j2 Dockerfile.kube-dev: tools/ansible/roles/dockerfile/templates/Dockerfile.j2
ansible-playbook tools/ansible/dockerfile.yml \ ansible-playbook tools/ansible/dockerfile.yml \
-e dockerfile_name=Dockerfile.kube-dev \ -e dockerfile_name=Dockerfile.kube-dev \
-e kube_dev=True \ -e kube_dev=True \
-e template_dest=_build_kube_dev -e template_dest=_build_kube_dev \
-e receptor_image=$(RECEPTOR_IMAGE)
awx-kube-dev-build: Dockerfile.kube-dev awx-kube-dev-build: Dockerfile.kube-dev
docker build -f Dockerfile.kube-dev \ docker build -f Dockerfile.kube-dev \
@@ -558,11 +554,11 @@ awx-kube-dev-build: Dockerfile.kube-dev
# generate UI .pot file, an empty template of strings yet to be translated # generate UI .pot file, an empty template of strings yet to be translated
pot: $(UI_BUILD_FLAG_FILE) pot: $(UI_BUILD_FLAG_FILE)
$(NPM_BIN) --prefix awx/ui_next --loglevel warn run extract-template --clean $(NPM_BIN) --prefix awx/ui --loglevel warn run extract-template --clean
# generate UI .po files for each locale (will update translated strings for `en`) # generate UI .po files for each locale (will update translated strings for `en`)
po: $(UI_BUILD_FLAG_FILE) po: $(UI_BUILD_FLAG_FILE)
$(NPM_BIN) --prefix awx/ui_next --loglevel warn run extract-strings -- --clean $(NPM_BIN) --prefix awx/ui --loglevel warn run extract-strings -- --clean
# generate API django .pot .po # generate API django .pot .po
LANG = "en-us" LANG = "en-us"

View File

@@ -1,4 +1,4 @@
[![Gated by Zuul](https://zuul-ci.org/gated.svg)](https://ansible.softwarefactory-project.io/zuul/status) [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-yellow.svg)](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) [![Apache v2 License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](https://github.com/ansible/awx/blob/devel/LICENSE.md) [![AWX Mailing List](https://img.shields.io/badge/mailing%20list-AWX-orange.svg)](https://groups.google.com/g/awx-project) [![CI](https://github.com/ansible/awx/actions/workflows/ci.yml/badge.svg?branch=devel)](https://github.com/ansible/awx/actions/workflows/ci.yml) [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-Ansible-yellow.svg)](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) [![Apache v2 License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)](https://github.com/ansible/awx/blob/devel/LICENSE.md) [![AWX Mailing List](https://img.shields.io/badge/mailing%20list-AWX-orange.svg)](https://groups.google.com/g/awx-project)
[![IRC Chat - #ansible-awx](https://img.shields.io/badge/IRC-%23ansible--awx-blueviolet.svg)](https://libera.chat) [![IRC Chat - #ansible-awx](https://img.shields.io/badge/IRC-%23ansible--awx-blueviolet.svg)](https://libera.chat)
<img src="https://raw.githubusercontent.com/ansible/awx-logos/master/awx/ui/client/assets/logo-login.svg?sanitize=true" width=200 alt="AWX" /> <img src="https://raw.githubusercontent.com/ansible/awx-logos/master/awx/ui/client/assets/logo-login.svg?sanitize=true" width=200 alt="AWX" />

View File

@@ -1 +0,0 @@
19.2.2

View File

@@ -151,7 +151,7 @@ def manage():
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line
# enforce the postgres version is equal to 12. if not, then terminate program with exit code of 1 # enforce the postgres version is equal to 12. if not, then terminate program with exit code of 1
if not MODE == 'development': if not os.getenv('SKIP_PG_VERSION_CHECK', False) and not MODE == 'development':
if (connection.pg_version // 10000) < 12: if (connection.pg_version // 10000) < 12:
sys.stderr.write("Postgres version 12 is required\n") sys.stderr.write("Postgres version 12 is required\n")
sys.exit(1) sys.exit(1)

View File

@@ -44,6 +44,7 @@ from awx.main.views import ApiErrorView
from awx.api.serializers import ResourceAccessListElementSerializer, CopySerializer, UserSerializer from awx.api.serializers import ResourceAccessListElementSerializer, CopySerializer, UserSerializer
from awx.api.versioning import URLPathVersioning from awx.api.versioning import URLPathVersioning
from awx.api.metadata import SublistAttachDetatchMetadata, Metadata from awx.api.metadata import SublistAttachDetatchMetadata, Metadata
from awx.conf import settings_registry
__all__ = [ __all__ = [
'APIView', 'APIView',
@@ -208,19 +209,35 @@ class APIView(views.APIView):
return response return response
if response.status_code >= 400: if response.status_code >= 400:
status_msg = "status %s received by user %s attempting to access %s from %s" % ( msg_data = {
response.status_code, 'status_code': response.status_code,
request.user, 'user_name': request.user,
request.path, 'url_path': request.path,
request.META.get('REMOTE_ADDR', None), 'remote_addr': request.META.get('REMOTE_ADDR', None),
) }
if type(response.data) is dict:
msg_data['error'] = response.data.get('error', response.status_text)
elif type(response.data) is list:
msg_data['error'] = ", ".join(list(map(lambda x: x.get('error', response.status_text), response.data)))
else:
msg_data['error'] = response.status_text
try:
status_msg = getattr(settings, 'API_400_ERROR_LOG_FORMAT').format(**msg_data)
except Exception as e:
if getattr(settings, 'API_400_ERROR_LOG_FORMAT', None):
logger.error("Unable to format API_400_ERROR_LOG_FORMAT setting, defaulting log message: {}".format(e))
status_msg = settings_registry.get_setting_field('API_400_ERROR_LOG_FORMAT').get_default().format(**msg_data)
if hasattr(self, '__init_request_error__'): if hasattr(self, '__init_request_error__'):
response = self.handle_exception(self.__init_request_error__) response = self.handle_exception(self.__init_request_error__)
if response.status_code == 401: if response.status_code == 401:
response.data['detail'] += ' To establish a login session, visit /api/login/.' response.data['detail'] += _(' To establish a login session, visit') + ' /api/login/.'
logger.info(status_msg) logger.info(status_msg)
else: else:
logger.warning(status_msg) logger.warning(status_msg)
response = super(APIView, self).finalize_response(request, response, *args, **kwargs) response = super(APIView, self).finalize_response(request, response, *args, **kwargs)
time_started = getattr(self, 'time_started', None) time_started = getattr(self, 'time_started', None)
response['X-API-Product-Version'] = get_awx_version() response['X-API-Product-Version'] = get_awx_version()
@@ -817,7 +834,7 @@ class ResourceAccessList(ParentMixin, ListAPIView):
def trigger_delayed_deep_copy(*args, **kwargs): def trigger_delayed_deep_copy(*args, **kwargs):
from awx.main.tasks import deep_copy_model_obj from awx.main.tasks.system import deep_copy_model_obj
connection.on_commit(lambda: deep_copy_model_obj.delay(*args, **kwargs)) connection.on_commit(lambda: deep_copy_model_obj.delay(*args, **kwargs))

View File

@@ -25,7 +25,7 @@ __all__ = [
'ProjectUpdatePermission', 'ProjectUpdatePermission',
'InventoryInventorySourcesUpdatePermission', 'InventoryInventorySourcesUpdatePermission',
'UserPermission', 'UserPermission',
'IsSuperUser', 'IsSystemAdminOrAuditor',
'InstanceGroupTowerPermission', 'InstanceGroupTowerPermission',
'WorkflowApprovalPermission', 'WorkflowApprovalPermission',
] ]
@@ -236,13 +236,18 @@ class UserPermission(ModelAccessPermission):
raise PermissionDenied() raise PermissionDenied()
class IsSuperUser(permissions.BasePermission): class IsSystemAdminOrAuditor(permissions.BasePermission):
""" """
Allows access only to admin users. Allows write access only to system admin users.
Allows read access only to system auditor users.
""" """
def has_permission(self, request, view): def has_permission(self, request, view):
return request.user and request.user.is_superuser if not (request.user and request.user.is_authenticated):
return False
if request.method == 'GET':
return request.user.is_superuser or request.user.is_system_auditor
return request.user.is_superuser
class InstanceGroupTowerPermission(ModelAccessPermission): class InstanceGroupTowerPermission(ModelAccessPermission):

View File

@@ -57,6 +57,7 @@ from awx.main.models import (
Host, Host,
Instance, Instance,
InstanceGroup, InstanceGroup,
InstanceLink,
Inventory, Inventory,
InventorySource, InventorySource,
InventoryUpdate, InventoryUpdate,
@@ -378,19 +379,22 @@ class BaseSerializer(serializers.ModelSerializer, metaclass=BaseSerializerMetacl
def _get_related(self, obj): def _get_related(self, obj):
return {} if obj is None else self.get_related(obj) return {} if obj is None else self.get_related(obj)
def _generate_named_url(self, url_path, obj, node): def _generate_friendly_id(self, obj, node):
url_units = url_path.split('/')
reset_counters() reset_counters()
named_url = node.generate_named_url(obj) return node.generate_named_url(obj)
url_units[4] = named_url
return '/'.join(url_units)
def get_related(self, obj): def get_related(self, obj):
res = OrderedDict() res = OrderedDict()
view = self.context.get('view', None) view = self.context.get('view', None)
if view and (hasattr(view, 'retrieve') or view.request.method == 'POST') and type(obj) in settings.NAMED_URL_GRAPH: if view and (hasattr(view, 'retrieve') or view.request.method == 'POST') and type(obj) in settings.NAMED_URL_GRAPH:
original_url = self.get_url(obj) original_path = self.get_url(obj)
res['named_url'] = self._generate_named_url(original_url, obj, settings.NAMED_URL_GRAPH[type(obj)]) path_components = original_path.lstrip('/').rstrip('/').split('/')
friendly_id = self._generate_friendly_id(obj, settings.NAMED_URL_GRAPH[type(obj)])
path_components[-1] = friendly_id
new_path = '/' + '/'.join(path_components) + '/'
res['named_url'] = new_path
if getattr(obj, 'created_by', None): if getattr(obj, 'created_by', None):
res['created_by'] = self.reverse('api:user_detail', kwargs={'pk': obj.created_by.pk}) res['created_by'] = self.reverse('api:user_detail', kwargs={'pk': obj.created_by.pk})
if getattr(obj, 'modified_by', None): if getattr(obj, 'modified_by', None):
@@ -861,7 +865,7 @@ class UnifiedJobSerializer(BaseSerializer):
if 'elapsed' in ret: if 'elapsed' in ret:
if obj and obj.pk and obj.started and not obj.finished: if obj and obj.pk and obj.started and not obj.finished:
td = now() - obj.started td = now() - obj.started
ret['elapsed'] = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6) / (10 ** 6 * 1.0) ret['elapsed'] = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / (10**6 * 1.0)
ret['elapsed'] = float(ret['elapsed']) ret['elapsed'] = float(ret['elapsed'])
# Because this string is saved in the db in the source language, # Because this string is saved in the db in the source language,
# it must be marked for translation after it is pulled from the db, not when set # it must be marked for translation after it is pulled from the db, not when set
@@ -948,7 +952,6 @@ class UserSerializer(BaseSerializer):
'*', '*',
'-name', '-name',
'-description', '-description',
'-modified',
'username', 'username',
'first_name', 'first_name',
'last_name', 'last_name',
@@ -1640,7 +1643,25 @@ class BaseSerializerWithVariables(BaseSerializer):
return vars_validate_or_raise(value) return vars_validate_or_raise(value)
class InventorySerializer(BaseSerializerWithVariables): class LabelsListMixin(object):
def _summary_field_labels(self, obj):
label_list = [{'id': x.id, 'name': x.name} for x in obj.labels.all()[:10]]
if has_model_field_prefetched(obj, 'labels'):
label_ct = len(obj.labels.all())
else:
if len(label_list) < 10:
label_ct = len(label_list)
else:
label_ct = obj.labels.count()
return {'count': label_ct, 'results': label_list}
def get_summary_fields(self, obj):
res = super(LabelsListMixin, self).get_summary_fields(obj)
res['labels'] = self._summary_field_labels(obj)
return res
class InventorySerializer(LabelsListMixin, BaseSerializerWithVariables):
show_capabilities = ['edit', 'delete', 'adhoc', 'copy'] show_capabilities = ['edit', 'delete', 'adhoc', 'copy']
capabilities_prefetch = ['admin', 'adhoc', {'copy': 'organization.inventory_admin'}] capabilities_prefetch = ['admin', 'adhoc', {'copy': 'organization.inventory_admin'}]
@@ -1681,6 +1702,7 @@ class InventorySerializer(BaseSerializerWithVariables):
object_roles=self.reverse('api:inventory_object_roles_list', kwargs={'pk': obj.pk}), object_roles=self.reverse('api:inventory_object_roles_list', kwargs={'pk': obj.pk}),
instance_groups=self.reverse('api:inventory_instance_groups_list', kwargs={'pk': obj.pk}), instance_groups=self.reverse('api:inventory_instance_groups_list', kwargs={'pk': obj.pk}),
copy=self.reverse('api:inventory_copy', kwargs={'pk': obj.pk}), copy=self.reverse('api:inventory_copy', kwargs={'pk': obj.pk}),
labels=self.reverse('api:inventory_label_list', kwargs={'pk': obj.pk}),
) )
) )
if obj.organization: if obj.organization:
@@ -2750,24 +2772,6 @@ class OrganizationCredentialSerializerCreate(CredentialSerializerCreate):
fields = ('*', '-user', '-team') fields = ('*', '-user', '-team')
class LabelsListMixin(object):
def _summary_field_labels(self, obj):
label_list = [{'id': x.id, 'name': x.name} for x in obj.labels.all()[:10]]
if has_model_field_prefetched(obj, 'labels'):
label_ct = len(obj.labels.all())
else:
if len(label_list) < 10:
label_ct = len(label_list)
else:
label_ct = obj.labels.count()
return {'count': label_ct, 'results': label_list}
def get_summary_fields(self, obj):
res = super(LabelsListMixin, self).get_summary_fields(obj)
res['labels'] = self._summary_field_labels(obj)
return res
class JobOptionsSerializer(LabelsListMixin, BaseSerializer): class JobOptionsSerializer(LabelsListMixin, BaseSerializer):
class Meta: class Meta:
fields = ( fields = (
@@ -4768,6 +4772,28 @@ class ScheduleSerializer(LaunchConfigurationBaseSerializer, SchedulePreviewSeria
return super(ScheduleSerializer, self).validate(attrs) return super(ScheduleSerializer, self).validate(attrs)
class InstanceLinkSerializer(BaseSerializer):
class Meta:
model = InstanceLink
fields = ('source', 'target')
source = serializers.SlugRelatedField(slug_field="hostname", read_only=True)
target = serializers.SlugRelatedField(slug_field="hostname", read_only=True)
class InstanceNodeSerializer(BaseSerializer):
class Meta:
model = Instance
fields = ('id', 'hostname', 'node_type', 'node_state')
node_state = serializers.SerializerMethodField()
def get_node_state(self, obj):
if not obj.enabled:
return "disabled"
return "error" if obj.errors else "healthy"
class InstanceSerializer(BaseSerializer): class InstanceSerializer(BaseSerializer):
consumed_capacity = serializers.SerializerMethodField() consumed_capacity = serializers.SerializerMethodField()
@@ -4777,7 +4803,7 @@ class InstanceSerializer(BaseSerializer):
class Meta: class Meta:
model = Instance model = Instance
read_only_fields = ('uuid', 'hostname', 'version') read_only_fields = ('uuid', 'hostname', 'version', 'node_type')
fields = ( fields = (
"id", "id",
"type", "type",
@@ -4787,6 +4813,9 @@ class InstanceSerializer(BaseSerializer):
"hostname", "hostname",
"created", "created",
"modified", "modified",
"last_seen",
"last_health_check",
"errors",
'capacity_adjustment', 'capacity_adjustment',
"version", "version",
"capacity", "capacity",
@@ -4800,12 +4829,16 @@ class InstanceSerializer(BaseSerializer):
"mem_capacity", "mem_capacity",
"enabled", "enabled",
"managed_by_policy", "managed_by_policy",
"node_type",
) )
def get_related(self, obj): def get_related(self, obj):
res = super(InstanceSerializer, self).get_related(obj) res = super(InstanceSerializer, self).get_related(obj)
res['jobs'] = self.reverse('api:instance_unified_jobs_list', kwargs={'pk': obj.pk}) res['jobs'] = self.reverse('api:instance_unified_jobs_list', kwargs={'pk': obj.pk})
res['instance_groups'] = self.reverse('api:instance_instance_groups_list', kwargs={'pk': obj.pk}) res['instance_groups'] = self.reverse('api:instance_instance_groups_list', kwargs={'pk': obj.pk})
if self.context['request'].user.is_superuser or self.context['request'].user.is_system_auditor:
if obj.node_type != 'hop':
res['health_check'] = self.reverse('api:instance_health_check', kwargs={'pk': obj.pk})
return res return res
def get_consumed_capacity(self, obj): def get_consumed_capacity(self, obj):
@@ -4818,6 +4851,13 @@ class InstanceSerializer(BaseSerializer):
return float("{0:.2f}".format(((float(obj.capacity) - float(obj.consumed_capacity)) / (float(obj.capacity))) * 100)) return float("{0:.2f}".format(((float(obj.capacity) - float(obj.consumed_capacity)) / (float(obj.capacity))) * 100))
class InstanceHealthCheckSerializer(BaseSerializer):
class Meta:
model = Instance
read_only_fields = ('uuid', 'hostname', 'version', 'last_health_check', 'errors', 'cpu', 'memory', 'cpu_capacity', 'mem_capacity', 'capacity')
fields = read_only_fields
class InstanceGroupSerializer(BaseSerializer): class InstanceGroupSerializer(BaseSerializer):
show_capabilities = ['edit', 'delete'] show_capabilities = ['edit', 'delete']
@@ -4991,6 +5031,7 @@ class ActivityStreamSerializer(BaseSerializer):
('credential_type', ('id', 'name', 'description', 'kind', 'managed')), ('credential_type', ('id', 'name', 'description', 'kind', 'managed')),
('ad_hoc_command', ('id', 'name', 'status', 'limit')), ('ad_hoc_command', ('id', 'name', 'status', 'limit')),
('workflow_approval', ('id', 'name', 'unified_job_id')), ('workflow_approval', ('id', 'name', 'unified_job_id')),
('instance', ('id', 'hostname')),
] ]
return field_list return field_list

View File

@@ -0,0 +1,33 @@
{% ifmeth GET %}
# Health Check Data
Health checks are used to obtain important data about an instance.
Instance fields affected by the health check are shown in this view.
Fundamentally, health checks require running code on the machine in question.
- For instances with `node_type` of "control" or "hybrid", health checks are
performed as part of a periodic task that runs in the background.
- For instances with `node_type` of "execution", health checks are done by submitting
a work unit through the receptor mesh.
If ran through the receptor mesh, the invoked command is:
```
ansible-runner worker --worker-info
```
For execution nodes, these checks are _not_ performed on a regular basis.
Health checks against functional nodes will be ran when the node is first discovered.
Health checks against nodes with errors will be repeated at a reduced frequency.
{% endifmeth %}
{% ifmeth POST %}
# Manually Initiate a Health Check
For purposes of error remediation or debugging, a health check can be
manually initiated by making a POST request to this endpoint.
This will submit the work unit to the target node through the receptor mesh and wait for it to finish.
The model will be updated with the result.
Up-to-date values of the fields will be returned in the response data.
{% endifmeth %}

View File

@@ -0,0 +1 @@
Make a GET request to this resource to obtain a list all Receptor Nodes and their links.

View File

@@ -3,11 +3,10 @@
from django.conf.urls import url from django.conf.urls import url
from awx.api.views import AdHocCommandEventList, AdHocCommandEventDetail from awx.api.views import AdHocCommandEventDetail
urls = [ urls = [
url(r'^$', AdHocCommandEventList.as_view(), name='ad_hoc_command_event_list'),
url(r'^(?P<pk>[0-9]+)/$', AdHocCommandEventDetail.as_view(), name='ad_hoc_command_event_detail'), url(r'^(?P<pk>[0-9]+)/$', AdHocCommandEventDetail.as_view(), name='ad_hoc_command_event_detail'),
] ]

View File

@@ -3,7 +3,7 @@
from django.conf.urls import url from django.conf.urls import url
from awx.api.views import InstanceList, InstanceDetail, InstanceUnifiedJobsList, InstanceInstanceGroupsList from awx.api.views import InstanceList, InstanceDetail, InstanceUnifiedJobsList, InstanceInstanceGroupsList, InstanceHealthCheck
urls = [ urls = [
@@ -11,6 +11,7 @@ urls = [
url(r'^(?P<pk>[0-9]+)/$', InstanceDetail.as_view(), name='instance_detail'), url(r'^(?P<pk>[0-9]+)/$', InstanceDetail.as_view(), name='instance_detail'),
url(r'^(?P<pk>[0-9]+)/jobs/$', InstanceUnifiedJobsList.as_view(), name='instance_unified_jobs_list'), url(r'^(?P<pk>[0-9]+)/jobs/$', InstanceUnifiedJobsList.as_view(), name='instance_unified_jobs_list'),
url(r'^(?P<pk>[0-9]+)/instance_groups/$', InstanceInstanceGroupsList.as_view(), name='instance_instance_groups_list'), url(r'^(?P<pk>[0-9]+)/instance_groups/$', InstanceInstanceGroupsList.as_view(), name='instance_instance_groups_list'),
url(r'^(?P<pk>[0-9]+)/health_check/$', InstanceHealthCheck.as_view(), name='instance_health_check'),
] ]
__all__ = ['urls'] __all__ = ['urls']

View File

@@ -20,6 +20,7 @@ from awx.api.views import (
InventoryAccessList, InventoryAccessList,
InventoryObjectRolesList, InventoryObjectRolesList,
InventoryInstanceGroupsList, InventoryInstanceGroupsList,
InventoryLabelList,
InventoryCopy, InventoryCopy,
) )
@@ -41,6 +42,7 @@ urls = [
url(r'^(?P<pk>[0-9]+)/access_list/$', InventoryAccessList.as_view(), name='inventory_access_list'), url(r'^(?P<pk>[0-9]+)/access_list/$', InventoryAccessList.as_view(), name='inventory_access_list'),
url(r'^(?P<pk>[0-9]+)/object_roles/$', InventoryObjectRolesList.as_view(), name='inventory_object_roles_list'), url(r'^(?P<pk>[0-9]+)/object_roles/$', InventoryObjectRolesList.as_view(), name='inventory_object_roles_list'),
url(r'^(?P<pk>[0-9]+)/instance_groups/$', InventoryInstanceGroupsList.as_view(), name='inventory_instance_groups_list'), url(r'^(?P<pk>[0-9]+)/instance_groups/$', InventoryInstanceGroupsList.as_view(), name='inventory_instance_groups_list'),
url(r'^(?P<pk>[0-9]+)/labels/$', InventoryLabelList.as_view(), name='inventory_label_list'),
url(r'^(?P<pk>[0-9]+)/copy/$', InventoryCopy.as_view(), name='inventory_copy'), url(r'^(?P<pk>[0-9]+)/copy/$', InventoryCopy.as_view(), name='inventory_copy'),
] ]

View File

@@ -28,6 +28,7 @@ from awx.api.views import (
OAuth2TokenList, OAuth2TokenList,
ApplicationOAuth2TokenList, ApplicationOAuth2TokenList,
OAuth2ApplicationDetail, OAuth2ApplicationDetail,
MeshVisualizer,
) )
from awx.api.views.metrics import MetricsView from awx.api.views.metrics import MetricsView
@@ -95,6 +96,7 @@ v2_urls = [
url(r'^me/$', UserMeList.as_view(), name='user_me_list'), url(r'^me/$', UserMeList.as_view(), name='user_me_list'),
url(r'^dashboard/$', DashboardView.as_view(), name='dashboard_view'), url(r'^dashboard/$', DashboardView.as_view(), name='dashboard_view'),
url(r'^dashboard/graphs/jobs/$', DashboardJobsGraphView.as_view(), name='dashboard_jobs_graph_view'), url(r'^dashboard/graphs/jobs/$', DashboardJobsGraphView.as_view(), name='dashboard_jobs_graph_view'),
url(r'^mesh_visualizer/', MeshVisualizer.as_view(), name='mesh_visualizer_view'),
url(r'^settings/', include('awx.conf.urls')), url(r'^settings/', include('awx.conf.urls')),
url(r'^instances/', include(instance_urls)), url(r'^instances/', include(instance_urls)),
url(r'^instance_groups/', include(instance_group_urls)), url(r'^instance_groups/', include(instance_group_urls)),

View File

@@ -62,7 +62,7 @@ import pytz
from wsgiref.util import FileWrapper from wsgiref.util import FileWrapper
# AWX # AWX
from awx.main.tasks import send_notifications, update_inventory_computed_fields from awx.main.tasks.system import send_notifications, update_inventory_computed_fields
from awx.main.access import get_user_queryset, HostAccess from awx.main.access import get_user_queryset, HostAccess
from awx.api.generics import ( from awx.api.generics import (
APIView, APIView,
@@ -108,6 +108,7 @@ from awx.api.permissions import (
InstanceGroupTowerPermission, InstanceGroupTowerPermission,
VariableDataPermission, VariableDataPermission,
WorkflowApprovalPermission, WorkflowApprovalPermission,
IsSystemAdminOrAuditor,
) )
from awx.api import renderers from awx.api import renderers
from awx.api import serializers from awx.api import serializers
@@ -156,8 +157,10 @@ from awx.api.views.inventory import ( # noqa
InventoryAccessList, InventoryAccessList,
InventoryObjectRolesList, InventoryObjectRolesList,
InventoryJobTemplateList, InventoryJobTemplateList,
InventoryLabelList,
InventoryCopy, InventoryCopy,
) )
from awx.api.views.mesh_visualizer import MeshVisualizer # noqa
from awx.api.views.root import ( # noqa from awx.api.views.root import ( # noqa
ApiRootView, ApiRootView,
ApiOAuthAuthorizationRootView, ApiOAuthAuthorizationRootView,
@@ -374,8 +377,8 @@ class InstanceDetail(RetrieveUpdateAPIView):
r = super(InstanceDetail, self).update(request, *args, **kwargs) r = super(InstanceDetail, self).update(request, *args, **kwargs)
if status.is_success(r.status_code): if status.is_success(r.status_code):
obj = self.get_object() obj = self.get_object()
obj.refresh_capacity() obj.set_capacity_value()
obj.save() obj.save(update_fields=['capacity'])
r.data = serializers.InstanceSerializer(obj, context=self.get_serializer_context()).to_representation(obj) r.data = serializers.InstanceSerializer(obj, context=self.get_serializer_context()).to_representation(obj)
return r return r
@@ -402,6 +405,67 @@ class InstanceInstanceGroupsList(InstanceGroupMembershipMixin, SubListCreateAtta
parent_model = models.Instance parent_model = models.Instance
relationship = 'rampart_groups' relationship = 'rampart_groups'
def is_valid_relation(self, parent, sub, created=False):
if parent.node_type == 'control':
return {'msg': _(f"Cannot change instance group membership of control-only node: {parent.hostname}.")}
if parent.node_type == 'hop':
return {'msg': _(f"Cannot change instance group membership of hop node: {parent.hostname}.")}
return None
class InstanceHealthCheck(GenericAPIView):
name = _('Instance Health Check')
model = models.Instance
serializer_class = serializers.InstanceHealthCheckSerializer
permission_classes = (IsSystemAdminOrAuditor,)
def get_queryset(self):
# FIXME: For now, we don't have a good way of checking the health of a hop node.
return super().get_queryset().exclude(node_type='hop')
def get(self, request, *args, **kwargs):
obj = self.get_object()
data = self.get_serializer(data=request.data).to_representation(obj)
return Response(data, status=status.HTTP_200_OK)
def post(self, request, *args, **kwargs):
obj = self.get_object()
if obj.node_type == 'execution':
from awx.main.tasks.system import execution_node_health_check
runner_data = execution_node_health_check(obj.hostname)
obj.refresh_from_db()
data = self.get_serializer(data=request.data).to_representation(obj)
# Add in some extra unsaved fields
for extra_field in ('transmit_timing', 'run_timing'):
if extra_field in runner_data:
data[extra_field] = runner_data[extra_field]
else:
from awx.main.tasks.system import cluster_node_health_check
if settings.CLUSTER_HOST_ID == obj.hostname:
cluster_node_health_check(obj.hostname)
else:
cluster_node_health_check.apply_async([obj.hostname], queue=obj.hostname)
start_time = time.time()
prior_check_time = obj.last_health_check
while time.time() - start_time < 50.0:
obj.refresh_from_db(fields=['last_health_check'])
if obj.last_health_check != prior_check_time:
break
if time.time() - start_time < 1.0:
time.sleep(0.1)
else:
time.sleep(1.0)
else:
obj.mark_offline(errors=_('Health check initiated by user determined this instance to be unresponsive'))
obj.refresh_from_db()
data = self.get_serializer(data=request.data).to_representation(obj)
return Response(data, status=status.HTTP_200_OK)
class InstanceGroupList(ListCreateAPIView): class InstanceGroupList(ListCreateAPIView):
@@ -444,6 +508,13 @@ class InstanceGroupInstanceList(InstanceGroupMembershipMixin, SubListAttachDetac
relationship = "instances" relationship = "instances"
search_fields = ('hostname',) search_fields = ('hostname',)
def is_valid_relation(self, parent, sub, created=False):
if sub.node_type == 'control':
return {'msg': _(f"Cannot change instance group membership of control-only node: {sub.hostname}.")}
if sub.node_type == 'hop':
return {'msg': _(f"Cannot change instance group membership of hop node: {sub.hostname}.")}
return None
class ScheduleList(ListCreateAPIView): class ScheduleList(ListCreateAPIView):
@@ -3906,18 +3977,6 @@ class AdHocCommandRelaunch(GenericAPIView):
return Response(data, status=status.HTTP_201_CREATED, headers=headers) return Response(data, status=status.HTTP_201_CREATED, headers=headers)
class AdHocCommandEventList(NoTruncateMixin, ListAPIView):
model = models.AdHocCommandEvent
serializer_class = serializers.AdHocCommandEventSerializer
search_fields = ('stdout',)
def get_queryset(self):
adhoc = self.get_parent_object()
self.check_parent_access(adhoc)
return adhoc.get_event_queryset()
class AdHocCommandEventDetail(RetrieveAPIView): class AdHocCommandEventDetail(RetrieveAPIView):
model = models.AdHocCommandEvent model = models.AdHocCommandEvent

View File

@@ -16,17 +16,21 @@ from rest_framework.response import Response
from rest_framework import status from rest_framework import status
# AWX # AWX
from awx.main.models import ( from awx.main.models import ActivityStream, Inventory, JobTemplate, Role, User, InstanceGroup, InventoryUpdateEvent, InventoryUpdate
ActivityStream,
Inventory, from awx.main.models.label import Label
JobTemplate,
Role, from awx.api.generics import (
User, ListCreateAPIView,
InstanceGroup, RetrieveUpdateDestroyAPIView,
InventoryUpdateEvent, SubListAPIView,
InventoryUpdate, SubListAttachDetachAPIView,
ResourceAccessList,
CopyAPIView,
DeleteLastUnattachLabelMixin,
SubListCreateAttachDetachAPIView,
) )
from awx.api.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView, SubListAPIView, SubListAttachDetachAPIView, ResourceAccessList, CopyAPIView
from awx.api.serializers import ( from awx.api.serializers import (
InventorySerializer, InventorySerializer,
@@ -35,6 +39,7 @@ from awx.api.serializers import (
InstanceGroupSerializer, InstanceGroupSerializer,
InventoryUpdateEventSerializer, InventoryUpdateEventSerializer,
JobTemplateSerializer, JobTemplateSerializer,
LabelSerializer,
) )
from awx.api.views.mixin import RelatedJobsPreventDeleteMixin, ControlledByScmMixin from awx.api.views.mixin import RelatedJobsPreventDeleteMixin, ControlledByScmMixin
@@ -152,6 +157,30 @@ class InventoryJobTemplateList(SubListAPIView):
return qs.filter(inventory=parent) return qs.filter(inventory=parent)
class InventoryLabelList(DeleteLastUnattachLabelMixin, SubListCreateAttachDetachAPIView, SubListAPIView):
model = Label
serializer_class = LabelSerializer
parent_model = Inventory
relationship = 'labels'
def post(self, request, *args, **kwargs):
# If a label already exists in the database, attach it instead of erroring out
# that it already exists
if 'id' not in request.data and 'name' in request.data and 'organization' in request.data:
existing = Label.objects.filter(name=request.data['name'], organization_id=request.data['organization'])
if existing.exists():
existing = existing[0]
request.data['id'] = existing.id
del request.data['name']
del request.data['organization']
if Label.objects.filter(inventory_labels=self.kwargs['pk']).count() > 100:
return Response(
dict(msg=_('Maximum number of labels for {} reached.'.format(self.parent_model._meta.verbose_name_raw))), status=status.HTTP_400_BAD_REQUEST
)
return super(InventoryLabelList, self).post(request, *args, **kwargs)
class InventoryCopy(CopyAPIView): class InventoryCopy(CopyAPIView):
model = Inventory model = Inventory

View File

@@ -0,0 +1,25 @@
# Copyright (c) 2018 Red Hat, Inc.
# All Rights Reserved.
from django.utils.translation import ugettext_lazy as _
from awx.api.generics import APIView, Response
from awx.api.permissions import IsSystemAdminOrAuditor
from awx.api.serializers import InstanceLinkSerializer, InstanceNodeSerializer
from awx.main.models import InstanceLink, Instance
class MeshVisualizer(APIView):
name = _("Mesh Visualizer")
permission_classes = (IsSystemAdminOrAuditor,)
swagger_topic = "System Configuration"
def get(self, request, format=None):
data = {
'nodes': InstanceNodeSerializer(Instance.objects.all(), many=True).data,
'links': InstanceLinkSerializer(InstanceLink.objects.all(), many=True).data,
}
return Response(data)

View File

@@ -68,13 +68,23 @@ class InstanceGroupMembershipMixin(object):
membership. membership.
""" """
def attach_validate(self, request):
parent = self.get_parent_object()
sub_id, res = super().attach_validate(request)
if res: # handle an error
return sub_id, res
sub = get_object_or_400(self.model, pk=sub_id)
attach_errors = self.is_valid_relation(parent, sub)
if attach_errors:
return sub_id, Response(attach_errors, status=status.HTTP_400_BAD_REQUEST)
return sub_id, res
def attach(self, request, *args, **kwargs): def attach(self, request, *args, **kwargs):
response = super(InstanceGroupMembershipMixin, self).attach(request, *args, **kwargs) response = super(InstanceGroupMembershipMixin, self).attach(request, *args, **kwargs)
sub_id, res = self.attach_validate(request) sub_id, res = self.attach_validate(request)
if status.is_success(response.status_code): if status.is_success(response.status_code):
if self.parent_model is Instance: if self.parent_model is Instance:
ig_obj = get_object_or_400(self.model, pk=sub_id) inst_name = self.get_parent_object().hostname
inst_name = ig_obj.hostname
else: else:
inst_name = get_object_or_400(self.model, pk=sub_id).hostname inst_name = get_object_or_400(self.model, pk=sub_id).hostname
with transaction.atomic(): with transaction.atomic():
@@ -91,11 +101,12 @@ class InstanceGroupMembershipMixin(object):
return response return response
def unattach_validate(self, request): def unattach_validate(self, request):
parent = self.get_parent_object()
(sub_id, res) = super(InstanceGroupMembershipMixin, self).unattach_validate(request) (sub_id, res) = super(InstanceGroupMembershipMixin, self).unattach_validate(request)
if res: if res:
return (sub_id, res) return (sub_id, res)
sub = get_object_or_400(self.model, pk=sub_id) sub = get_object_or_400(self.model, pk=sub_id)
attach_errors = self.is_valid_relation(None, sub) attach_errors = self.is_valid_relation(parent, sub)
if attach_errors: if attach_errors:
return (sub_id, Response(attach_errors, status=status.HTTP_400_BAD_REQUEST)) return (sub_id, Response(attach_errors, status=status.HTTP_400_BAD_REQUEST))
return (sub_id, res) return (sub_id, res)

View File

@@ -123,6 +123,7 @@ class ApiVersionRootView(APIView):
data['workflow_approvals'] = reverse('api:workflow_approval_list', request=request) data['workflow_approvals'] = reverse('api:workflow_approval_list', request=request)
data['workflow_job_template_nodes'] = reverse('api:workflow_job_template_node_list', request=request) data['workflow_job_template_nodes'] = reverse('api:workflow_job_template_node_list', request=request)
data['workflow_job_nodes'] = reverse('api:workflow_job_node_list', request=request) data['workflow_job_nodes'] = reverse('api:workflow_job_node_list', request=request)
data['mesh_visualizer'] = reverse('api:mesh_visualizer_view', request=request)
return Response(data) return Response(data)
@@ -149,16 +150,24 @@ class ApiV2PingView(APIView):
response = {'ha': is_ha_environment(), 'version': get_awx_version(), 'active_node': settings.CLUSTER_HOST_ID, 'install_uuid': settings.INSTALL_UUID} response = {'ha': is_ha_environment(), 'version': get_awx_version(), 'active_node': settings.CLUSTER_HOST_ID, 'install_uuid': settings.INSTALL_UUID}
response['instances'] = [] response['instances'] = []
for instance in Instance.objects.all(): for instance in Instance.objects.exclude(node_type='hop'):
response['instances'].append( response['instances'].append(
dict(node=instance.hostname, uuid=instance.uuid, heartbeat=instance.modified, capacity=instance.capacity, version=instance.version) dict(
node=instance.hostname,
node_type=instance.node_type,
uuid=instance.uuid,
heartbeat=instance.last_seen,
capacity=instance.capacity,
version=instance.version,
)
) )
sorted(response['instances'], key=operator.itemgetter('node')) response['instances'] = sorted(response['instances'], key=operator.itemgetter('node'))
response['instance_groups'] = [] response['instance_groups'] = []
for instance_group in InstanceGroup.objects.prefetch_related('instances'): for instance_group in InstanceGroup.objects.prefetch_related('instances'):
response['instance_groups'].append( response['instance_groups'].append(
dict(name=instance_group.name, capacity=instance_group.capacity, instances=[x.hostname for x in instance_group.instances.all()]) dict(name=instance_group.name, capacity=instance_group.capacity, instances=[x.hostname for x in instance_group.instances.all()])
) )
response['instance_groups'] = sorted(response['instance_groups'], key=lambda x: x['name'].lower())
return Response(response) return Response(response)

View File

@@ -13,6 +13,9 @@ from django.utils.translation import ugettext_lazy as _
from rest_framework.fields import BooleanField, CharField, ChoiceField, DictField, DateTimeField, EmailField, IntegerField, ListField, NullBooleanField # noqa from rest_framework.fields import BooleanField, CharField, ChoiceField, DictField, DateTimeField, EmailField, IntegerField, ListField, NullBooleanField # noqa
from rest_framework.serializers import PrimaryKeyRelatedField # noqa from rest_framework.serializers import PrimaryKeyRelatedField # noqa
# AWX
from awx.main.constants import CONTAINER_VOLUMES_MOUNT_TYPES, MAX_ISOLATED_PATH_COLON_DELIMITER
logger = logging.getLogger('awx.conf.fields') logger = logging.getLogger('awx.conf.fields')
# Use DRF fields to convert/validate settings: # Use DRF fields to convert/validate settings:
@@ -109,6 +112,49 @@ class StringListPathField(StringListField):
self.fail('type_error', input_type=type(paths)) self.fail('type_error', input_type=type(paths))
class StringListIsolatedPathField(StringListField):
# Valid formats
# '/etc/pki/ca-trust'
# '/etc/pki/ca-trust:/etc/pki/ca-trust'
# '/etc/pki/ca-trust:/etc/pki/ca-trust:O'
default_error_messages = {
'type_error': _('Expected list of strings but got {input_type} instead.'),
'path_error': _('{path} is not a valid path choice. You must provide an absolute path.'),
'mount_error': _('{scontext} is not a valid mount option. Allowed types are {mount_types}'),
'syntax_error': _('Invalid syntax. A string HOST-DIR[:CONTAINER-DIR[:OPTIONS]] is expected but got {path}.'),
}
def to_internal_value(self, paths):
if isinstance(paths, (list, tuple)):
for p in paths:
if not isinstance(p, str):
self.fail('type_error', input_type=type(p))
if not p.startswith('/'):
self.fail('path_error', path=p)
if p.count(':'):
if p.count(':') > MAX_ISOLATED_PATH_COLON_DELIMITER:
self.fail('syntax_error', path=p)
try:
src, dest, scontext = p.split(':')
except ValueError:
scontext = 'z'
src, dest = p.split(':')
finally:
for sp in [src, dest]:
if not len(sp):
self.fail('syntax_error', path=sp)
if not sp.startswith('/'):
self.fail('path_error', path=sp)
if scontext not in CONTAINER_VOLUMES_MOUNT_TYPES:
self.fail('mount_error', scontext=scontext, mount_types=CONTAINER_VOLUMES_MOUNT_TYPES)
return super(StringListIsolatedPathField, self).to_internal_value(sorted(paths))
else:
self.fail('type_error', input_type=type(paths))
class URLField(CharField): class URLField(CharField):
# these lines set up a custom regex that allow numbers in the # these lines set up a custom regex that allow numbers in the
# top-level domain # top-level domain

View File

@@ -1,62 +0,0 @@
import base64
import hashlib
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.ciphers.modes import ECB
__all__ = ['get_encryption_key', 'decrypt_field']
def get_encryption_key(field_name, pk=None):
"""
Generate key for encrypted password based on field name,
``settings.SECRET_KEY``, and instance pk (if available).
:param pk: (optional) the primary key of the ``awx.conf.model.Setting``;
can be omitted in situations where you're encrypting a setting
that is not database-persistent (like a read-only setting)
"""
from django.conf import settings
h = hashlib.sha1()
h.update(settings.SECRET_KEY)
if pk is not None:
h.update(str(pk))
h.update(field_name)
return h.digest()[:16]
def decrypt_value(encryption_key, value):
raw_data = value[len('$encrypted$') :]
# If the encrypted string contains a UTF8 marker, discard it
utf8 = raw_data.startswith('UTF8$')
if utf8:
raw_data = raw_data[len('UTF8$') :]
algo, b64data = raw_data.split('$', 1)
if algo != 'AES':
raise ValueError('unsupported algorithm: %s' % algo)
encrypted = base64.b64decode(b64data)
decryptor = Cipher(AES(encryption_key), ECB(), default_backend()).decryptor()
value = decryptor.update(encrypted) + decryptor.finalize()
value = value.rstrip('\x00')
# If the encrypted string contained a UTF8 marker, decode the data
if utf8:
value = value.decode('utf-8')
return value
def decrypt_field(instance, field_name, subfield=None):
"""
Return content of the given instance and field name decrypted.
"""
value = getattr(instance, field_name)
if isinstance(value, dict) and subfield is not None:
value = value[subfield]
if not value or not value.startswith('$encrypted$'):
return value
key = get_encryption_key(field_name, getattr(instance, 'pk', None))
return decrypt_value(key, value)

View File

@@ -25,7 +25,6 @@ from awx.main.utils import encrypt_field, decrypt_field
from awx.conf import settings_registry from awx.conf import settings_registry
from awx.conf.fields import PrimaryKeyRelatedField from awx.conf.fields import PrimaryKeyRelatedField
from awx.conf.models import Setting from awx.conf.models import Setting
from awx.conf.migrations._reencrypt import decrypt_field as old_decrypt_field
# FIXME: Gracefully handle when settings are accessed before the database is # FIXME: Gracefully handle when settings are accessed before the database is
# ready (or during migrations). # ready (or during migrations).
@@ -299,13 +298,7 @@ class SettingsWrapper(UserSettingsHolder):
continue continue
if self.registry.is_setting_encrypted(setting.key): if self.registry.is_setting_encrypted(setting.key):
setting_ids[setting.key] = setting.id setting_ids[setting.key] = setting.id
try: value = decrypt_field(setting, 'value')
value = decrypt_field(setting, 'value')
except ValueError as e:
# TODO: Remove in Tower 3.3
logger.debug('encountered error decrypting field: %s - attempting fallback to old', e)
value = old_decrypt_field(setting, 'value')
else: else:
value = setting.value value = setting.value
settings_to_cache[setting.key] = get_cache_value(value) settings_to_cache[setting.key] = get_cache_value(value)

View File

@@ -23,10 +23,10 @@ from rest_framework import status
# AWX # AWX
from awx.api.generics import APIView, GenericAPIView, ListAPIView, RetrieveUpdateDestroyAPIView from awx.api.generics import APIView, GenericAPIView, ListAPIView, RetrieveUpdateDestroyAPIView
from awx.api.permissions import IsSuperUser from awx.api.permissions import IsSystemAdminOrAuditor
from awx.api.versioning import reverse from awx.api.versioning import reverse
from awx.main.utils import camelcase_to_underscore from awx.main.utils import camelcase_to_underscore
from awx.main.tasks import handle_setting_changes from awx.main.tasks.system import handle_setting_changes
from awx.conf.models import Setting from awx.conf.models import Setting
from awx.conf.serializers import SettingCategorySerializer, SettingSingletonSerializer from awx.conf.serializers import SettingCategorySerializer, SettingSingletonSerializer
from awx.conf import settings_registry from awx.conf import settings_registry
@@ -150,7 +150,7 @@ class SettingLoggingTest(GenericAPIView):
name = _('Logging Connectivity Test') name = _('Logging Connectivity Test')
model = Setting model = Setting
serializer_class = SettingSingletonSerializer serializer_class = SettingSingletonSerializer
permission_classes = (IsSuperUser,) permission_classes = (IsSystemAdminOrAuditor,)
filter_backends = [] filter_backends = []
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -853,7 +853,12 @@ class InventoryAccess(BaseAccess):
""" """
model = Inventory model = Inventory
prefetch_related = ('created_by', 'modified_by', 'organization') prefetch_related = (
'created_by',
'modified_by',
'organization',
Prefetch('labels', queryset=Label.objects.all().order_by('name')),
)
def filtered_queryset(self, allowed=None, ad_hoc=None): def filtered_queryset(self, allowed=None, ad_hoc=None):
return self.model.accessible_objects(self.user, 'read_role') return self.model.accessible_objects(self.user, 'read_role')

View File

@@ -211,7 +211,7 @@ def projects_by_scm_type(since, **kwargs):
return counts return counts
@register('instance_info', '1.1', description=_('Cluster topology and capacity')) @register('instance_info', '1.2', description=_('Cluster topology and capacity'))
def instance_info(since, include_hostnames=False, **kwargs): def instance_info(since, include_hostnames=False, **kwargs):
info = {} info = {}
instances = models.Instance.objects.values_list('hostname').values( instances = models.Instance.objects.values_list('hostname').values(
@@ -337,7 +337,11 @@ def _events_table(since, full_path, until, tbl, where_column, project_job_create
{tbl}.parent_uuid, {tbl}.parent_uuid,
{tbl}.event, {tbl}.event,
task_action, task_action,
(CASE WHEN event = 'playbook_on_stats' THEN event_data END) as playbook_on_stats, -- '-' operator listed here:
-- https://www.postgresql.org/docs/12/functions-json.html
-- note that operator is only supported by jsonb objects
-- https://www.postgresql.org/docs/current/datatype-json.html
(CASE WHEN event = 'playbook_on_stats' THEN {event_data} - 'artifact_data' END) as playbook_on_stats,
{tbl}.failed, {tbl}.failed,
{tbl}.changed, {tbl}.changed,
{tbl}.playbook, {tbl}.playbook,
@@ -352,14 +356,14 @@ def _events_table(since, full_path, until, tbl, where_column, project_job_create
x.duration AS duration, x.duration AS duration,
x.res->'warnings' AS warnings, x.res->'warnings' AS warnings,
x.res->'deprecations' AS deprecations x.res->'deprecations' AS deprecations
FROM {tbl}, json_to_record({event_data}) AS x("res" json, "duration" text, "task_action" text, "start" text, "end" text) FROM {tbl}, jsonb_to_record({event_data}) AS x("res" json, "duration" text, "task_action" text, "start" text, "end" text)
WHERE ({tbl}.{where_column} > '{since.isoformat()}' AND {tbl}.{where_column} <= '{until.isoformat()}')) TO STDOUT WITH CSV HEADER''' WHERE ({tbl}.{where_column} > '{since.isoformat()}' AND {tbl}.{where_column} <= '{until.isoformat()}')) TO STDOUT WITH CSV HEADER'''
return query return query
try: try:
return _copy_table(table='events', query=query(f"{tbl}.event_data::json"), path=full_path) return _copy_table(table='events', query=query(f"{tbl}.event_data::jsonb"), path=full_path)
except UntranslatableCharacter: except UntranslatableCharacter:
return _copy_table(table='events', query=query(f"replace({tbl}.event_data::text, '\\u0000', '')::json"), path=full_path) return _copy_table(table='events', query=query(f"replace({tbl}.event_data::text, '\\u0000', '')::jsonb"), path=full_path)
@register('events_table', '1.3', format='csv', description=_('Automation task records'), expensive=four_hour_slicing) @register('events_table', '1.3', format='csv', description=_('Automation task records'), expensive=four_hour_slicing)

View File

@@ -90,7 +90,7 @@ def package(target, data, timestamp):
if isinstance(item, str): if isinstance(item, str):
f.add(item, arcname=f'./{name}') f.add(item, arcname=f'./{name}')
else: else:
buf = json.dumps(item).encode('utf-8') buf = json.dumps(item, cls=DjangoJSONEncoder).encode('utf-8')
info = tarfile.TarInfo(f'./{name}') info = tarfile.TarInfo(f'./{name}')
info.size = len(buf) info.size = len(buf)
info.mtime = timestamp.timestamp() info.mtime = timestamp.timestamp()
@@ -230,7 +230,7 @@ def gather(dest=None, module=None, subset=None, since=None, until=None, collecti
try: try:
last_entry = max(last_entries.get(key) or last_gather, until - timedelta(weeks=4)) last_entry = max(last_entries.get(key) or last_gather, until - timedelta(weeks=4))
results = (func(since or last_entry, collection_type=collection_type, until=until), func.__awx_analytics_version__) results = (func(since or last_entry, collection_type=collection_type, until=until), func.__awx_analytics_version__)
json.dumps(results) # throwaway check to see if the data is json-serializable json.dumps(results, cls=DjangoJSONEncoder) # throwaway check to see if the data is json-serializable
data[filename] = results data[filename] = results
except Exception: except Exception:
logger.exception("Could not generate metric {}".format(filename)) logger.exception("Could not generate metric {}".format(filename))

View File

@@ -160,6 +160,7 @@ class Metrics:
IntM('callback_receiver_batch_events_errors', 'Number of times batch insertion failed'), IntM('callback_receiver_batch_events_errors', 'Number of times batch insertion failed'),
FloatM('callback_receiver_events_insert_db_seconds', 'Time spent saving events to database'), FloatM('callback_receiver_events_insert_db_seconds', 'Time spent saving events to database'),
IntM('callback_receiver_events_insert_db', 'Number of events batch inserted into database'), IntM('callback_receiver_events_insert_db', 'Number of events batch inserted into database'),
IntM('callback_receiver_events_broadcast', 'Number of events broadcast to other control plane nodes'),
HistogramM( HistogramM(
'callback_receiver_batch_events_insert_db', 'Number of events batch inserted into database', settings.SUBSYSTEM_METRICS_BATCH_INSERT_BUCKETS 'callback_receiver_batch_events_insert_db', 'Number of events batch inserted into database', settings.SUBSYSTEM_METRICS_BATCH_INSERT_BUCKETS
), ),

View File

@@ -72,8 +72,8 @@ register(
'HTTP headers and meta keys to search to determine remote host ' 'HTTP headers and meta keys to search to determine remote host '
'name or IP. Add additional items to this list, such as ' 'name or IP. Add additional items to this list, such as '
'"HTTP_X_FORWARDED_FOR", if behind a reverse proxy. ' '"HTTP_X_FORWARDED_FOR", if behind a reverse proxy. '
'See the "Proxy Support" section of the Adminstrator guide for ' 'See the "Proxy Support" section of the AAP Installation guide '
'more details.' 'for more details.'
), ),
category=_('System'), category=_('System'),
category_slug='system', category_slug='system',
@@ -259,10 +259,14 @@ register(
register( register(
'AWX_ISOLATION_SHOW_PATHS', 'AWX_ISOLATION_SHOW_PATHS',
field_class=fields.StringListField, field_class=fields.StringListIsolatedPathField,
required=False, required=False,
label=_('Paths to expose to isolated jobs'), label=_('Paths to expose to isolated jobs'),
help_text=_('List of paths that would otherwise be hidden to expose to isolated jobs. Enter one path per line.'), help_text=_(
'List of paths that would otherwise be hidden to expose to isolated jobs. Enter one path per line. '
'Volumes will be mounted from the execution node to the container. '
'The supported format is HOST-DIR[:CONTAINER-DIR[:OPTIONS]]. '
),
category=_('Jobs'), category=_('Jobs'),
category_slug='jobs', category_slug='jobs',
) )
@@ -408,6 +412,21 @@ register(
unit=_('seconds'), unit=_('seconds'),
) )
register(
'DEFAULT_JOB_IDLE_TIMEOUT',
field_class=fields.IntegerField,
min_value=0,
default=0,
label=_('Default Job Idle Timeout'),
help_text=_(
'If no output is detected from ansible in this number of seconds the execution will be terminated. '
'Use value of 0 to used default idle_timeout is 600s.'
),
category=_('Jobs'),
category_slug='jobs',
unit=_('seconds'),
)
register( register(
'DEFAULT_INVENTORY_UPDATE_TIMEOUT', 'DEFAULT_INVENTORY_UPDATE_TIMEOUT',
field_class=fields.IntegerField, field_class=fields.IntegerField,
@@ -659,6 +678,24 @@ register(
category=_('Logging'), category=_('Logging'),
category_slug='logging', category_slug='logging',
) )
register(
'API_400_ERROR_LOG_FORMAT',
field_class=fields.CharField,
default='status {status_code} received by user {user_name} attempting to access {url_path} from {remote_addr}',
label=_('Log Format For API 4XX Errors'),
help_text=_(
'The format of logged messages when an API 4XX error occurs, '
'the following variables will be substituted: \n'
'status_code - The HTTP status code of the error\n'
'user_name - The user name attempting to use the API\n'
'url_path - The URL path to the API endpoint called\n'
'remote_addr - The remote address seen for the user\n'
'error - The error set by the api endpoint\n'
'Variables need to be in the format {<variable name>}.'
),
category=_('Logging'),
category_slug='logging',
)
register( register(
@@ -672,7 +709,7 @@ register(
register( register(
'AUTOMATION_ANALYTICS_LAST_ENTRIES', 'AUTOMATION_ANALYTICS_LAST_ENTRIES',
field_class=fields.CharField, field_class=fields.CharField,
label=_('Last gathered entries for expensive collectors for Insights for Ansible Automation Platform.'), label=_('Last gathered entries from the data collection service of Insights for Ansible Automation Platform'),
default='', default='',
allow_blank=True, allow_blank=True,
category=_('System'), category=_('System'),

View File

@@ -77,3 +77,18 @@ LOGGER_BLOCKLIST = (
# loggers that may be called getting logging settings # loggers that may be called getting logging settings
'awx.conf', 'awx.conf',
) )
# Reported version for node seen in receptor mesh but for which capacity check
# failed or is in progress
RECEPTOR_PENDING = 'ansible-runner-???'
# Naming pattern for AWX jobs in /tmp folder, like /tmp/awx_42_xiwm
# also update awxkit.api.pages.unified_jobs if changed
JOB_FOLDER_PREFIX = 'awx_%s_'
# :z option tells Podman that two containers share the volume content with r/w
# :O option tells Podman to mount the directory from the host as a temporary storage using the overlay file system.
# see podman-run manpage for further details
# /HOST-DIR:/CONTAINER-DIR:OPTIONS
CONTAINER_VOLUMES_MOUNT_TYPES = ['z', 'O']
MAX_ISOLATED_PATH_COLON_DELIMITER = 2

View File

@@ -0,0 +1,59 @@
from .plugin import CredentialPlugin
from django.utils.translation import ugettext_lazy as _
from thycotic.secrets.server import PasswordGrantAuthorizer, SecretServer, ServerSecret
tss_inputs = {
'fields': [
{
'id': 'server_url',
'label': _('Secret Server URL'),
'help_text': _('The Base URL of Secret Server e.g. https://myserver/SecretServer or https://mytenant.secretservercloud.com'),
'type': 'string',
},
{
'id': 'username',
'label': _('Username'),
'help_text': _('The (Application) user username'),
'type': 'string',
},
{
'id': 'password',
'label': _('Password'),
'help_text': _('The corresponding password'),
'type': 'string',
'secret': True,
},
],
'metadata': [
{
'id': 'secret_id',
'label': _('Secret ID'),
'help_text': _('The integer ID of the secret'),
'type': 'string',
},
{
'id': 'secret_field',
'label': _('Secret Field'),
'help_text': _('The field to extract from the secret'),
'type': 'string',
},
],
'required': ['server_url', 'username', 'password', 'secret_id', 'secret_field'],
}
def tss_backend(**kwargs):
authorizer = PasswordGrantAuthorizer(kwargs['server_url'], kwargs['username'], kwargs['password'])
secret_server = SecretServer(kwargs['server_url'], authorizer)
secret_dict = secret_server.get_secret(kwargs['secret_id'])
secret = ServerSecret(**secret_dict)
return secret.fields[kwargs['secret_field']]
tss_plugin = CredentialPlugin(
'Thycotic Secret Server',
tss_inputs,
tss_backend,
)

View File

@@ -22,6 +22,7 @@ import psutil
from awx.main.models import UnifiedJob from awx.main.models import UnifiedJob
from awx.main.dispatch import reaper from awx.main.dispatch import reaper
from awx.main.utils.common import convert_mem_str_to_bytes
if 'run_callback_receiver' in sys.argv: if 'run_callback_receiver' in sys.argv:
logger = logging.getLogger('awx.main.commands.run_callback_receiver') logger = logging.getLogger('awx.main.commands.run_callback_receiver')
@@ -248,7 +249,7 @@ class WorkerPool(object):
except Exception: except Exception:
logger.exception('could not fork') logger.exception('could not fork')
else: else:
logger.warn('scaling up worker pid:{}'.format(worker.pid)) logger.debug('scaling up worker pid:{}'.format(worker.pid))
return idx, worker return idx, worker
def debug(self, *args, **kwargs): def debug(self, *args, **kwargs):
@@ -319,7 +320,8 @@ class AutoscalePool(WorkerPool):
if self.max_workers is None: if self.max_workers is None:
settings_absmem = getattr(settings, 'SYSTEM_TASK_ABS_MEM', None) settings_absmem = getattr(settings, 'SYSTEM_TASK_ABS_MEM', None)
if settings_absmem is not None: if settings_absmem is not None:
total_memory_gb = int(settings_absmem) # There are 1073741824 bytes in a gigabyte. Convert bytes to gigabytes by dividing by 2**30
total_memory_gb = convert_mem_str_to_bytes(settings_absmem) // 2**30
else: else:
total_memory_gb = (psutil.virtual_memory().total >> 30) + 1 # noqa: round up total_memory_gb = (psutil.virtual_memory().total >> 30) + 1 # noqa: round up
# 5 workers per GB of total memory # 5 workers per GB of total memory
@@ -387,7 +389,7 @@ class AutoscalePool(WorkerPool):
# more processes in the pool than we need (> min) # more processes in the pool than we need (> min)
# send this process a message so it will exit gracefully # send this process a message so it will exit gracefully
# at the next opportunity # at the next opportunity
logger.warn('scaling down worker pid:{}'.format(w.pid)) logger.debug('scaling down worker pid:{}'.format(w.pid))
w.quit() w.quit()
self.workers.remove(w) self.workers.remove(w)
if w.alive: if w.alive:

View File

@@ -60,7 +60,7 @@ class AWXConsumerBase(object):
return f'listening on {self.queues}' return f'listening on {self.queues}'
def control(self, body): def control(self, body):
logger.warn(body) logger.warn(f'Received control signal:\n{body}')
control = body.get('control') control = body.get('control')
if control in ('status', 'running'): if control in ('status', 'running'):
reply_queue = body['reply_to'] reply_queue = body['reply_to']
@@ -137,7 +137,7 @@ class AWXConsumerPG(AWXConsumerBase):
def run(self, *args, **kwargs): def run(self, *args, **kwargs):
super(AWXConsumerPG, self).run(*args, **kwargs) super(AWXConsumerPG, self).run(*args, **kwargs)
logger.warn(f"Running worker {self.name} listening to queues {self.queues}") logger.info(f"Running worker {self.name} listening to queues {self.queues}")
init = False init = False
while True: while True:
@@ -188,7 +188,7 @@ class BaseWorker(object):
if 'uuid' in body: if 'uuid' in body:
uuid = body['uuid'] uuid = body['uuid']
finished.put(uuid) finished.put(uuid)
logger.warn('worker exiting gracefully pid:{}'.format(os.getpid())) logger.debug('worker exiting gracefully pid:{}'.format(os.getpid()))
def perform_work(self, body): def perform_work(self, body):
raise NotImplementedError() raise NotImplementedError()

View File

@@ -17,7 +17,7 @@ import redis
from awx.main.consumers import emit_channel_notification from awx.main.consumers import emit_channel_notification
from awx.main.models import JobEvent, AdHocCommandEvent, ProjectUpdateEvent, InventoryUpdateEvent, SystemJobEvent, UnifiedJob, Job from awx.main.models import JobEvent, AdHocCommandEvent, ProjectUpdateEvent, InventoryUpdateEvent, SystemJobEvent, UnifiedJob, Job
from awx.main.tasks import handle_success_and_failure_notifications from awx.main.tasks.system import handle_success_and_failure_notifications
from awx.main.models.events import emit_event_detail from awx.main.models.events import emit_event_detail
from awx.main.utils.profiling import AWXProfiler from awx.main.utils.profiling import AWXProfiler
import awx.main.analytics.subsystem_metrics as s_metrics import awx.main.analytics.subsystem_metrics as s_metrics
@@ -116,19 +116,20 @@ class CallbackBrokerWorker(BaseWorker):
def flush(self, force=False): def flush(self, force=False):
now = tz_now() now = tz_now()
if force or (time.time() - self.last_flush) > settings.JOB_EVENT_BUFFER_SECONDS or any([len(events) >= 1000 for events in self.buff.values()]): if force or (time.time() - self.last_flush) > settings.JOB_EVENT_BUFFER_SECONDS or any([len(events) >= 1000 for events in self.buff.values()]):
bulk_events_saved = 0 metrics_bulk_events_saved = 0
singular_events_saved = 0 metrics_singular_events_saved = 0
metrics_events_batch_save_errors = 0 metrics_events_batch_save_errors = 0
metrics_events_broadcast = 0
for cls, events in self.buff.items(): for cls, events in self.buff.items():
logger.debug(f'{cls.__name__}.objects.bulk_create({len(events)})') logger.debug(f'{cls.__name__}.objects.bulk_create({len(events)})')
for e in events: for e in events:
if not e.created: if not e.created:
e.created = now e.created = now
e.modified = now e.modified = now
duration_to_save = time.perf_counter() metrics_duration_to_save = time.perf_counter()
try: try:
cls.objects.bulk_create(events) cls.objects.bulk_create(events)
bulk_events_saved += len(events) metrics_bulk_events_saved += len(events)
except Exception: except Exception:
# if an exception occurs, we should re-attempt to save the # if an exception occurs, we should re-attempt to save the
# events one-by-one, because something in the list is # events one-by-one, because something in the list is
@@ -137,22 +138,24 @@ class CallbackBrokerWorker(BaseWorker):
for e in events: for e in events:
try: try:
e.save() e.save()
singular_events_saved += 1 metrics_singular_events_saved += 1
except Exception: except Exception:
logger.exception('Database Error Saving Job Event') logger.exception('Database Error Saving Job Event')
duration_to_save = time.perf_counter() - duration_to_save metrics_duration_to_save = time.perf_counter() - metrics_duration_to_save
for e in events: for e in events:
if not getattr(e, '_skip_websocket_message', False): if not getattr(e, '_skip_websocket_message', False):
metrics_events_broadcast += 1
emit_event_detail(e) emit_event_detail(e)
self.buff = {} self.buff = {}
self.last_flush = time.time() self.last_flush = time.time()
# only update metrics if we saved events # only update metrics if we saved events
if (bulk_events_saved + singular_events_saved) > 0: if (metrics_bulk_events_saved + metrics_singular_events_saved) > 0:
self.subsystem_metrics.inc('callback_receiver_batch_events_errors', metrics_events_batch_save_errors) self.subsystem_metrics.inc('callback_receiver_batch_events_errors', metrics_events_batch_save_errors)
self.subsystem_metrics.inc('callback_receiver_events_insert_db_seconds', duration_to_save) self.subsystem_metrics.inc('callback_receiver_events_insert_db_seconds', metrics_duration_to_save)
self.subsystem_metrics.inc('callback_receiver_events_insert_db', bulk_events_saved + singular_events_saved) self.subsystem_metrics.inc('callback_receiver_events_insert_db', metrics_bulk_events_saved + metrics_singular_events_saved)
self.subsystem_metrics.observe('callback_receiver_batch_events_insert_db', bulk_events_saved) self.subsystem_metrics.observe('callback_receiver_batch_events_insert_db', metrics_bulk_events_saved)
self.subsystem_metrics.inc('callback_receiver_events_in_memory', -(bulk_events_saved + singular_events_saved)) self.subsystem_metrics.inc('callback_receiver_events_in_memory', -(metrics_bulk_events_saved + metrics_singular_events_saved))
self.subsystem_metrics.inc('callback_receiver_events_broadcast', metrics_events_broadcast)
if self.subsystem_metrics.should_pipe_execute() is True: if self.subsystem_metrics.should_pipe_execute() is True:
self.subsystem_metrics.pipe_execute() self.subsystem_metrics.pipe_execute()

View File

@@ -9,7 +9,7 @@ from kubernetes.config import kube_config
from django.conf import settings from django.conf import settings
from django_guid.middleware import GuidMiddleware from django_guid.middleware import GuidMiddleware
from awx.main.tasks import dispatch_startup, inform_cluster_of_shutdown from awx.main.tasks.system import dispatch_startup, inform_cluster_of_shutdown
from .base import BaseWorker from .base import BaseWorker
@@ -30,8 +30,8 @@ class TaskWorker(BaseWorker):
""" """
Transform a dotted notation task into an imported, callable function, e.g., Transform a dotted notation task into an imported, callable function, e.g.,
awx.main.tasks.delete_inventory awx.main.tasks.system.delete_inventory
awx.main.tasks.RunProjectUpdate awx.main.tasks.jobs.RunProjectUpdate
""" """
if not task.startswith('awx.'): if not task.startswith('awx.'):
raise ValueError('{} is not a valid awx task'.format(task)) raise ValueError('{} is not a valid awx task'.format(task))
@@ -73,15 +73,15 @@ class TaskWorker(BaseWorker):
'callbacks': [{ 'callbacks': [{
'args': [], 'args': [],
'kwargs': {} 'kwargs': {}
'task': u'awx.main.tasks.handle_work_success' 'task': u'awx.main.tasks.system.handle_work_success'
}], }],
'errbacks': [{ 'errbacks': [{
'args': [], 'args': [],
'kwargs': {}, 'kwargs': {},
'task': 'awx.main.tasks.handle_work_error' 'task': 'awx.main.tasks.system.handle_work_error'
}], }],
'kwargs': {}, 'kwargs': {},
'task': u'awx.main.tasks.RunProjectUpdate' 'task': u'awx.main.tasks.jobs.RunProjectUpdate'
} }
""" """
settings.__clean_on_fork__() settings.__clean_on_fork__()

View File

@@ -36,3 +36,7 @@ class PostRunError(Exception):
self.status = status self.status = status
self.tb = tb self.tb = tb
super(PostRunError, self).__init__(msg) super(PostRunError, self).__init__(msg)
class ReceptorNodeNotFound(RuntimeError):
pass

View File

@@ -10,6 +10,6 @@ def is_ha_environment():
otherwise. otherwise.
""" """
# If there are two or more instances, then we are in an HA environment. # If there are two or more instances, then we are in an HA environment.
if Instance.objects.count() > 1: if Instance.objects.filter(node_type__in=('control', 'hybrid')).count() > 1:
return True return True
return False return False

View File

@@ -23,44 +23,54 @@ class Command(BaseCommand):
with impersonate(superuser): with impersonate(superuser):
with disable_computed_fields(): with disable_computed_fields():
if not Organization.objects.exists(): if not Organization.objects.exists():
o = Organization.objects.create(name='Default') o, _ = Organization.objects.get_or_create(name='Default')
p = Project( # Avoid calling directly the get_or_create() to bypass project update
name='Demo Project', p = Project.objects.filter(name='Demo Project', scm_type='git').first()
scm_type='git', if not p:
scm_url='https://github.com/ansible/ansible-tower-samples', p = Project(
scm_update_on_launch=True, name='Demo Project',
scm_update_cache_timeout=0, scm_type='git',
organization=o, scm_url='https://github.com/ansible/ansible-tower-samples',
) scm_update_on_launch=True,
scm_update_cache_timeout=0,
)
p.organization = o
p.save(skip_update=True) p.save(skip_update=True)
ssh_type = CredentialType.objects.filter(namespace='ssh').first() ssh_type = CredentialType.objects.filter(namespace='ssh').first()
c = Credential.objects.create( c, _ = Credential.objects.get_or_create(
credential_type=ssh_type, name='Demo Credential', inputs={'username': superuser.username}, created_by=superuser credential_type=ssh_type, name='Demo Credential', inputs={'username': superuser.username}, created_by=superuser
) )
c.admin_role.members.add(superuser) c.admin_role.members.add(superuser)
public_galaxy_credential = Credential( public_galaxy_credential, _ = Credential.objects.get_or_create(
name='Ansible Galaxy', name='Ansible Galaxy',
managed=True, managed=True,
credential_type=CredentialType.objects.get(kind='galaxy'), credential_type=CredentialType.objects.get(kind='galaxy'),
inputs={'url': 'https://galaxy.ansible.com/'}, inputs={'url': 'https://galaxy.ansible.com/'},
) )
public_galaxy_credential.save()
o.galaxy_credentials.add(public_galaxy_credential) o.galaxy_credentials.add(public_galaxy_credential)
i = Inventory.objects.create(name='Demo Inventory', organization=o, created_by=superuser) i, _ = Inventory.objects.get_or_create(name='Demo Inventory', organization=o, created_by=superuser)
Host.objects.create( Host.objects.get_or_create(
name='localhost', name='localhost',
inventory=i, inventory=i,
variables="ansible_connection: local\nansible_python_interpreter: '{{ ansible_playbook_python }}'", variables="ansible_connection: local\nansible_python_interpreter: '{{ ansible_playbook_python }}'",
created_by=superuser, created_by=superuser,
) )
jt = JobTemplate.objects.create(name='Demo Job Template', playbook='hello_world.yml', project=p, inventory=i) jt = JobTemplate.objects.filter(name='Demo Job Template').first()
if jt:
jt.project = p
jt.inventory = i
jt.playbook = 'hello_world.yml'
jt.save()
else:
jt, _ = JobTemplate.objects.get_or_create(name='Demo Job Template', playbook='hello_world.yml', project=p, inventory=i)
jt.credentials.add(c) jt.credentials.add(c)
print('Default organization added.') print('Default organization added.')

View File

@@ -10,6 +10,7 @@ import subprocess
import sys import sys
import time import time
import traceback import traceback
from collections import OrderedDict
# Django # Django
from django.conf import settings from django.conf import settings
@@ -75,7 +76,24 @@ class AnsibleInventoryLoader(object):
bargs.extend(['-v', '{0}:{0}:Z'.format(self.source)]) bargs.extend(['-v', '{0}:{0}:Z'.format(self.source)])
for key, value in STANDARD_INVENTORY_UPDATE_ENV.items(): for key, value in STANDARD_INVENTORY_UPDATE_ENV.items():
bargs.extend(['-e', '{0}={1}'.format(key, value)]) bargs.extend(['-e', '{0}={1}'.format(key, value)])
bargs.extend([get_default_execution_environment().image]) ee = get_default_execution_environment()
if settings.IS_K8S:
logger.warn('This command is not able to run on kubernetes-based deployment. This action should be done using the API.')
sys.exit(1)
if ee.credential:
process = subprocess.run(['podman', 'image', 'exists', ee.image], capture_output=True)
if process.returncode != 0:
logger.warn(
f'The default execution environment (id={ee.id}, name={ee.name}, image={ee.image}) is not available on this node. '
'The image needs to be available locally before using this command, due to registry authentication. '
'To pull this image, either run a job on this node or manually pull the image.'
)
sys.exit(1)
bargs.extend([ee.image])
bargs.extend(['ansible-inventory', '-i', self.source]) bargs.extend(['ansible-inventory', '-i', self.source])
bargs.extend(['--playbook-dir', functioning_dir(self.source)]) bargs.extend(['--playbook-dir', functioning_dir(self.source)])
if self.verbosity: if self.verbosity:
@@ -110,9 +128,7 @@ class AnsibleInventoryLoader(object):
def load(self): def load(self):
base_args = self.get_base_args() base_args = self.get_base_args()
logger.info('Reading Ansible inventory source: %s', self.source) logger.info('Reading Ansible inventory source: %s', self.source)
return self.command_to_json(base_args) return self.command_to_json(base_args)
@@ -137,7 +153,7 @@ class Command(BaseCommand):
type=str, type=str,
default=None, default=None,
metavar='v', metavar='v',
help='host variable used to ' 'set/clear enabled flag when host is online/offline, may ' 'be specified as "foo.bar" to traverse nested dicts.', help='host variable used to set/clear enabled flag when host is online/offline, may be specified as "foo.bar" to traverse nested dicts.',
) )
parser.add_argument( parser.add_argument(
'--enabled-value', '--enabled-value',
@@ -145,7 +161,7 @@ class Command(BaseCommand):
type=str, type=str,
default=None, default=None,
metavar='v', metavar='v',
help='value of host variable ' 'specified by --enabled-var that indicates host is ' 'enabled/online.', help='value of host variable specified by --enabled-var that indicates host is enabled/online.',
) )
parser.add_argument( parser.add_argument(
'--group-filter', '--group-filter',
@@ -153,7 +169,7 @@ class Command(BaseCommand):
type=str, type=str,
default=None, default=None,
metavar='regex', metavar='regex',
help='regular expression ' 'to filter group name(s); only matches are imported.', help='regular expression to filter group name(s); only matches are imported.',
) )
parser.add_argument( parser.add_argument(
'--host-filter', '--host-filter',
@@ -161,14 +177,14 @@ class Command(BaseCommand):
type=str, type=str,
default=None, default=None,
metavar='regex', metavar='regex',
help='regular expression ' 'to filter host name(s); only matches are imported.', help='regular expression to filter host name(s); only matches are imported.',
) )
parser.add_argument( parser.add_argument(
'--exclude-empty-groups', '--exclude-empty-groups',
dest='exclude_empty_groups', dest='exclude_empty_groups',
action='store_true', action='store_true',
default=False, default=False,
help='when set, ' 'exclude all groups that have no child groups, hosts, or ' 'variables.', help='when set, exclude all groups that have no child groups, hosts, or variables.',
) )
parser.add_argument( parser.add_argument(
'--instance-id-var', '--instance-id-var',
@@ -176,7 +192,7 @@ class Command(BaseCommand):
type=str, type=str,
default=None, default=None,
metavar='v', metavar='v',
help='host variable that ' 'specifies the unique, immutable instance ID, may be ' 'specified as "foo.bar" to traverse nested dicts.', help='host variable that specifies the unique, immutable instance ID, may be specified as "foo.bar" to traverse nested dicts.',
) )
def set_logging_level(self, verbosity): def set_logging_level(self, verbosity):
@@ -269,12 +285,13 @@ class Command(BaseCommand):
self.db_instance_id_map = {} self.db_instance_id_map = {}
if self.instance_id_var: if self.instance_id_var:
host_qs = self.inventory_source.hosts.all() host_qs = self.inventory_source.hosts.all()
host_qs = host_qs.filter(instance_id='', variables__contains=self.instance_id_var.split('.')[0]) for instance_id_part in reversed(self.instance_id_var.split(',')):
for host in host_qs: host_qs = host_qs.filter(instance_id='', variables__contains=instance_id_part.split('.')[0])
instance_id = self._get_instance_id(host.variables_dict) for host in host_qs:
if not instance_id: instance_id = self._get_instance_id(host.variables_dict)
continue if not instance_id:
self.db_instance_id_map[instance_id] = host.pk continue
self.db_instance_id_map[instance_id] = host.pk
def _build_mem_instance_id_map(self): def _build_mem_instance_id_map(self):
""" """
@@ -300,7 +317,7 @@ class Command(BaseCommand):
self._cached_host_pk_set = frozenset(self.inventory_source.hosts.values_list('pk', flat=True)) self._cached_host_pk_set = frozenset(self.inventory_source.hosts.values_list('pk', flat=True))
return self._cached_host_pk_set return self._cached_host_pk_set
def _delete_hosts(self): def _delete_hosts(self, pk_mem_host_map):
""" """
For each host in the database that is NOT in the local list, delete For each host in the database that is NOT in the local list, delete
it. When importing from a cloud inventory source attached to a it. When importing from a cloud inventory source attached to a
@@ -309,25 +326,10 @@ class Command(BaseCommand):
""" """
if settings.SQL_DEBUG: if settings.SQL_DEBUG:
queries_before = len(connection.queries) queries_before = len(connection.queries)
hosts_qs = self.inventory_source.hosts hosts_qs = self.inventory_source.hosts
# Build list of all host pks, remove all that should not be deleted. del_host_pks = hosts_qs.exclude(pk__in=pk_mem_host_map.keys()).values_list('pk', flat=True)
del_host_pks = set(self._existing_host_pks()) # makes mutable copy
if self.instance_id_var:
all_instance_ids = list(self.mem_instance_id_map.keys())
instance_ids = []
for offset in range(0, len(all_instance_ids), self._batch_size):
instance_ids = all_instance_ids[offset : (offset + self._batch_size)]
for host_pk in hosts_qs.filter(instance_id__in=instance_ids).values_list('pk', flat=True):
del_host_pks.discard(host_pk)
for host_pk in set([v for k, v in self.db_instance_id_map.items() if k in instance_ids]):
del_host_pks.discard(host_pk)
all_host_names = list(set(self.mem_instance_id_map.values()) - set(self.all_group.all_hosts.keys()))
else:
all_host_names = list(self.all_group.all_hosts.keys())
for offset in range(0, len(all_host_names), self._batch_size):
host_names = all_host_names[offset : (offset + self._batch_size)]
for host_pk in hosts_qs.filter(name__in=host_names).values_list('pk', flat=True):
del_host_pks.discard(host_pk)
# Now delete all remaining hosts in batches. # Now delete all remaining hosts in batches.
all_del_pks = sorted(list(del_host_pks)) all_del_pks = sorted(list(del_host_pks))
for offset in range(0, len(all_del_pks), self._batch_size): for offset in range(0, len(all_del_pks), self._batch_size):
@@ -568,7 +570,63 @@ class Command(BaseCommand):
logger.debug('Host "%s" is now disabled', mem_host.name) logger.debug('Host "%s" is now disabled', mem_host.name)
self._batch_add_m2m(self.inventory_source.hosts, db_host) self._batch_add_m2m(self.inventory_source.hosts, db_host)
def _create_update_hosts(self): def _build_pk_mem_host_map(self):
"""
Creates and returns a data structure that maps DB hosts to in-memory host that
they correspond to - meaning that those hosts will be updated to in-memory host values
"""
mem_host_pk_map = OrderedDict() # keys are mem_host name, values are matching DB host pk
host_pks_updated = set() # same as items of mem_host_pk_map but used for efficiency
mem_host_pk_map_by_id = {} # incomplete mapping by new instance_id to be sorted and pushed to mem_host_pk_map
mem_host_instance_id_map = {}
for k, v in self.all_group.all_hosts.items():
instance_id = self._get_instance_id(v.variables)
if instance_id in self.db_instance_id_map:
mem_host_pk_map_by_id[self.db_instance_id_map[instance_id]] = v
elif instance_id:
mem_host_instance_id_map[instance_id] = v
# Update all existing hosts where we know the PK based on instance_id.
all_host_pks = sorted(mem_host_pk_map_by_id.keys())
for offset in range(0, len(all_host_pks), self._batch_size):
host_pks = all_host_pks[offset : (offset + self._batch_size)]
for db_host in self.inventory.hosts.only('pk').filter(pk__in=host_pks):
if db_host.pk in host_pks_updated:
continue
mem_host = mem_host_pk_map_by_id[db_host.pk]
mem_host_pk_map[mem_host.name] = db_host.pk
host_pks_updated.add(db_host.pk)
# Update all existing hosts where we know the DB (the prior) instance_id.
all_instance_ids = sorted(mem_host_instance_id_map.keys())
for offset in range(0, len(all_instance_ids), self._batch_size):
instance_ids = all_instance_ids[offset : (offset + self._batch_size)]
for db_host in self.inventory.hosts.only('pk', 'instance_id').filter(instance_id__in=instance_ids):
if db_host.pk in host_pks_updated:
continue
mem_host = mem_host_instance_id_map[db_host.instance_id]
mem_host_pk_map[mem_host.name] = db_host.pk
host_pks_updated.add(db_host.pk)
# Update all existing hosts by name.
all_host_names = sorted(self.all_group.all_hosts.keys())
for offset in range(0, len(all_host_names), self._batch_size):
host_names = all_host_names[offset : (offset + self._batch_size)]
for db_host in self.inventory.hosts.only('pk', 'name').filter(name__in=host_names):
if db_host.pk in host_pks_updated:
continue
mem_host = self.all_group.all_hosts[db_host.name]
mem_host_pk_map[mem_host.name] = db_host.pk
host_pks_updated.add(db_host.pk)
# Rotate the dictionary so that lookups are done by the host pk
pk_mem_host_map = OrderedDict()
for name, host_pk in mem_host_pk_map.items():
pk_mem_host_map[host_pk] = name
return pk_mem_host_map # keys are DB host pk, keys are matching mem host name
def _create_update_hosts(self, pk_mem_host_map):
""" """
For each host in the local list, create it if it doesn't exist in the For each host in the local list, create it if it doesn't exist in the
database. Otherwise, update/replace database variables from the database. Otherwise, update/replace database variables from the
@@ -577,57 +635,22 @@ class Command(BaseCommand):
""" """
if settings.SQL_DEBUG: if settings.SQL_DEBUG:
queries_before = len(connection.queries) queries_before = len(connection.queries)
host_pks_updated = set()
mem_host_pk_map = {}
mem_host_instance_id_map = {}
mem_host_name_map = {}
mem_host_names_to_update = set(self.all_group.all_hosts.keys())
for k, v in self.all_group.all_hosts.items():
mem_host_name_map[k] = v
instance_id = self._get_instance_id(v.variables)
if instance_id in self.db_instance_id_map:
mem_host_pk_map[self.db_instance_id_map[instance_id]] = v
elif instance_id:
mem_host_instance_id_map[instance_id] = v
# Update all existing hosts where we know the PK based on instance_id. updated_mem_host_names = set()
all_host_pks = sorted(mem_host_pk_map.keys())
all_host_pks = sorted(pk_mem_host_map.keys())
for offset in range(0, len(all_host_pks), self._batch_size): for offset in range(0, len(all_host_pks), self._batch_size):
host_pks = all_host_pks[offset : (offset + self._batch_size)] host_pks = all_host_pks[offset : (offset + self._batch_size)]
for db_host in self.inventory.hosts.filter(pk__in=host_pks): for db_host in self.inventory.hosts.filter(pk__in=host_pks):
if db_host.pk in host_pks_updated: mem_host_name = pk_mem_host_map[db_host.pk]
continue mem_host = self.all_group.all_hosts[mem_host_name]
mem_host = mem_host_pk_map[db_host.pk]
self._update_db_host_from_mem_host(db_host, mem_host) self._update_db_host_from_mem_host(db_host, mem_host)
host_pks_updated.add(db_host.pk) updated_mem_host_names.add(mem_host.name)
mem_host_names_to_update.discard(mem_host.name)
# Update all existing hosts where we know the instance_id. mem_host_names_to_create = set(self.all_group.all_hosts.keys()) - updated_mem_host_names
all_instance_ids = sorted(mem_host_instance_id_map.keys())
for offset in range(0, len(all_instance_ids), self._batch_size):
instance_ids = all_instance_ids[offset : (offset + self._batch_size)]
for db_host in self.inventory.hosts.filter(instance_id__in=instance_ids):
if db_host.pk in host_pks_updated:
continue
mem_host = mem_host_instance_id_map[db_host.instance_id]
self._update_db_host_from_mem_host(db_host, mem_host)
host_pks_updated.add(db_host.pk)
mem_host_names_to_update.discard(mem_host.name)
# Update all existing hosts by name.
all_host_names = sorted(mem_host_name_map.keys())
for offset in range(0, len(all_host_names), self._batch_size):
host_names = all_host_names[offset : (offset + self._batch_size)]
for db_host in self.inventory.hosts.filter(name__in=host_names):
if db_host.pk in host_pks_updated:
continue
mem_host = mem_host_name_map[db_host.name]
self._update_db_host_from_mem_host(db_host, mem_host)
host_pks_updated.add(db_host.pk)
mem_host_names_to_update.discard(mem_host.name)
# Create any new hosts. # Create any new hosts.
for mem_host_name in sorted(mem_host_names_to_update): for mem_host_name in sorted(mem_host_names_to_create):
mem_host = self.all_group.all_hosts[mem_host_name] mem_host = self.all_group.all_hosts[mem_host_name]
import_vars = mem_host.variables import_vars = mem_host.variables
host_desc = import_vars.pop('_awx_description', 'imported') host_desc = import_vars.pop('_awx_description', 'imported')
@@ -726,13 +749,14 @@ class Command(BaseCommand):
self._batch_size = 500 self._batch_size = 500
self._build_db_instance_id_map() self._build_db_instance_id_map()
self._build_mem_instance_id_map() self._build_mem_instance_id_map()
pk_mem_host_map = self._build_pk_mem_host_map()
if self.overwrite: if self.overwrite:
self._delete_hosts() self._delete_hosts(pk_mem_host_map)
self._delete_groups() self._delete_groups()
self._delete_group_children_and_hosts() self._delete_group_children_and_hosts()
self._update_inventory() self._update_inventory()
self._create_update_groups() self._create_update_groups()
self._create_update_hosts() self._create_update_hosts(pk_mem_host_map)
self._create_update_group_children() self._create_update_group_children()
self._create_update_group_hosts() self._create_update_group_hosts()
@@ -1008,4 +1032,4 @@ class Command(BaseCommand):
if settings.SQL_DEBUG: if settings.SQL_DEBUG:
queries_this_import = connection.queries[queries_before:] queries_this_import = connection.queries[queries_before:]
sqltime = sum(float(x['time']) for x in queries_this_import) sqltime = sum(float(x['time']) for x in queries_this_import)
logger.warning('Inventory import required %d queries ' 'taking %0.3fs', len(queries_this_import), sqltime) logger.warning('Inventory import required %d queries taking %0.3fs', len(queries_this_import), sqltime)

View File

@@ -11,13 +11,16 @@ class Ungrouped(object):
policy_instance_percentage = None policy_instance_percentage = None
policy_instance_minimum = None policy_instance_minimum = None
def __init__(self):
self.qs = Instance.objects.filter(rampart_groups__isnull=True)
@property @property
def instances(self): def instances(self):
return Instance.objects.filter(rampart_groups__isnull=True) return self.qs
@property @property
def capacity(self): def capacity(self):
return sum(x.capacity for x in self.instances) return sum(x.capacity for x in self.instances.all())
class Command(BaseCommand): class Command(BaseCommand):
@@ -25,27 +28,33 @@ class Command(BaseCommand):
def handle(self, *args, **options): def handle(self, *args, **options):
super(Command, self).__init__() super(Command, self).__init__()
no_color = options.get("no_color", False)
groups = list(InstanceGroup.objects.all()) groups = list(InstanceGroup.objects.all())
ungrouped = Ungrouped() ungrouped = Ungrouped()
if len(ungrouped.instances): if len(ungrouped.instances.all()):
groups.append(ungrouped) groups.append(ungrouped)
for instance_group in groups: for ig in groups:
fmt = '[{0.name} capacity={0.capacity}' policy = ''
if instance_group.policy_instance_percentage: if ig.policy_instance_percentage:
fmt += ' policy={0.policy_instance_percentage}%' policy = f' policy={ig.policy_instance_percentage}%'
if instance_group.policy_instance_minimum: if ig.policy_instance_minimum:
fmt += ' policy>={0.policy_instance_minimum}' policy = f' policy>={ig.policy_instance_minimum}'
print((fmt + ']').format(instance_group)) print(f'[{ig.name} capacity={ig.capacity}{policy}]')
for x in instance_group.instances.all():
for x in ig.instances.all():
color = '\033[92m' color = '\033[92m'
if x.capacity == 0: if x.capacity == 0 and x.node_type != 'hop':
color = '\033[91m' color = '\033[91m'
if x.enabled is False: if not x.enabled:
color = '\033[90m[DISABLED] ' color = '\033[90m[DISABLED] '
fmt = '\t' + color + '{0.hostname} capacity={0.capacity} version={1}' if no_color:
if x.capacity: color = ''
fmt += ' heartbeat="{0.modified:%Y-%m-%d %H:%M:%S}"'
print((fmt + '\033[0m').format(x, x.version or '?')) capacity = f' capacity={x.capacity}' if x.node_type != 'hop' else ''
print('') version = f" version={x.version or '?'}" if x.node_type != 'hop' else ''
heartbeat = f' heartbeat="{x.modified:%Y-%m-%d %H:%M:%S}"' if x.capacity or x.node_type == 'hop' else ''
print(f'\t{color}{x.hostname}{capacity} node_type={x.node_type}{version}{heartbeat}\033[0m')
print()

View File

@@ -1,6 +1,6 @@
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from awx.main.tasks import profile_sql from awx.main.tasks.system import profile_sql
class Command(BaseCommand): class Command(BaseCommand):

View File

@@ -1,7 +1,6 @@
# Copyright (c) 2015 Ansible, Inc. # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved # All Rights Reserved
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from django.db import transaction from django.db import transaction
@@ -14,17 +13,19 @@ class Command(BaseCommand):
Register this instance with the database for HA tracking. Register this instance with the database for HA tracking.
""" """
help = 'Add instance to the database. ' 'Specify `--hostname` to use this command.' help = "Add instance to the database. Specify `--hostname` to use this command."
def add_arguments(self, parser): def add_arguments(self, parser):
parser.add_argument('--hostname', dest='hostname', type=str, help='Hostname used during provisioning') parser.add_argument('--hostname', dest='hostname', type=str, help="Hostname used during provisioning")
parser.add_argument('--node_type', type=str, default='hybrid', choices=['control', 'execution', 'hop', 'hybrid'], help="Instance Node type")
parser.add_argument('--uuid', type=str, help="Instance UUID")
def _register_hostname(self, hostname): def _register_hostname(self, hostname, node_type, uuid):
if not hostname: if not hostname:
return return
(changed, instance) = Instance.objects.register(uuid=self.uuid, hostname=hostname) (changed, instance) = Instance.objects.register(hostname=hostname, node_type=node_type, uuid=uuid)
if changed: if changed:
print('Successfully registered instance {}'.format(hostname)) print("Successfully registered instance {}".format(hostname))
else: else:
print("Instance already registered {}".format(instance.hostname)) print("Instance already registered {}".format(instance.hostname))
self.changed = changed self.changed = changed
@@ -33,8 +34,7 @@ class Command(BaseCommand):
def handle(self, **options): def handle(self, **options):
if not options.get('hostname'): if not options.get('hostname'):
raise CommandError("Specify `--hostname` to use this command.") raise CommandError("Specify `--hostname` to use this command.")
self.uuid = settings.SYSTEM_UUID
self.changed = False self.changed = False
self._register_hostname(options.get('hostname')) self._register_hostname(options.get('hostname'), options.get('node_type'), options.get('uuid'))
if self.changed: if self.changed:
print('(changed: True)') print("(changed: True)")

View File

@@ -0,0 +1,87 @@
import warnings
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from awx.main.models import Instance, InstanceLink
class Command(BaseCommand):
"""
Internal tower command.
Register the peers of a receptor node.
"""
help = "Register or remove links between Receptor nodes."
def add_arguments(self, parser):
parser.add_argument('source', type=str, help="Receptor node opening the connections.")
parser.add_argument('--peers', type=str, nargs='+', required=False, help="Nodes that the source node connects out to.")
parser.add_argument('--disconnect', type=str, nargs='+', required=False, help="Nodes that should no longer be connected to by the source node.")
parser.add_argument(
'--exact',
type=str,
nargs='*',
required=False,
help="The exact set of nodes the source node should connect out to. Any existing links registered in the database that do not match will be removed. May be empty.",
)
def handle(self, **options):
nodes = Instance.objects.in_bulk(field_name='hostname')
if options['source'] not in nodes:
raise CommandError(f"Host {options['source']} is not a registered instance.")
if not (options['peers'] or options['disconnect'] or options['exact'] is not None):
raise CommandError("One of the options --peers, --disconnect, or --exact is required.")
if options['exact'] is not None and options['peers']:
raise CommandError("The option --peers may not be used with --exact.")
if options['exact'] is not None and options['disconnect']:
raise CommandError("The option --disconnect may not be used with --exact.")
# No 1-cycles
for collection in ('peers', 'disconnect', 'exact'):
if options[collection] is not None and options['source'] in options[collection]:
raise CommandError(f"Source node {options['source']} may not also be in --{collection}.")
# No 2-cycles
if options['peers'] or options['exact'] is not None:
peers = set(options['peers'] or options['exact'])
incoming = set(InstanceLink.objects.filter(target=nodes[options['source']]).values_list('source__hostname', flat=True))
if peers & incoming:
warnings.warn(f"Source node {options['source']} should not link to nodes already peering to it: {peers & incoming}.")
if options['peers']:
missing_peers = set(options['peers']) - set(nodes)
if missing_peers:
missing = ' '.join(missing_peers)
raise CommandError(f"Peers not currently registered as instances: {missing}")
results = 0
for target in options['peers']:
_, created = InstanceLink.objects.get_or_create(source=nodes[options['source']], target=nodes[target])
if created:
results += 1
print(f"{results} new peer links added to the database.")
if options['disconnect']:
results = 0
for target in options['disconnect']:
if target not in nodes: # Be permissive, the node might have already been de-registered.
continue
n, _ = InstanceLink.objects.filter(source=nodes[options['source']], target=nodes[target]).delete()
results += n
print(f"{results} peer links removed from the database.")
if options['exact'] is not None:
additions = 0
with transaction.atomic():
peers = set(options['exact'])
links = set(InstanceLink.objects.filter(source=nodes[options['source']]).values_list('target__hostname', flat=True))
removals, _ = InstanceLink.objects.filter(source=nodes[options['source']], target__hostname__in=links - peers).delete()
for target in peers - links:
_, created = InstanceLink.objects.get_or_create(source=nodes[options['source']], target=nodes[target])
if created:
additions += 1
print(f"{additions} peer links added and {removals} deleted from the database.")

View File

@@ -17,13 +17,14 @@ class InstanceNotFound(Exception):
class RegisterQueue: class RegisterQueue:
def __init__(self, queuename, instance_percent, inst_min, hostname_list, is_container_group=None): def __init__(self, queuename, instance_percent, inst_min, hostname_list, is_container_group=None, pod_spec_override=None):
self.instance_not_found_err = None self.instance_not_found_err = None
self.queuename = queuename self.queuename = queuename
self.instance_percent = instance_percent self.instance_percent = instance_percent
self.instance_min = inst_min self.instance_min = inst_min
self.hostname_list = hostname_list self.hostname_list = hostname_list
self.is_container_group = is_container_group self.is_container_group = is_container_group
self.pod_spec_override = pod_spec_override
def get_create_update_instance_group(self): def get_create_update_instance_group(self):
created = False created = False
@@ -36,10 +37,14 @@ class RegisterQueue:
ig.policy_instance_minimum = self.instance_min ig.policy_instance_minimum = self.instance_min
changed = True changed = True
if self.is_container_group: if self.is_container_group and (ig.is_container_group != self.is_container_group):
ig.is_container_group = self.is_container_group ig.is_container_group = self.is_container_group
changed = True changed = True
if self.pod_spec_override and (ig.pod_spec_override != self.pod_spec_override):
ig.pod_spec_override = self.pod_spec_override
changed = True
if changed: if changed:
ig.save() ig.save()
@@ -48,14 +53,14 @@ class RegisterQueue:
def add_instances_to_group(self, ig): def add_instances_to_group(self, ig):
changed = False changed = False
instance_list_unique = set([x.strip() for x in self.hostname_list if x]) instance_list_unique = {x for x in (x.strip() for x in self.hostname_list) if x}
instances = [] instances = []
for inst_name in instance_list_unique: for inst_name in instance_list_unique:
instance = Instance.objects.filter(hostname=inst_name) instance = Instance.objects.filter(hostname=inst_name).exclude(node_type='hop')
if instance.exists(): if instance.exists():
instances.append(instance[0]) instances.append(instance[0])
else: else:
raise InstanceNotFound("Instance does not exist: {}".format(inst_name), changed) raise InstanceNotFound("Instance does not exist or cannot run jobs: {}".format(inst_name), changed)
ig.instances.add(*instances) ig.instances.add(*instances)

View File

@@ -97,27 +97,29 @@ class Command(BaseCommand):
executor = MigrationExecutor(connection) executor = MigrationExecutor(connection)
migrating = bool(executor.migration_plan(executor.loader.graph.leaf_nodes())) migrating = bool(executor.migration_plan(executor.loader.graph.leaf_nodes()))
registered = False
if not migrating: # In containerized deployments, migrations happen in the task container,
try: # and the services running there don't start until migrations are
Instance.objects.me() # finished.
registered = True # *This* service runs in the web container, and it's possible that it can
except RuntimeError: # start _before_ migrations are finished, thus causing issues with the ORM
pass # queries it makes (specifically, conf.settings queries).
# This block is meant to serve as a sort of bail-out for the situation
# where migrations aren't yet finished (similar to the migration
# detection middleware that the uwsgi processes have) or when instance
# registration isn't done yet
if migrating:
logger.info('AWX is currently migrating, retry in 10s...')
time.sleep(10)
return
if migrating or not registered: try:
# In containerized deployments, migrations happen in the task container, me = Instance.objects.me()
# and the services running there don't start until migrations are logger.info('Active instance with hostname {} is registered.'.format(me.hostname))
# finished. except RuntimeError as e:
# *This* service runs in the web container, and it's possible that it can # the CLUSTER_HOST_ID in the task, and web instance must match and
# start _before_ migrations are finished, thus causing issues with the ORM # ensure network connectivity between the task and web instance
# queries it makes (specifically, conf.settings queries). logger.info('Unable to return currently active instance: {}, retry in 5s...'.format(e))
# This block is meant to serve as a sort of bail-out for the situation
# where migrations aren't yet finished (similar to the migration
# detection middleware that the uwsgi processes have) or when instance
# registration isn't done yet
logger.error('AWX is currently installing/upgrading. Trying again in 5s...')
time.sleep(5) time.sleep(5)
return return

View File

@@ -4,16 +4,18 @@
import sys import sys
import logging import logging
import os import os
from django.db import models from django.db import models
from django.conf import settings from django.conf import settings
from awx.main.utils.filters import SmartFilter from awx.main.utils.filters import SmartFilter
from awx.main.utils.pglock import advisory_lock from awx.main.utils.pglock import advisory_lock
from awx.main.utils.common import get_capacity_type
from awx.main.constants import RECEPTOR_PENDING
___all__ = ['HostManager', 'InstanceManager', 'InstanceGroupManager', 'DeferJobCreatedManager'] ___all__ = ['HostManager', 'InstanceManager', 'InstanceGroupManager', 'DeferJobCreatedManager', 'UUID_DEFAULT']
logger = logging.getLogger('awx.main.managers') logger = logging.getLogger('awx.main.managers')
UUID_DEFAULT = '00000000-0000-0000-0000-000000000000'
class DeferJobCreatedManager(models.Manager): class DeferJobCreatedManager(models.Manager):
@@ -104,18 +106,17 @@ class InstanceManager(models.Manager):
"""Return the currently active instance.""" """Return the currently active instance."""
# If we are running unit tests, return a stub record. # If we are running unit tests, return a stub record.
if settings.IS_TESTING(sys.argv) or hasattr(sys, '_called_from_test'): if settings.IS_TESTING(sys.argv) or hasattr(sys, '_called_from_test'):
return self.model(id=1, hostname='localhost', uuid='00000000-0000-0000-0000-000000000000') return self.model(id=1, hostname=settings.CLUSTER_HOST_ID, uuid=UUID_DEFAULT)
node = self.filter(hostname=settings.CLUSTER_HOST_ID) node = self.filter(hostname=settings.CLUSTER_HOST_ID)
if node.exists(): if node.exists():
return node[0] return node[0]
raise RuntimeError("No instance found with the current cluster host id") raise RuntimeError("No instance found with the current cluster host id")
def register(self, uuid=None, hostname=None, ip_address=None): def register(self, uuid=None, hostname=None, ip_address=None, node_type='hybrid', defaults=None):
if not uuid:
uuid = settings.SYSTEM_UUID
if not hostname: if not hostname:
hostname = settings.CLUSTER_HOST_ID hostname = settings.CLUSTER_HOST_ID
with advisory_lock('instance_registration_%s' % hostname): with advisory_lock('instance_registration_%s' % hostname):
if settings.AWX_AUTO_DEPROVISION_INSTANCES: if settings.AWX_AUTO_DEPROVISION_INSTANCES:
# detect any instances with the same IP address. # detect any instances with the same IP address.
@@ -128,16 +129,44 @@ class InstanceManager(models.Manager):
other_inst.save(update_fields=['ip_address']) other_inst.save(update_fields=['ip_address'])
logger.warning("IP address {0} conflict detected, ip address unset for host {1}.".format(ip_address, other_hostname)) logger.warning("IP address {0} conflict detected, ip address unset for host {1}.".format(ip_address, other_hostname))
instance = self.filter(hostname=hostname) # Return existing instance that matches hostname or UUID (default to UUID)
if uuid is not None and uuid != UUID_DEFAULT and self.filter(uuid=uuid).exists():
instance = self.filter(uuid=uuid)
else:
# if instance was not retrieved by uuid and hostname was, use the hostname
instance = self.filter(hostname=hostname)
# Return existing instance
if instance.exists(): if instance.exists():
instance = instance.get() instance = instance.first() # in the unusual occasion that there is more than one, only get one
update_fields = []
# if instance was retrieved by uuid and hostname has changed, update hostname
if instance.hostname != hostname:
logger.warning("passed in hostname {0} is different from the original hostname {1}, updating to {0}".format(hostname, instance.hostname))
instance.hostname = hostname
update_fields.append('hostname')
# if any other fields are to be updated
if instance.ip_address != ip_address: if instance.ip_address != ip_address:
instance.ip_address = ip_address instance.ip_address = ip_address
instance.save(update_fields=['ip_address']) if instance.node_type != node_type:
instance.node_type = node_type
update_fields.append('node_type')
if update_fields:
instance.save(update_fields=update_fields)
return (True, instance) return (True, instance)
else: else:
return (False, instance) return (False, instance)
instance = self.create(uuid=uuid, hostname=hostname, ip_address=ip_address, capacity=0)
# Create new instance, and fill in default values
create_defaults = dict(capacity=0)
if defaults is not None:
create_defaults.update(defaults)
uuid_option = {}
if uuid is not None:
uuid_option = dict(uuid=uuid)
if node_type == 'execution' and 'version' not in create_defaults:
create_defaults['version'] = RECEPTOR_PENDING
instance = self.create(hostname=hostname, ip_address=ip_address, node_type=node_type, **create_defaults, **uuid_option)
return (True, instance) return (True, instance)
def get_or_register(self): def get_or_register(self):
@@ -145,17 +174,18 @@ class InstanceManager(models.Manager):
from awx.main.management.commands.register_queue import RegisterQueue from awx.main.management.commands.register_queue import RegisterQueue
pod_ip = os.environ.get('MY_POD_IP') pod_ip = os.environ.get('MY_POD_IP')
registered = self.register(ip_address=pod_ip) if settings.IS_K8S:
registered = self.register(ip_address=pod_ip, node_type='control', uuid=settings.SYSTEM_UUID)
else:
registered = self.register(ip_address=pod_ip, uuid=settings.SYSTEM_UUID)
RegisterQueue(settings.DEFAULT_CONTROL_PLANE_QUEUE_NAME, 100, 0, [], is_container_group=False).register() RegisterQueue(settings.DEFAULT_CONTROL_PLANE_QUEUE_NAME, 100, 0, [], is_container_group=False).register()
RegisterQueue(settings.DEFAULT_EXECUTION_QUEUE_NAME, 100, 0, [], is_container_group=True).register() RegisterQueue(
settings.DEFAULT_EXECUTION_QUEUE_NAME, 100, 0, [], is_container_group=True, pod_spec_override=settings.DEFAULT_EXECUTION_QUEUE_POD_SPEC_OVERRIDE
).register()
return registered return registered
else: else:
return (False, self.me()) return (False, self.me())
def active_count(self):
"""Return count of active Tower nodes for licensing."""
return self.all().count()
class InstanceGroupManager(models.Manager): class InstanceGroupManager(models.Manager):
"""A custom manager class for the Instance model. """A custom manager class for the Instance model.
@@ -189,6 +219,8 @@ class InstanceGroupManager(models.Manager):
if name not in graph: if name not in graph:
graph[name] = {} graph[name] = {}
graph[name]['consumed_capacity'] = 0 graph[name]['consumed_capacity'] = 0
for capacity_type in ('execution', 'control'):
graph[name][f'consumed_{capacity_type}_capacity'] = 0
if breakdown: if breakdown:
graph[name]['committed_capacity'] = 0 graph[name]['committed_capacity'] = 0
graph[name]['running_capacity'] = 0 graph[name]['running_capacity'] = 0
@@ -211,7 +243,13 @@ class InstanceGroupManager(models.Manager):
for t in tasks: for t in tasks:
# TODO: dock capacity for isolated job management tasks running in queue # TODO: dock capacity for isolated job management tasks running in queue
impact = t.task_impact impact = t.task_impact
if t.status == 'waiting' or not t.execution_node: control_groups = []
if t.controller_node:
control_groups = instance_ig_mapping.get(t.controller_node, [])
if not control_groups:
logger.warn(f"No instance group found for {t.controller_node}, capacity consumed may be innaccurate.")
if t.status == 'waiting' or (not t.execution_node and not t.is_container_group_task):
# Subtract capacity from any peer groups that share instances # Subtract capacity from any peer groups that share instances
if not t.instance_group: if not t.instance_group:
impacted_groups = [] impacted_groups = []
@@ -224,8 +262,16 @@ class InstanceGroupManager(models.Manager):
if group_name not in graph: if group_name not in graph:
self.zero_out_group(graph, group_name, breakdown) self.zero_out_group(graph, group_name, breakdown)
graph[group_name]['consumed_capacity'] += impact graph[group_name]['consumed_capacity'] += impact
capacity_type = get_capacity_type(t)
graph[group_name][f'consumed_{capacity_type}_capacity'] += impact
if breakdown: if breakdown:
graph[group_name]['committed_capacity'] += impact graph[group_name]['committed_capacity'] += impact
for group_name in control_groups:
if group_name not in graph:
self.zero_out_group(graph, group_name, breakdown)
graph[group_name][f'consumed_control_capacity'] += settings.AWX_CONTROL_NODE_TASK_IMPACT
if breakdown:
graph[group_name]['committed_capacity'] += settings.AWX_CONTROL_NODE_TASK_IMPACT
elif t.status == 'running': elif t.status == 'running':
# Subtract capacity from all groups that contain the instance # Subtract capacity from all groups that contain the instance
if t.execution_node not in instance_ig_mapping: if t.execution_node not in instance_ig_mapping:
@@ -237,12 +283,21 @@ class InstanceGroupManager(models.Manager):
impacted_groups = [] impacted_groups = []
else: else:
impacted_groups = instance_ig_mapping[t.execution_node] impacted_groups = instance_ig_mapping[t.execution_node]
for group_name in impacted_groups: for group_name in impacted_groups:
if group_name not in graph: if group_name not in graph:
self.zero_out_group(graph, group_name, breakdown) self.zero_out_group(graph, group_name, breakdown)
graph[group_name]['consumed_capacity'] += impact graph[group_name]['consumed_capacity'] += impact
capacity_type = get_capacity_type(t)
graph[group_name][f'consumed_{capacity_type}_capacity'] += impact
if breakdown: if breakdown:
graph[group_name]['running_capacity'] += impact graph[group_name]['running_capacity'] += impact
for group_name in control_groups:
if group_name not in graph:
self.zero_out_group(graph, group_name, breakdown)
graph[group_name][f'consumed_control_capacity'] += settings.AWX_CONTROL_NODE_TASK_IMPACT
if breakdown:
graph[group_name]['running_capacity'] += settings.AWX_CONTROL_NODE_TASK_IMPACT
else: else:
logger.error('Programming error, %s not in ["running", "waiting"]', t.log_format) logger.error('Programming error, %s not in ["running", "waiting"]', t.log_format)
return graph return graph

View File

@@ -180,11 +180,7 @@ class URLModificationMiddleware(MiddlewareMixin):
return '/'.join(url_units) return '/'.join(url_units)
def process_request(self, request): def process_request(self, request):
if hasattr(request, 'environ') and 'REQUEST_URI' in request.environ: old_path = request.path_info
old_path = urllib.parse.urlsplit(request.environ['REQUEST_URI']).path
old_path = old_path[request.path.find(request.path_info) :]
else:
old_path = request.path_info
new_path = self._convert_named_url(old_path) new_path = self._convert_named_url(old_path)
if request.path_info != new_path: if request.path_info != new_path:
request.environ['awx.named_url_rewritten'] = request.path request.environ['awx.named_url_rewritten'] = request.path
@@ -197,4 +193,4 @@ class MigrationRanCheckMiddleware(MiddlewareMixin):
executor = MigrationExecutor(connection) executor = MigrationExecutor(connection)
plan = executor.migration_plan(executor.loader.graph.leaf_nodes()) plan = executor.migration_plan(executor.loader.graph.leaf_nodes())
if bool(plan) and getattr(resolve(request.path), 'url_name', '') != 'migrations_notran': if bool(plan) and getattr(resolve(request.path), 'url_name', '') != 'migrations_notran':
return redirect(reverse("ui_next:migrations_notran")) return redirect(reverse("ui:migrations_notran"))

View File

@@ -5,10 +5,6 @@ from __future__ import unicode_literals
# Django # Django
from django.db import migrations from django.db import migrations
# AWX
from awx.main.migrations import _migration_utils as migration_utils
from awx.main.migrations._reencrypt import blank_old_start_args
class Migration(migrations.Migration): class Migration(migrations.Migration):
@@ -17,6 +13,8 @@ class Migration(migrations.Migration):
] ]
operations = [ operations = [
migrations.RunPython(migration_utils.set_current_apps_for_migrations, migrations.RunPython.noop), # This list is intentionally empty.
migrations.RunPython(blank_old_start_args, migrations.RunPython.noop), # Tower 3.3 included several data migrations that are no longer
# necessary (this list is now empty because Tower 3.3 is past EOL and
# cannot be directly upgraded to modern versions)
] ]

View File

@@ -9,15 +9,6 @@ def remove_iso_instances(apps, schema_editor):
Instance.objects.filter(rampart_groups__controller__isnull=False).delete() Instance.objects.filter(rampart_groups__controller__isnull=False).delete()
def remove_iso_groups(apps, schema_editor):
InstanceGroup = apps.get_model('main', 'InstanceGroup')
UnifiedJob = apps.get_model('main', 'UnifiedJob')
with transaction.atomic():
for ig in InstanceGroup.objects.filter(controller__isnull=False):
UnifiedJob.objects.filter(instance_group=ig).update(instance_group=None)
ig.delete()
class Migration(migrations.Migration): class Migration(migrations.Migration):
atomic = False atomic = False
@@ -27,7 +18,6 @@ class Migration(migrations.Migration):
operations = [ operations = [
migrations.RunPython(remove_iso_instances), migrations.RunPython(remove_iso_instances),
migrations.RunPython(remove_iso_groups),
migrations.RemoveField( migrations.RemoveField(
model_name='instance', model_name='instance',
name='last_isolated_check', name='last_isolated_check',

View File

@@ -0,0 +1,22 @@
# Generated by Django 2.2.20 on 2021-07-26 19:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0151_rename_managed_by_tower'),
]
operations = [
migrations.AddField(
model_name='instance',
name='node_type',
field=models.CharField(
choices=[('control', 'Control plane node'), ('execution', 'Execution plane node'), ('hybrid', 'Controller and execution')],
default='hybrid',
max_length=16,
),
),
]

View File

@@ -0,0 +1,27 @@
# Generated by Django 2.2.20 on 2021-08-12 13:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0152_instance_node_type'),
]
operations = [
migrations.AddField(
model_name='instance',
name='last_seen',
field=models.DateTimeField(
editable=False,
help_text='Last time instance ran its heartbeat task for main cluster nodes. Last known connection to receptor mesh for execution nodes.',
null=True,
),
),
migrations.AlterField(
model_name='instance',
name='memory',
field=models.BigIntegerField(default=0, editable=False, help_text='Total system memory of this instance in bytes.'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 2.2.20 on 2021-09-01 22:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0153_instance_last_seen'),
]
operations = [
migrations.AlterField(
model_name='instance',
name='uuid',
field=models.CharField(default='00000000-0000-0000-0000-000000000000', max_length=40),
),
]

View File

@@ -0,0 +1,25 @@
# Generated by Django 2.2.20 on 2021-08-31 17:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0154_set_default_uuid'),
]
operations = [
migrations.AddField(
model_name='instance',
name='errors',
field=models.TextField(blank=True, default='', editable=False, help_text='Any error details from the last health check.'),
),
migrations.AddField(
model_name='instance',
name='last_health_check',
field=models.DateTimeField(
editable=False, help_text='Last time a health check was ran on this instance to refresh cpu, memory, and capacity.', null=True
),
),
]

View File

@@ -0,0 +1,44 @@
# Generated by Django 2.2.20 on 2021-12-17 19:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('main', '0155_improved_health_check'),
]
operations = [
migrations.AlterField(
model_name='instance',
name='node_type',
field=models.CharField(
choices=[
('control', 'Control plane node'),
('execution', 'Execution plane node'),
('hybrid', 'Controller and execution'),
('hop', 'Message-passing node, no execution capability'),
],
default='hybrid',
max_length=16,
),
),
migrations.CreateModel(
name='InstanceLink',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='main.Instance')),
('target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reverse_peers', to='main.Instance')),
],
options={
'unique_together': {('source', 'target')},
},
),
migrations.AddField(
model_name='instance',
name='peers',
field=models.ManyToManyField(through='main.InstanceLink', to='main.Instance'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 2.2.20 on 2022-01-18 16:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0156_capture_mesh_topology'),
]
operations = [
migrations.AddField(
model_name='inventory',
name='labels',
field=models.ManyToManyField(blank=True, help_text='Labels associated with this inventory.', related_name='inventory_labels', to='main.Label'),
),
]

View File

@@ -0,0 +1,19 @@
# Generated by Django 2.2.24 on 2022-02-14 17:37
from decimal import Decimal
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0157_inventory_labels'),
]
operations = [
migrations.AlterField(
model_name='instance',
name='cpu',
field=models.DecimalField(decimal_places=1, default=Decimal('0'), editable=False, max_digits=4),
),
]

View File

@@ -1,26 +0,0 @@
import logging
from awx.conf.migrations._reencrypt import (
decrypt_field,
)
logger = logging.getLogger('awx.main.migrations')
__all__ = []
def blank_old_start_args(apps, schema_editor):
UnifiedJob = apps.get_model('main', 'UnifiedJob')
for uj in UnifiedJob.objects.defer('result_stdout_text').exclude(start_args='').iterator():
if uj.status in ['running', 'pending', 'new', 'waiting']:
continue
try:
args_dict = decrypt_field(uj, 'start_args')
except ValueError:
args_dict = None
if args_dict == {}:
continue
if uj.start_args:
logger.debug('Blanking job args for %s', uj.pk)
uj.start_args = ''
uj.save()

View File

@@ -47,6 +47,7 @@ from awx.main.models.execution_environments import ExecutionEnvironment # noqa
from awx.main.models.activity_stream import ActivityStream # noqa from awx.main.models.activity_stream import ActivityStream # noqa
from awx.main.models.ha import ( # noqa from awx.main.models.ha import ( # noqa
Instance, Instance,
InstanceLink,
InstanceGroup, InstanceGroup,
TowerScheduleState, TowerScheduleState,
) )
@@ -201,6 +202,8 @@ activity_stream_registrar.connect(Organization)
activity_stream_registrar.connect(Inventory) activity_stream_registrar.connect(Inventory)
activity_stream_registrar.connect(Host) activity_stream_registrar.connect(Host)
activity_stream_registrar.connect(Group) activity_stream_registrar.connect(Group)
activity_stream_registrar.connect(Instance)
activity_stream_registrar.connect(InstanceGroup)
activity_stream_registrar.connect(InventorySource) activity_stream_registrar.connect(InventorySource)
# activity_stream_registrar.connect(InventoryUpdate) # activity_stream_registrar.connect(InventoryUpdate)
activity_stream_registrar.connect(Credential) activity_stream_registrar.connect(Credential)

View File

@@ -144,7 +144,7 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin):
@classmethod @classmethod
def _get_task_class(cls): def _get_task_class(cls):
from awx.main.tasks import RunAdHocCommand from awx.main.tasks.jobs import RunAdHocCommand
return RunAdHocCommand return RunAdHocCommand
@@ -152,10 +152,6 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin):
def is_container_group_task(self): def is_container_group_task(self):
return bool(self.instance_group and self.instance_group.is_container_group) return bool(self.instance_group and self.instance_group.is_container_group)
@property
def can_run_containerized(self):
return True
def get_absolute_url(self, request=None): def get_absolute_url(self, request=None):
return reverse('api:ad_hoc_command_detail', kwargs={'pk': self.pk}, request=request) return reverse('api:ad_hoc_command_detail', kwargs={'pk': self.pk}, request=request)
@@ -164,9 +160,7 @@ class AdHocCommand(UnifiedJob, JobNotificationMixin):
@property @property
def notification_templates(self): def notification_templates(self):
all_orgs = set() all_orgs = {h.inventory.organization for h in self.hosts.all()}
for h in self.hosts.all():
all_orgs.add(h.inventory.organization)
active_templates = dict(error=set(), success=set(), started=set()) active_templates = dict(error=set(), success=set(), started=set())
base_notification_templates = NotificationTemplate.objects base_notification_templates = NotificationTemplate.objects
for org in all_orgs: for org in all_orgs:

View File

@@ -299,10 +299,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
def has_inputs(self, field_names=()): def has_inputs(self, field_names=()):
for name in field_names: for name in field_names:
if name in self.inputs: if not self.has_input(name):
if self.inputs[name] in ('', None):
return False
else:
raise ValueError('{} is not an input field'.format(name)) raise ValueError('{} is not an input field'.format(name))
return True return True
@@ -1118,6 +1115,7 @@ ManagedCredentialType(
'label': ugettext_noop('Authentication URL'), 'label': ugettext_noop('Authentication URL'),
'type': 'string', 'type': 'string',
'help_text': ugettext_noop('Authentication endpoint for the container registry.'), 'help_text': ugettext_noop('Authentication endpoint for the container registry.'),
'default': 'quay.io',
}, },
{ {
'id': 'username', 'id': 'username',

View File

@@ -388,7 +388,7 @@ class BasePlaybookEvent(CreatedModifiedModel):
job.get_event_queryset().filter(uuid__in=failed).update(failed=True) job.get_event_queryset().filter(uuid__in=failed).update(failed=True)
# send success/failure notifications when we've finished handling the playbook_on_stats event # send success/failure notifications when we've finished handling the playbook_on_stats event
from awx.main.tasks import handle_success_and_failure_notifications # circular import from awx.main.tasks.system import handle_success_and_failure_notifications # circular import
def _send_notifications(): def _send_notifications():
handle_success_and_failure_notifications.apply_async([job.id]) handle_success_and_failure_notifications.apply_async([job.id])
@@ -541,8 +541,7 @@ class JobEvent(BasePlaybookEvent):
return return
job = self.job job = self.job
from awx.main.models import Host, JobHostSummary # circular import from awx.main.models import Host, JobHostSummary, HostMetric # circular import
from awx.main.models import Host, JobHostSummary, HostMetric
all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id', 'name') all_hosts = Host.objects.filter(pk__in=self.host_map.values()).only('id', 'name')
existing_host_ids = set(h.id for h in all_hosts) existing_host_ids = set(h.id for h in all_hosts)

View File

@@ -2,6 +2,8 @@
# All Rights Reserved. # All Rights Reserved.
from decimal import Decimal from decimal import Decimal
import random
import logging
from django.core.validators import MinValueValidator from django.core.validators import MinValueValidator
from django.db import models, connection from django.db import models, connection
@@ -16,14 +18,20 @@ from solo.models import SingletonModel
from awx import __version__ as awx_application_version from awx import __version__ as awx_application_version
from awx.api.versioning import reverse from awx.api.versioning import reverse
from awx.main.managers import InstanceManager, InstanceGroupManager from awx.main.managers import InstanceManager, InstanceGroupManager, UUID_DEFAULT
from awx.main.fields import JSONField from awx.main.fields import JSONField
from awx.main.constants import JOB_FOLDER_PREFIX
from awx.main.models.base import BaseModel, HasEditsMixin, prevent_search from awx.main.models.base import BaseModel, HasEditsMixin, prevent_search
from awx.main.models.unified_jobs import UnifiedJob from awx.main.models.unified_jobs import UnifiedJob
from awx.main.utils import get_cpu_capacity, get_mem_capacity, get_system_task_capacity from awx.main.utils.common import get_corrected_cpu, get_cpu_effective_capacity, get_corrected_memory, get_mem_effective_capacity
from awx.main.models.mixins import RelatedJobsMixin from awx.main.models.mixins import RelatedJobsMixin
__all__ = ('Instance', 'InstanceGroup', 'TowerScheduleState') # ansible-runner
from ansible_runner.utils.capacity import get_cpu_count, get_mem_in_bytes
__all__ = ('Instance', 'InstanceGroup', 'InstanceLink', 'TowerScheduleState')
logger = logging.getLogger('awx.main.models.ha')
class HasPolicyEditsMixin(HasEditsMixin): class HasPolicyEditsMixin(HasEditsMixin):
@@ -46,12 +54,21 @@ class HasPolicyEditsMixin(HasEditsMixin):
return self._values_have_edits(new_values) return self._values_have_edits(new_values)
class InstanceLink(BaseModel):
source = models.ForeignKey('Instance', on_delete=models.CASCADE, related_name='+')
target = models.ForeignKey('Instance', on_delete=models.CASCADE, related_name='reverse_peers')
class Meta:
unique_together = ('source', 'target')
class Instance(HasPolicyEditsMixin, BaseModel): class Instance(HasPolicyEditsMixin, BaseModel):
"""A model representing an AWX instance running against this database.""" """A model representing an AWX instance running against this database."""
objects = InstanceManager() objects = InstanceManager()
uuid = models.CharField(max_length=40) # Fields set in instance registration
uuid = models.CharField(max_length=40, default=UUID_DEFAULT)
hostname = models.CharField(max_length=250, unique=True) hostname = models.CharField(max_length=250, unique=True)
ip_address = models.CharField( ip_address = models.CharField(
blank=True, blank=True,
@@ -60,9 +77,39 @@ class Instance(HasPolicyEditsMixin, BaseModel):
max_length=50, max_length=50,
unique=True, unique=True,
) )
# Auto-fields, implementation is different from BaseModel
created = models.DateTimeField(auto_now_add=True) created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True) modified = models.DateTimeField(auto_now=True)
# Fields defined in health check or heartbeat
version = models.CharField(max_length=120, blank=True) version = models.CharField(max_length=120, blank=True)
cpu = models.DecimalField(
default=Decimal(0.0),
max_digits=4,
decimal_places=1,
editable=False,
)
memory = models.BigIntegerField(
default=0,
editable=False,
help_text=_('Total system memory of this instance in bytes.'),
)
errors = models.TextField(
default='',
blank=True,
editable=False,
help_text=_('Any error details from the last health check.'),
)
last_seen = models.DateTimeField(
null=True,
editable=False,
help_text=_('Last time instance ran its heartbeat task for main cluster nodes. Last known connection to receptor mesh for execution nodes.'),
)
last_health_check = models.DateTimeField(
null=True,
editable=False,
help_text=_('Last time a health check was ran on this instance to refresh cpu, memory, and capacity.'),
)
# Capacity management
capacity = models.PositiveIntegerField( capacity = models.PositiveIntegerField(
default=100, default=100,
editable=False, editable=False,
@@ -70,14 +117,7 @@ class Instance(HasPolicyEditsMixin, BaseModel):
capacity_adjustment = models.DecimalField(default=Decimal(1.0), max_digits=3, decimal_places=2, validators=[MinValueValidator(0)]) capacity_adjustment = models.DecimalField(default=Decimal(1.0), max_digits=3, decimal_places=2, validators=[MinValueValidator(0)])
enabled = models.BooleanField(default=True) enabled = models.BooleanField(default=True)
managed_by_policy = models.BooleanField(default=True) managed_by_policy = models.BooleanField(default=True)
cpu = models.IntegerField(
default=0,
editable=False,
)
memory = models.BigIntegerField(
default=0,
editable=False,
)
cpu_capacity = models.IntegerField( cpu_capacity = models.IntegerField(
default=0, default=0,
editable=False, editable=False,
@@ -86,6 +126,15 @@ class Instance(HasPolicyEditsMixin, BaseModel):
default=0, default=0,
editable=False, editable=False,
) )
NODE_TYPE_CHOICES = [
("control", "Control plane node"),
("execution", "Execution plane node"),
("hybrid", "Controller and execution"),
("hop", "Message-passing node, no execution capability"),
]
node_type = models.CharField(default='hybrid', choices=NODE_TYPE_CHOICES, max_length=16)
peers = models.ManyToManyField('self', symmetrical=False, through=InstanceLink, through_fields=('source', 'target'))
class Meta: class Meta:
app_label = 'main' app_label = 'main'
@@ -98,17 +147,19 @@ class Instance(HasPolicyEditsMixin, BaseModel):
@property @property
def consumed_capacity(self): def consumed_capacity(self):
return sum(x.task_impact for x in UnifiedJob.objects.filter(execution_node=self.hostname, status__in=('running', 'waiting'))) capacity_consumed = 0
if self.node_type in ('hybrid', 'execution'):
capacity_consumed += sum(x.task_impact for x in UnifiedJob.objects.filter(execution_node=self.hostname, status__in=('running', 'waiting')))
if self.node_type in ('hybrid', 'control'):
capacity_consumed += sum(
settings.AWX_CONTROL_NODE_TASK_IMPACT for x in UnifiedJob.objects.filter(controller_node=self.hostname, status__in=('running', 'waiting'))
)
return capacity_consumed
@property @property
def remaining_capacity(self): def remaining_capacity(self):
return self.capacity - self.consumed_capacity return self.capacity - self.consumed_capacity
@property
def role(self):
# NOTE: TODO: Likely to repurpose this once standalone ramparts are a thing
return "awx"
@property @property
def jobs_running(self): def jobs_running(self):
return UnifiedJob.objects.filter( return UnifiedJob.objects.filter(
@@ -123,33 +174,121 @@ class Instance(HasPolicyEditsMixin, BaseModel):
def jobs_total(self): def jobs_total(self):
return UnifiedJob.objects.filter(execution_node=self.hostname).count() return UnifiedJob.objects.filter(execution_node=self.hostname).count()
@staticmethod
def choose_online_control_plane_node():
return random.choice(
Instance.objects.filter(enabled=True, capacity__gt=0).filter(node_type__in=['control', 'hybrid']).values_list('hostname', flat=True)
)
def get_cleanup_task_kwargs(self, **kwargs):
"""
Produce options to use for the command: ansible-runner worker cleanup
returns a dict that is passed to the python interface for the runner method corresponding to that command
any kwargs will override that key=value combination in the returned dict
"""
vargs = dict()
if settings.AWX_CLEANUP_PATHS:
vargs['file_pattern'] = '/tmp/{}*'.format(JOB_FOLDER_PREFIX % '*')
vargs.update(kwargs)
if 'exclude_strings' not in vargs and vargs.get('file_pattern'):
active_pks = list(UnifiedJob.objects.filter(execution_node=self.hostname, status__in=('running', 'waiting')).values_list('pk', flat=True))
if active_pks:
vargs['exclude_strings'] = [JOB_FOLDER_PREFIX % job_id for job_id in active_pks]
if 'remove_images' in vargs or 'image_prune' in vargs:
vargs.setdefault('process_isolation_executable', 'podman')
return vargs
def is_lost(self, ref_time=None): def is_lost(self, ref_time=None):
if self.last_seen is None:
return True
if ref_time is None: if ref_time is None:
ref_time = now() ref_time = now()
grace_period = 120 grace_period = settings.CLUSTER_NODE_HEARTBEAT_PERIOD * 2
return self.modified < ref_time - timedelta(seconds=grace_period) if self.node_type in ('execution', 'hop'):
grace_period += settings.RECEPTOR_SERVICE_ADVERTISEMENT_PERIOD
return self.last_seen < ref_time - timedelta(seconds=grace_period)
def refresh_capacity(self): def mark_offline(self, update_last_seen=False, perform_save=True, errors=''):
cpu = get_cpu_capacity() if self.cpu_capacity == 0 and self.mem_capacity == 0 and self.capacity == 0 and self.errors == errors and (not update_last_seen):
mem = get_mem_capacity() return
if self.enabled: self.cpu_capacity = self.mem_capacity = self.capacity = 0
self.capacity = get_system_task_capacity(self.capacity_adjustment) self.errors = errors
if update_last_seen:
self.last_seen = now()
if perform_save:
update_fields = ['capacity', 'cpu_capacity', 'mem_capacity', 'errors']
if update_last_seen:
update_fields += ['last_seen']
self.save(update_fields=update_fields)
def set_capacity_value(self):
"""Sets capacity according to capacity adjustment rule (no save)"""
if self.enabled and self.node_type != 'hop':
lower_cap = min(self.mem_capacity, self.cpu_capacity)
higher_cap = max(self.mem_capacity, self.cpu_capacity)
self.capacity = lower_cap + (higher_cap - lower_cap) * self.capacity_adjustment
else: else:
self.capacity = 0 self.capacity = 0
def refresh_capacity_fields(self):
"""Update derived capacity fields from cpu and memory (no save)"""
self.cpu_capacity = get_cpu_effective_capacity(self.cpu)
self.mem_capacity = get_mem_effective_capacity(self.memory)
self.set_capacity_value()
def save_health_data(self, version, cpu, memory, uuid=None, update_last_seen=False, errors=''):
self.last_health_check = now()
update_fields = ['last_health_check']
if update_last_seen:
self.last_seen = self.last_health_check
update_fields.append('last_seen')
if uuid is not None and self.uuid != uuid:
if self.uuid is not None:
logger.warn(f'Self-reported uuid of {self.hostname} changed from {self.uuid} to {uuid}')
self.uuid = uuid
update_fields.append('uuid')
if self.version != version:
self.version = version
update_fields.append('version')
new_cpu = get_corrected_cpu(cpu)
if new_cpu != self.cpu:
self.cpu = new_cpu
update_fields.append('cpu')
new_memory = get_corrected_memory(memory)
if new_memory != self.memory:
self.memory = new_memory
update_fields.append('memory')
if not errors:
self.refresh_capacity_fields()
self.errors = ''
else:
self.mark_offline(perform_save=False, errors=errors)
update_fields.extend(['cpu_capacity', 'mem_capacity', 'capacity', 'errors'])
# disabling activity stream will avoid extra queries, which is important for heatbeat actions
from awx.main.signals import disable_activity_stream
with disable_activity_stream():
self.save(update_fields=update_fields)
def local_health_check(self):
"""Only call this method on the instance that this record represents"""
errors = None
try: try:
# if redis is down for some reason, that means we can't persist # if redis is down for some reason, that means we can't persist
# playbook event data; we should consider this a zero capacity event # playbook event data; we should consider this a zero capacity event
redis.Redis.from_url(settings.BROKER_URL).ping() redis.Redis.from_url(settings.BROKER_URL).ping()
except redis.ConnectionError: except redis.ConnectionError:
self.capacity = 0 errors = _('Failed to connect ot Redis')
self.cpu = cpu[0] self.save_health_data(awx_application_version, get_cpu_count(), get_mem_in_bytes(), update_last_seen=True, errors=errors)
self.memory = mem[0]
self.cpu_capacity = cpu[1]
self.mem_capacity = mem[1]
self.version = awx_application_version
self.save(update_fields=['capacity', 'version', 'modified', 'cpu', 'memory', 'cpu_capacity', 'mem_capacity'])
class InstanceGroup(HasPolicyEditsMixin, BaseModel, RelatedJobsMixin): class InstanceGroup(HasPolicyEditsMixin, BaseModel, RelatedJobsMixin):
@@ -194,7 +333,7 @@ class InstanceGroup(HasPolicyEditsMixin, BaseModel, RelatedJobsMixin):
@property @property
def capacity(self): def capacity(self):
return sum([inst.capacity for inst in self.instances.all()]) return sum(inst.capacity for inst in self.instances.all())
@property @property
def jobs_running(self): def jobs_running(self):
@@ -215,19 +354,29 @@ class InstanceGroup(HasPolicyEditsMixin, BaseModel, RelatedJobsMixin):
app_label = 'main' app_label = 'main'
@staticmethod @staticmethod
def fit_task_to_most_remaining_capacity_instance(task, instances): def fit_task_to_most_remaining_capacity_instance(task, instances, impact=None, capacity_type=None, add_hybrid_control_cost=False):
impact = impact if impact else task.task_impact
capacity_type = capacity_type if capacity_type else task.capacity_type
instance_most_capacity = None instance_most_capacity = None
most_remaining_capacity = -1
for i in instances: for i in instances:
if i.remaining_capacity >= task.task_impact and ( if i.node_type not in (capacity_type, 'hybrid'):
instance_most_capacity is None or i.remaining_capacity > instance_most_capacity.remaining_capacity continue
): would_be_remaining = i.remaining_capacity - impact
# hybrid nodes _always_ control their own tasks
if add_hybrid_control_cost and i.node_type == 'hybrid':
would_be_remaining -= settings.AWX_CONTROL_NODE_TASK_IMPACT
if would_be_remaining >= 0 and (instance_most_capacity is None or would_be_remaining > most_remaining_capacity):
instance_most_capacity = i instance_most_capacity = i
most_remaining_capacity = would_be_remaining
return instance_most_capacity return instance_most_capacity
@staticmethod @staticmethod
def find_largest_idle_instance(instances): def find_largest_idle_instance(instances, capacity_type='execution'):
largest_instance = None largest_instance = None
for i in instances: for i in instances:
if i.node_type not in (capacity_type, 'hybrid'):
continue
if i.jobs_running == 0: if i.jobs_running == 0:
if largest_instance is None: if largest_instance is None:
largest_instance = i largest_instance = i
@@ -246,7 +395,7 @@ class TowerScheduleState(SingletonModel):
def schedule_policy_task(): def schedule_policy_task():
from awx.main.tasks import apply_cluster_membership_policies from awx.main.tasks.system import apply_cluster_membership_policies
connection.on_commit(lambda: apply_cluster_membership_policies.apply_async()) connection.on_commit(lambda: apply_cluster_membership_policies.apply_async())

View File

@@ -170,6 +170,12 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
editable=False, editable=False,
help_text=_('Flag indicating the inventory is being deleted.'), help_text=_('Flag indicating the inventory is being deleted.'),
) )
labels = models.ManyToManyField(
"Label",
blank=True,
related_name='inventory_labels',
help_text=_('Labels associated with this inventory.'),
)
def get_absolute_url(self, request=None): def get_absolute_url(self, request=None):
return reverse('api:inventory_detail', kwargs={'pk': self.pk}, request=request) return reverse('api:inventory_detail', kwargs={'pk': self.pk}, request=request)
@@ -366,7 +372,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
@transaction.atomic @transaction.atomic
def schedule_deletion(self, user_id=None): def schedule_deletion(self, user_id=None):
from awx.main.tasks import delete_inventory from awx.main.tasks.system import delete_inventory
from awx.main.signals import activity_stream_delete from awx.main.signals import activity_stream_delete
if self.pending_deletion is True: if self.pending_deletion is True:
@@ -382,7 +388,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
if self.kind == 'smart' and settings.AWX_REBUILD_SMART_MEMBERSHIP: if self.kind == 'smart' and settings.AWX_REBUILD_SMART_MEMBERSHIP:
def on_commit(): def on_commit():
from awx.main.tasks import update_host_smart_inventory_memberships from awx.main.tasks.system import update_host_smart_inventory_memberships
update_host_smart_inventory_memberships.delay() update_host_smart_inventory_memberships.delay()
@@ -551,7 +557,7 @@ class Host(CommonModelNameNotUnique, RelatedJobsMixin):
if settings.AWX_REBUILD_SMART_MEMBERSHIP: if settings.AWX_REBUILD_SMART_MEMBERSHIP:
def on_commit(): def on_commit():
from awx.main.tasks import update_host_smart_inventory_memberships from awx.main.tasks.system import update_host_smart_inventory_memberships
update_host_smart_inventory_memberships.delay() update_host_smart_inventory_memberships.delay()
@@ -631,7 +637,7 @@ class Group(CommonModelNameNotUnique, RelatedJobsMixin):
@transaction.atomic @transaction.atomic
def delete_recursive(self): def delete_recursive(self):
from awx.main.utils import ignore_inventory_computed_fields from awx.main.utils import ignore_inventory_computed_fields
from awx.main.tasks import update_inventory_computed_fields from awx.main.tasks.system import update_inventory_computed_fields
from awx.main.signals import disable_activity_stream, activity_stream_delete from awx.main.signals import disable_activity_stream, activity_stream_delete
def mark_actual(): def mark_actual():
@@ -1214,16 +1220,12 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin,
def is_container_group_task(self): def is_container_group_task(self):
return bool(self.instance_group and self.instance_group.is_container_group) return bool(self.instance_group and self.instance_group.is_container_group)
@property
def can_run_containerized(self):
return True
def _get_parent_field_name(self): def _get_parent_field_name(self):
return 'inventory_source' return 'inventory_source'
@classmethod @classmethod
def _get_task_class(cls): def _get_task_class(cls):
from awx.main.tasks import RunInventoryUpdate from awx.main.tasks.jobs import RunInventoryUpdate
return RunInventoryUpdate return RunInventoryUpdate

View File

@@ -583,7 +583,7 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana
@classmethod @classmethod
def _get_task_class(cls): def _get_task_class(cls):
from awx.main.tasks import RunJob from awx.main.tasks.jobs import RunJob
return RunJob return RunJob
@@ -743,10 +743,6 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana
return "$hidden due to Ansible no_log flag$" return "$hidden due to Ansible no_log flag$"
return artifacts return artifacts
@property
def can_run_containerized(self):
return True
@property @property
def is_container_group_task(self): def is_container_group_task(self):
return bool(self.instance_group and self.instance_group.is_container_group) return bool(self.instance_group and self.instance_group.is_container_group)
@@ -1217,7 +1213,7 @@ class SystemJob(UnifiedJob, SystemJobOptions, JobNotificationMixin):
@classmethod @classmethod
def _get_task_class(cls): def _get_task_class(cls):
from awx.main.tasks import RunSystemJob from awx.main.tasks.jobs import RunSystemJob
return RunSystemJob return RunSystemJob
@@ -1236,10 +1232,6 @@ class SystemJob(UnifiedJob, SystemJobOptions, JobNotificationMixin):
return UnpartitionedSystemJobEvent return UnpartitionedSystemJobEvent
return SystemJobEvent return SystemJobEvent
@property
def can_run_on_control_plane(self):
return True
@property @property
def task_impact(self): def task_impact(self):
return 5 return 5

View File

@@ -9,6 +9,7 @@ from django.utils.translation import ugettext_lazy as _
from awx.api.versioning import reverse from awx.api.versioning import reverse
from awx.main.models.base import CommonModelNameNotUnique from awx.main.models.base import CommonModelNameNotUnique
from awx.main.models.unified_jobs import UnifiedJobTemplate, UnifiedJob from awx.main.models.unified_jobs import UnifiedJobTemplate, UnifiedJob
from awx.main.models.inventory import Inventory
__all__ = ('Label',) __all__ = ('Label',)
@@ -35,15 +36,14 @@ class Label(CommonModelNameNotUnique):
@staticmethod @staticmethod
def get_orphaned_labels(): def get_orphaned_labels():
return Label.objects.filter(organization=None, unifiedjobtemplate_labels__isnull=True) return Label.objects.filter(organization=None, unifiedjobtemplate_labels__isnull=True, inventory_labels__isnull=True)
def is_detached(self): def is_detached(self):
return bool(Label.objects.filter(id=self.id, unifiedjob_labels__isnull=True, unifiedjobtemplate_labels__isnull=True).count()) return Label.objects.filter(id=self.id, unifiedjob_labels__isnull=True, unifiedjobtemplate_labels__isnull=True, inventory_labels__isnull=True).exists()
def is_candidate_for_detach(self): def is_candidate_for_detach(self):
c1 = UnifiedJob.objects.filter(labels__in=[self.id]).count() c1 = UnifiedJob.objects.filter(labels__in=[self.id]).count()
c2 = UnifiedJobTemplate.objects.filter(labels__in=[self.id]).count() c2 = UnifiedJobTemplate.objects.filter(labels__in=[self.id]).count()
if (c1 + c2 - 1) == 0: c3 = Inventory.objects.filter(labels__in=[self.id]).count()
return True return (c1 + c2 + c3 - 1) == 0
else:
return False

View File

@@ -508,7 +508,7 @@ class JobNotificationMixin(object):
return (msg, body) return (msg, body)
def send_notification_templates(self, status): def send_notification_templates(self, status):
from awx.main.tasks import send_notifications # avoid circular import from awx.main.tasks.system import send_notifications # avoid circular import
if status not in ['running', 'succeeded', 'failed']: if status not in ['running', 'succeeded', 'failed']:
raise ValueError(_("status must be either running, succeeded or failed")) raise ValueError(_("status must be either running, succeeded or failed"))

View File

@@ -118,7 +118,7 @@ class Organization(CommonModel, NotificationFieldsModel, ResourceMixin, CustomVi
from awx.main.models import Credential from awx.main.models import Credential
public_galaxy_credential = Credential.objects.filter(managed=True, name='Ansible Galaxy').first() public_galaxy_credential = Credential.objects.filter(managed=True, name='Ansible Galaxy').first()
if public_galaxy_credential not in self.galaxy_credentials.all(): if public_galaxy_credential is not None and public_galaxy_credential not in self.galaxy_credentials.all():
self.galaxy_credentials.add(public_galaxy_credential) self.galaxy_credentials.add(public_galaxy_credential)

View File

@@ -471,7 +471,7 @@ class Project(UnifiedJobTemplate, ProjectOptions, ResourceMixin, CustomVirtualEn
r = super(Project, self).delete(*args, **kwargs) r = super(Project, self).delete(*args, **kwargs)
for path_to_delete in paths_to_delete: for path_to_delete in paths_to_delete:
if self.scm_type and path_to_delete: # non-manual, concrete path if self.scm_type and path_to_delete: # non-manual, concrete path
from awx.main.tasks import delete_project_files from awx.main.tasks.system import delete_project_files
delete_project_files.delay(path_to_delete) delete_project_files.delay(path_to_delete)
return r return r
@@ -532,7 +532,7 @@ class ProjectUpdate(UnifiedJob, ProjectOptions, JobNotificationMixin, TaskManage
@classmethod @classmethod
def _get_task_class(cls): def _get_task_class(cls):
from awx.main.tasks import RunProjectUpdate from awx.main.tasks.jobs import RunProjectUpdate
return RunProjectUpdate return RunProjectUpdate
@@ -553,10 +553,6 @@ class ProjectUpdate(UnifiedJob, ProjectOptions, JobNotificationMixin, TaskManage
websocket_data.update(dict(project_id=self.project.id)) websocket_data.update(dict(project_id=self.project.id))
return websocket_data return websocket_data
@property
def can_run_on_control_plane(self):
return True
@property @property
def event_class(self): def event_class(self):
if self.has_unpartitioned_events: if self.has_unpartitioned_events:
@@ -617,20 +613,6 @@ class ProjectUpdate(UnifiedJob, ProjectOptions, JobNotificationMixin, TaskManage
def get_notification_friendly_name(self): def get_notification_friendly_name(self):
return "Project Update" return "Project Update"
@property
def preferred_instance_groups(self):
if self.organization is not None:
organization_groups = [x for x in self.organization.instance_groups.all()]
else:
organization_groups = []
template_groups = [x for x in super(ProjectUpdate, self).preferred_instance_groups]
selected_groups = template_groups + organization_groups
if not any([not group.is_container_group for group in selected_groups]):
selected_groups = selected_groups + list(self.control_plane_instance_group)
if not selected_groups:
return self.global_instance_groups
return selected_groups
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
added_update_fields = [] added_update_fields = []
if not self.job_tags: if not self.job_tags:

View File

@@ -36,21 +36,21 @@ from awx.main.dispatch import get_local_queuename
from awx.main.dispatch.control import Control as ControlDispatcher from awx.main.dispatch.control import Control as ControlDispatcher
from awx.main.registrar import activity_stream_registrar from awx.main.registrar import activity_stream_registrar
from awx.main.models.mixins import ResourceMixin, TaskManagerUnifiedJobMixin, ExecutionEnvironmentMixin from awx.main.models.mixins import ResourceMixin, TaskManagerUnifiedJobMixin, ExecutionEnvironmentMixin
from awx.main.utils import ( from awx.main.utils.common import (
camelcase_to_underscore, camelcase_to_underscore,
get_model_for_type, get_model_for_type,
encrypt_dict,
decrypt_field,
_inventory_updates, _inventory_updates,
copy_model_by_class, copy_model_by_class,
copy_m2m_relationships, copy_m2m_relationships,
get_type_for_model, get_type_for_model,
parse_yaml_or_json, parse_yaml_or_json,
getattr_dne, getattr_dne,
polymorphic,
schedule_task_manager, schedule_task_manager,
get_event_partition_epoch, get_event_partition_epoch,
get_capacity_type,
) )
from awx.main.utils.encryption import encrypt_dict, decrypt_field
from awx.main.utils import polymorphic
from awx.main.constants import ACTIVE_STATES, CAN_CANCEL from awx.main.constants import ACTIVE_STATES, CAN_CANCEL
from awx.main.redact import UriCleaner, REPLACE_STR from awx.main.redact import UriCleaner, REPLACE_STR
from awx.main.consumers import emit_channel_notification from awx.main.consumers import emit_channel_notification
@@ -740,15 +740,8 @@ class UnifiedJob(
raise NotImplementedError # Implement in subclasses. raise NotImplementedError # Implement in subclasses.
@property @property
def can_run_on_control_plane(self): def capacity_type(self):
if settings.IS_K8S: return get_capacity_type(self)
return False
return True
@property
def can_run_containerized(self):
return False
def _get_parent_field_name(self): def _get_parent_field_name(self):
return 'unified_job_template' # Override in subclasses. return 'unified_job_template' # Override in subclasses.
@@ -1053,7 +1046,7 @@ class UnifiedJob(
fd = tempfile.NamedTemporaryFile( fd = tempfile.NamedTemporaryFile(
mode='w', prefix='{}-{}-'.format(self.model_to_str(), self.pk), suffix='.out', dir=settings.JOBOUTPUT_ROOT, encoding='utf-8' mode='w', prefix='{}-{}-'.format(self.model_to_str(), self.pk), suffix='.out', dir=settings.JOBOUTPUT_ROOT, encoding='utf-8'
) )
from awx.main.tasks import purge_old_stdout_files # circular import from awx.main.tasks.system import purge_old_stdout_files # circular import
purge_old_stdout_files.apply_async() purge_old_stdout_files.apply_async()
@@ -1442,9 +1435,13 @@ class UnifiedJob(
if not settings.IS_K8S: if not settings.IS_K8S:
default_instance_group_names.append(settings.DEFAULT_CONTROL_PLANE_QUEUE_NAME) default_instance_group_names.append(settings.DEFAULT_CONTROL_PLANE_QUEUE_NAME)
default_instance_groups = InstanceGroup.objects.filter(name__in=default_instance_group_names) default_instance_groups = list(InstanceGroup.objects.filter(name__in=default_instance_group_names))
return list(default_instance_groups) # assure deterministic precedence by making sure the default group is first
if (not settings.IS_K8S) and default_instance_groups and default_instance_groups[0].name != settings.DEFAULT_EXECUTION_QUEUE_NAME:
default_instance_groups.reverse()
return default_instance_groups
def awx_meta_vars(self): def awx_meta_vars(self):
""" """
@@ -1500,7 +1497,12 @@ class UnifiedJob(
return False return False
def log_lifecycle(self, state, blocked_by=None): def log_lifecycle(self, state, blocked_by=None):
extra = {'type': self._meta.model_name, 'task_id': self.id, 'state': state} extra = {
'type': self._meta.model_name,
'task_id': self.id,
'state': state,
'work_unit_id': self.work_unit_id,
}
if self.unified_job_template: if self.unified_job_template:
extra["template_name"] = self.unified_job_template.name extra["template_name"] = self.unified_job_template.name
if state == "blocked" and blocked_by: if state == "blocked" and blocked_by:
@@ -1509,6 +1511,11 @@ class UnifiedJob(
extra["blocked_by"] = blocked_by_msg extra["blocked_by"] = blocked_by_msg
else: else:
msg = f"{self._meta.model_name}-{self.id} {state.replace('_', ' ')}" msg = f"{self._meta.model_name}-{self.id} {state.replace('_', ' ')}"
if state == "controller_node_chosen":
extra["controller_node"] = self.controller_node or "NOT_SET"
elif state == "execution_node_chosen":
extra["execution_node"] = self.execution_node or "NOT_SET"
logger_job_lifecycle.debug(msg, extra=extra) logger_job_lifecycle.debug(msg, extra=extra)
@property @property

View File

@@ -813,7 +813,7 @@ class WorkflowApproval(UnifiedJob, JobNotificationMixin):
return True return True
def send_approval_notification(self, approval_status): def send_approval_notification(self, approval_status):
from awx.main.tasks import send_notifications # avoid circular import from awx.main.tasks.system import send_notifications # avoid circular import
if self.workflow_job_template is None: if self.workflow_job_template is None:
return return

View File

@@ -9,6 +9,7 @@ from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from awx.main.notifications.base import AWXBaseEmailBackend from awx.main.notifications.base import AWXBaseEmailBackend
from awx.main.utils import get_awx_http_client_headers
from awx.main.notifications.custom_notification_base import CustomNotificationBase from awx.main.notifications.custom_notification_base import CustomNotificationBase
logger = logging.getLogger('awx.main.notifications.rocketchat_backend') logger = logging.getLogger('awx.main.notifications.rocketchat_backend')
@@ -38,7 +39,9 @@ class RocketChatBackend(AWXBaseEmailBackend, CustomNotificationBase):
if optvalue is not None: if optvalue is not None:
payload[optval] = optvalue.strip() payload[optval] = optvalue.strip()
r = requests.post("{}".format(m.recipients()[0]), data=json.dumps(payload), verify=(not self.rocketchat_no_verify_ssl)) r = requests.post(
"{}".format(m.recipients()[0]), data=json.dumps(payload), headers=get_awx_http_client_headers(), verify=(not self.rocketchat_no_verify_ssl)
)
if r.status_code >= 400: if r.status_code >= 400:
logger.error(smart_text(_("Error sending notification rocket.chat: {}").format(r.status_code))) logger.error(smart_text(_("Error sending notification rocket.chat: {}").format(r.status_code)))

View File

@@ -2,7 +2,8 @@
# All Rights Reserved. # All Rights Reserved.
import logging import logging
from slackclient import SlackClient from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
from django.utils.encoding import smart_text from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
@@ -28,23 +29,30 @@ class SlackBackend(AWXBaseEmailBackend, CustomNotificationBase):
self.color = hex_color self.color = hex_color
def send_messages(self, messages): def send_messages(self, messages):
connection = SlackClient(self.token) client = WebClient(self.token)
sent_messages = 0 sent_messages = 0
for m in messages: for m in messages:
try: try:
for r in m.recipients(): for r in m.recipients():
if r.startswith('#'): if r.startswith('#'):
r = r[1:] r = r[1:]
thread = None
channel = r
thread = None
if ',' in r:
channel, thread = r.split(',')
if self.color: if self.color:
ret = connection.api_call("chat.postMessage", channel=r, as_user=True, attachments=[{"color": self.color, "text": m.subject}]) response = client.chat_postMessage(
channel=channel, thread_ts=thread, as_user=True, attachments=[{"color": self.color, "text": m.subject}]
)
else: else:
ret = connection.api_call("chat.postMessage", channel=r, as_user=True, text=m.subject) response = client.chat_postMessage(channel=channel, thread_ts=thread, as_user=True, text=m.subject)
logger.debug(ret) logger.debug(response)
if ret['ok']: if response['ok']:
sent_messages += 1 sent_messages += 1
else: else:
raise RuntimeError("Slack Notification unable to send {}: {} ({})".format(r, m.subject, ret['error'])) raise RuntimeError("Slack Notification unable to send {}: {} ({})".format(r, m.subject, response['error']))
except Exception as e: except SlackApiError as e:
logger.error(smart_text(_("Exception sending messages: {}").format(e))) logger.error(smart_text(_("Exception sending messages: {}").format(e)))
if not self.fail_silently: if not self.fail_silently:
raise raise

View File

@@ -72,7 +72,7 @@ class WebhookBackend(AWXBaseEmailBackend, CustomNotificationBase):
"{}".format(m.recipients()[0]), "{}".format(m.recipients()[0]),
auth=auth, auth=auth,
data=json.dumps(m.body, ensure_ascii=False).encode('utf-8'), data=json.dumps(m.body, ensure_ascii=False).encode('utf-8'),
headers=get_awx_http_client_headers(), headers=dict(list(get_awx_http_client_headers().items()) + list((self.headers or {}).items())),
verify=(not self.disable_ssl_verification), verify=(not self.disable_ssl_verification),
) )
if r.status_code >= 400: if r.status_code >= 400:

View File

@@ -9,29 +9,12 @@ from kubernetes import client, config
from django.utils.functional import cached_property from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from awx.main.utils.common import parse_yaml_or_json from awx.main.utils.common import parse_yaml_or_json, deepmerge
from awx.main.utils.execution_environments import get_default_pod_spec from awx.main.utils.execution_environments import get_default_pod_spec
logger = logging.getLogger('awx.main.scheduler') logger = logging.getLogger('awx.main.scheduler')
def deepmerge(a, b):
"""
Merge dict structures and return the result.
>>> a = {'first': {'all_rows': {'pass': 'dog', 'number': '1'}}}
>>> b = {'first': {'all_rows': {'fail': 'cat', 'number': '5'}}}
>>> import pprint; pprint.pprint(deepmerge(a, b))
{'first': {'all_rows': {'fail': 'cat', 'number': '5', 'pass': 'dog'}}}
"""
if isinstance(a, dict) and isinstance(b, dict):
return dict([(k, deepmerge(a.get(k), b.get(k))) for k in set(a.keys()).union(b.keys())])
elif b is None:
return a
else:
return b
class PodManager(object): class PodManager(object):
def __init__(self, task=None): def __init__(self, task=None):
self.task = task self.task = task
@@ -183,7 +166,7 @@ class PodManager(object):
pod_spec_override = {} pod_spec_override = {}
if self.task and self.task.instance_group.pod_spec_override: if self.task and self.task.instance_group.pod_spec_override:
pod_spec_override = parse_yaml_or_json(self.task.instance_group.pod_spec_override) pod_spec_override = parse_yaml_or_json(self.task.instance_group.pod_spec_override)
pod_spec = {**default_pod_spec, **pod_spec_override} pod_spec = deepmerge(default_pod_spec, pod_spec_override)
if self.task: if self.task:
pod_spec['metadata'] = deepmerge( pod_spec['metadata'] = deepmerge(

Some files were not shown because too many files have changed in this diff Show More