30353 Commits

Author SHA1 Message Date
Christian M. Adams
8316a1d198
Create pull secret in cluster and use it in PodSpec
- base64 encode secret values before creating the secret
  - Construct valid .dockerconfigjson
  - Cancel jobs where it will obviously fail & error handling
  - Check if the secret exists first, then attempts to replace it if it does.
2021-05-25 14:44:42 -04:00
Christian M. Adams
a0840ddec2
Enforce EE pull policy on Container Groups 2021-05-25 14:44:41 -04:00
softwarefactory-project-zuul[bot]
e28bed5a6c
Merge pull request #9904 from MaximilianMeister/approval-docs
Document usage of workflow job template nodes with approvals

SUMMARY

I'm not sure if this procedure is mandatory, but it was the only way it worked for me.
It's already documented in one sentence that you can create all workflow template nodes first and then link them later. However in the Examples it has been missing to make it explicit, as it's not really intuitive when you create the nodes and link them at the same time, it won't work and you run into #8777
ISSUE TYPE


Docs Pull Request

AWX VERSION

awx: 19.0.0

Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: Maximilian Meister <None>
Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-05-25 17:22:08 +00:00
softwarefactory-project-zuul[bot]
25bb3fbd59
Merge pull request #10261 from shanemcd/bump-receptor
Bump receptor and receptorctl

Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: Yanis Guenane <None>
2021-05-25 17:09:30 +00:00
softwarefactory-project-zuul[bot]
f2cd630a90
Merge pull request #10251 from kdelee/options_ee
tweak message about image pull option

SUMMARY

I'm not sure if it is OK to change the migration in this way.
This message in the UI didn't make sense to me. If you all prefer the existing message, that is fine...I just think it is weird and doesn't tell you what it does.
If I don't care, I can leave it on --------- in the UI which is "do whatever the default is"
If I do care, its weird to choose an option saying I don't choose and option.

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
Reviewed-by: Jeff Bradberry <None>
2021-05-25 16:19:41 +00:00
Shane McDonald
63d702d1aa
Bump receptor and receptorctl 2021-05-25 11:58:10 -04:00
Elijah DeLee
b74990c480 allow singular execution_environment for cli
this makes "execution_environments" or "execution_environment" work
which is helpful
2021-05-25 11:28:47 -04:00
softwarefactory-project-zuul[bot]
d6c5a23e05
Merge pull request #10239 from mabashian/disable-pendo
Only initialize pendo if the key is available

SUMMARY
Don't bootstrap/init pendo if the key is missing or empty string

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-25 12:46:51 +00:00
mabashian
dd1bda3b67 Fix broken app container test 2021-05-25 08:06:06 -04:00
mabashian
82c3348b15 Only initialize pendo if the key is available 2021-05-24 17:34:00 -04:00
Elijah DeLee
058189dfcf tweak message about image pull option 2021-05-24 17:20:53 -04:00
softwarefactory-project-zuul[bot]
e2140ad7a8
Merge pull request #10250 from tiagodread/locators-screens
Add locators to screen page titles

Adds locators around the screen title so that we can use it in e2e tests.

Reviewed-by: Kersom <None>
2021-05-24 20:30:58 +00:00
softwarefactory-project-zuul[bot]
fedc40d578
Merge pull request #10230 from amolgautam25/issue_315_receptor
Adding AWX_CONTAINER_GROUP_POD_LAUNCH_TIMEOUT in defaults.py

--- Adding a new global variable AWX_CONTAINER_GROUP_POD_LAUNCH_TIMEOUT in defaults.py
--- Passing this parameter in receptor_params in AWXReceptorJob class
SUMMARY

Related issue : ansible/receptor#315
Corresponding PR on receptor side : ansible/receptor#316
I have added a global variable AWX_CONTAINER_GROUP_POD_LAUNCH_TIMEOUT  ( and set default value as 5 minutes ).
This will be passed onto Receptor in case a job is container group task.

ISSUE TYPE


Feature Pull Request

COMPONENT NAME


API

AWX VERSION

awx: 19.1.0

ADDITIONAL INFORMATION




File Name : awx/main/tasks.py
Class Name : AWXReceptorJob
Function name: receptor_params(self)
Before the change the value of receptor_params before returning was :
{'secret_kube_config': '---\n'
                       'apiVersion: v1\n'
                       'clusters:\n'
                       '- cluster:\n'
                       '    insecure-skip-tls-verify: true\n'
                       '    server: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       '  name: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       'contexts:\n'
                       '- context:\n'
                       '    cluster: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       '    namespace: default\n'
                       '    user: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       '  name: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       'current-context: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       'kind: Config\n'
                       'preferences: {}\n'
                       'users:\n'
                       '- name: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       '  user:\n'
                       '    token: '
                       'sha256~otM0Z2vC8qfzm3eV0tfz-0V4DXKPqLC_Pp1gxXKuC-c\n',
 'secret_kube_pod': '---\n'
                    'apiVersion: v1\n'
                    'kind: Pod\n'
                    'metadata:\n'
                    '  labels:\n'
                    '    ansible-awx: 04366fdb-65ec-4efc-bb01-685e9ca7e05b\n'
                    "    ansible-awx-job-id: '21'\n"
                    '  name: automation-job-21\n'
                    '  namespace: default\n'
                    'spec:\n'
                    '  containers:\n'
                    '  - args:\n'
                    '    - ansible-runner\n'
                    '    - worker\n'
                    '    - --private-data-dir=/runner\n'
                    '    image: quay.io/ansible/awx-ee:0.2.0\n'
                    '    name: worker\n'}
>>>

After the change the value of receptor_params before returning is :
{'pod_pending_timeout': '5m',
 'secret_kube_config': '---\n'
                       'apiVersion: v1\n'
                       'clusters:\n'
                       '- cluster:\n'
                       '    insecure-skip-tls-verify: true\n'
                       '    server: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       '  name: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       'contexts:\n'
                       '- context:\n'
                       '    cluster: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       '    namespace: default\n'
                       '    user: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       '  name: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       'current-context: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       'kind: Config\n'
                       'preferences: {}\n'
                       'users:\n'
                       '- name: '
                       'https://api.tower.ocp4.testing.ansible.com:6443\n'
                       '  user:\n'
                       '    token: '
                       'sha256~otM0Z2vC8qfzm3eV0tfz-0V4DXKPqLC_Pp1gxXKuC-c\n',
 'secret_kube_pod': '---\n'
                    'apiVersion: v1\n'
                    'kind: Pod\n'
                    'metadata:\n'
                    '  labels:\n'
                    '    ansible-awx: 04366fdb-65ec-4efc-bb01-685e9ca7e05b\n'
                    "    ansible-awx-job-id: '21'\n"
                    '  name: automation-job-21\n'
                    '  namespace: default\n'
                    'spec:\n'
                    '  containers:\n'
                    '  - args:\n'
                    '    - ansible-runner\n'
                    '    - worker\n'
                    '    - --private-data-dir=/runner\n'
                    '    image: quay.io/ansible/awx-ee:0.2.0\n'
                    '    name: worker\n'}
>>>

We can see that an extra parameter has been added : 'pod_pending_timeout': '5m',
####Additional changes :
--- Removed AWX_CONTAINER_GROUP_POD_LAUNCH_RETRIES from defaults.py as it was not being used anywhere
--- Removed AWX_CONTAINER_GROUP_POD_LAUNCH_RETRY_DELAY from defaults.py as it was not being used anywhere

Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
Reviewed-by: Amol Gautam <amol_gautam25@yahoo.co.in>
Reviewed-by: Seth Foster <None>
2021-05-24 20:05:52 +00:00
Tiago
aeed2e0128 add locators to screen page titles 2021-05-24 16:22:38 -03:00
fedora
0c917caa2a --- Adding AWX_CONTAINER_GROUP_POD_LAUNCH_TIMEOUT in defaults.py
--- Passing this parameter in receptor_params in AWXReceptorJob class
--- Removed AWX_CONTAINER_GROUP_POD_LAUNCH_RETRIES from defaults.py as it was not being used anywhere
--- Removed AWX_CONTAINER_GROUP_POD_LAUNCH_RETRY_DELAY from defaults.py as it was not being used anywhere
2021-05-24 11:33:01 -04:00
Alex Corey
4fe4856d02 updates patternfly react core so that we can get time picker validation bug fix 2021-05-24 10:57:50 -04:00
Alan Rominger
cb1df4a334
Remove code and settings no longer used 2021-05-24 09:44:58 -04:00
Alex Corey
c456b944a5 Converts all Lists inside a modal, mostly components that use OptionsList, to paginated tables 2021-05-24 09:08:06 -04:00
Bill Nottingham
6d052fdab4 UI licenses 2021-05-21 16:25:55 -04:00
softwarefactory-project-zuul[bot]
7801590bef
Merge pull request #10245 from tiagodread/add-testability
Add testability to the search and pagination fields

Add locators to search fields
See: #10241

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
2021-05-21 17:26:27 +00:00
Tiago
d834afd541 Pagination 2021-05-21 12:40:42 -03:00
Tiago
34ac60b35c Search and AdvancedSearch 2021-05-21 12:31:55 -03:00
Bill Nottingham
51538b7688 Restore UI license checker removed as part of removing old UI
Remove no longer needed license files.
2021-05-21 00:37:11 -04:00
softwarefactory-project-zuul[bot]
b771929b6e
Merge pull request #10195 from nixocio/ui_issue_9377
Fix null issue for limit

Fix null issue for limit.
See: #9377

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
2021-05-20 21:33:48 +00:00
softwarefactory-project-zuul[bot]
a25eec5cfa
Merge pull request #9654 from amolgautam25/issue_4687
Adding host_metrics for customers who don't have automation analytics

SUMMARY

I am trying to accomplish the following:

 Create a new model that stores details about hostname
 create corresponding migrations for it
 Update the table (main_hostmetrics) after playbook execution
 retrieve the data with custom awx-manage command :  awx-manage host_metrics --since <date> --until <date>


ISSUE TYPE


Feature Pull Request

COMPONENT NAME


API

AWX VERSION

awx: 18.0.0


ADDITIONAL INFORMATION

Reviewed-by: Ryan Petrello <ryan@ryanpetrello.com>
Reviewed-by: Amol Gautam <amol_gautam25@yahoo.co.in>
Reviewed-by: Chris Meyers <None>
Reviewed-by: Jeff Bradberry <None>
Reviewed-by: Bill Nottingham <None>
Reviewed-by: Ladislav Smola <lsmola@redhat.com>
Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-05-20 13:55:46 +00:00
Alex Corey
3b5641c41b adds confirmation modal to switch 2021-05-20 09:31:31 -04:00
Keith J. Grant
8ac3cc1542 delete qs utils that are no longer used 2021-05-19 13:49:57 -07:00
Keith J. Grant
908263df50 Rewrite updateQueryString to preserve namespaces
* Refactors ActivityStream to use updateQueryString
2021-05-19 13:23:46 -07:00
softwarefactory-project-zuul[bot]
68f214c2be
Merge pull request #8185 from AlanCoding/sniff_files_final
Use inventory and env private_data_dir subfolders

SUMMARY
This is another part of trying to get AWX to follow ansible-runner best practices.
See docs:
https://ansible-runner.readthedocs.io/en/stable/intro.html#runner-input-directory-hierarchy
So what runner & people expect is:
.
├── env
│   ├── envvars
│   ├── extravars
│   ├── passwords
│   ├── cmdline
│   ├── settings
│   └── ssh_key
├── inventory
│   └── hosts
└── project
    ├── test.yml
    └── roles
        └── testrole
            ├── defaults
            ├── handlers
            ├── meta
            ├── README.md
            ├── tasks
            ├── tests
            └── vars

What we were producing was something more like
├── cp
├── env
│   ├── cmdline
│   ├── envvars
│   ├── extravars
│   ├── passwords
│   ├── settings
│   └── ssh_key
├── project
│   ├── ansible.cfg
│   ├── ansible_env.yml
│   ├── async_tasks.yml
<snip>
│   └── vault.yml
└── tmp3evnorsu

There was no inventory folder, and inventory was stored in tmp3evnorsu as a top-level file. Any credential files were also saved in that same structure.
With this change, it's more like:
├── cp
├── env
│   ├── cmdline
│   ├── envvars
│   ├── extravars
│   ├── passwords
│   └── settings
├── inventory
│   └── tmp94xjm0d7
└── project
    ├── ansible.cfg
    ├── ansible_env.yml
    ├── async_tasks.yml
<snip>
    └── vault.yml

and any credential files (starting with tmp) are dumped into the env folder.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

API

AWX VERSION
14.1.0

ADDITIONAL INFORMATION
The motivation for this is that ansible-runner may require specific mounts for every file of directory in the private_data_dir. As such, we really don't want randomized filenames in the top level directory. I don't know for sure this is the direction we are going to go, but this seems like a defensible change on its own, to better adhere to the practices someone familiar with ansible-runner would expect.

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Chris Meyers <None>
2021-05-19 17:24:33 +00:00
Jeff Bradberry
2aa3fe756e Remove the remote user existence validation
since we are going to do a confirmation modal dialog instead.
2021-05-19 10:27:51 -04:00
softwarefactory-project-zuul[bot]
20dd436ee9
Merge pull request #10226 from wenottingham/one-more
Rename one more Tower bit.

Reviewed-by: Bianca Henderson <beeankha@gmail.com>
2021-05-19 00:59:02 +00:00
Bill Nottingham
34f4dc521b Rename one more Tower bit. 2021-05-18 19:26:18 -04:00
softwarefactory-project-zuul[bot]
7e307a69ce
Merge pull request #10217 from AlexSCorey/updatelingui
Updates LingUI Again

SUMMARY
This updates ling ui to bring in their latest release so that we don't have to run npm extract-strings every time we add/update a <Plural> or a string with a variable inside it.
ISSUE TYPE
-dependency upgrade
COMPONENT NAME

UI

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
2021-05-18 22:01:55 +00:00
Keith J. Grant
7f6e022852 rename replaceNamespacedParams to updateQueryString 2021-05-18 14:15:26 -07:00
softwarefactory-project-zuul[bot]
282914e809
Merge pull request #10191 from chrismeyersfsu/fix-threading_tracebacks
close db and cache connection in new threads

It's not safe to share or re-use django db connections nor django cache connections across new threads nor processes.

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-05-18 19:41:58 +00:00
Keith J. Grant
d324c12348 add qs test confirming default values are omitted 2021-05-18 12:20:24 -07:00
Keith J. Grant
fd5e22a3f6 fix integer fields in removeParams; maintain page_size/sort 2021-05-18 12:00:20 -07:00
softwarefactory-project-zuul[bot]
7eaf1db3e0
Merge pull request #10206 from tchellomello/update_ee_via_operator
Commits settings.DEFAULT_EXECUTION_ENVIRONMENTS updates into the database

SUMMARY
Fixes: ansible/awx-operator#256
cc: @shanemcd
Cannot update execution environment version in place by updating the AWX spec via awx-operator.  For example, consider the scenario below:
spec:
  tower_ee_images:
    - image: registry.tatu.home/ansible/awx-ee:0.1.0
      name: My Custom Execution Environment

The expectation would be once you modify the AWX spec to the version below, the EE should reflect this change once the awx-operator finishes its reconciliation.
After:
spec:
  tower_ee_images:
    - image: registry.tatu.home/ansible/awx-ee:0.2.0
      name: My Custom Execution Environment

-- deployment got updated
- args:
        - receptor
        - --config
        - /etc/receptor.conf
        image: registry.tatu.home/ansible/awx-ee:0.2.0
        imagePullPolicy: IfNotPresent
        name: awx-devel-ee-ee
Besides the awx-operator updated the YAML deployment as expected, the change did not hit the database.
awx=# select * from main_executionenvironment;
 id |    created    |   modified    | description |     image      | managed_by_tower | created_by_id | credential_id | modified_by_id | organization_id |      name      | pull 
----+---------------+---------------+-------------+----------------+------------------+---------------+---------------+----------------+-----------------+----------------+------
  1 | 2021-05-11 15.| 2021-05-11 15.|             | registry.tatu..| t                |             1 |               |              1 |                 | My Custom Exec.| 
    |.:24:02.674302.|.:24:02.674327.|             |.home/ansible/a.|                  |               |               |                |                 |.ution Environm.| 
    |.+00           |.+00           |             |.wx-ee:0.1.0    |                  |               |               |                |                 |.ent            | 
(1 row)
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


API

AWX VERSION

devel

ADDITIONAL INFORMATION


Quick proof of concept
>>> settings.DEFAULT_EXECUTION_ENVIRONMENTS
[{'name': 'My Custom Execution Environment', 'image': 'registry.tatu.home/ansible/awx-ee:0.2.0'}]
>>> [a.name for a in  ExecutionEnvironment.objects.all()]
['My Custom Execution Environment']
>>> [a.image for a in  ExecutionEnvironment.objects.all()]
['registry.tatu.home/ansible/awx-ee:0.2.0']

*** updating to new but keeping name 
>>> _, created = ExecutionEnvironment.objects.update_or_create(name='My Custom Execution Environment', defaults={'image': 'registry.tatu.home/ansible/awx-ee:0.3.0', 'managed_by_tower': True})
>>> [a.name for a in  ExecutionEnvironment.objects.all()]
['My Custom Execution Environment']
>>> [a.image for a in  ExecutionEnvironment.objects.all()]
['registry.tatu.home/ansible/awx-ee:0.3.0']

*** adding a new name
>>> _, created = ExecutionEnvironment.objects.update_or_create(name='My Custom Execution Environment2', defaults={'image': 'registry.tatu.home/ansible/awx-ee:0.3.0', 'managed_by_tower': True})
>>> [a.name for a in  ExecutionEnvironment.objects.all()]
['My Custom Execution Environment2', 'My Custom Execution Environment']
>>> [a.image for a in  ExecutionEnvironment.objects.all()]
['registry.tatu.home/ansible/awx-ee:0.3.0', 'registry.tatu.home/ansible/awx-ee:0.3.0']

Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
Reviewed-by: Shane McDonald <me@shanemcd.com>
2021-05-18 18:36:07 +00:00
softwarefactory-project-zuul[bot]
1b1608cff9
Merge pull request #10221 from jbradberry/check-for-pre-commit-script
Add a check for the existence of pre-commit.sh

SUMMARY
so that you don't get stuck when working on branches that don't have this yet.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

API

AWX VERSION

Reviewed-by: Christian Adams <rooftopcellist@gmail.com>
2021-05-18 18:33:54 +00:00
fedora
cb7b2289b7 Fixed Migration 2021-05-18 14:08:42 -04:00
fedora
c1ea489043 created a new model 'HostMetrics' which will contain the first timestamp and the most recent timestamp of any automation on a given object and Added a new 'awx-manage' command. command : awx-manage host_metrics --since <datetime> --until <datetime> 2021-05-18 13:56:45 -04:00
Jeff Bradberry
c887f84a05 Add a check for the existence of pre-commit.sh
so that you don't get stuck when working on branches that don't have this yet.
2021-05-18 13:20:55 -04:00
softwarefactory-project-zuul[bot]
fb7c827bff
Merge pull request #10068 from wenottingham/fail-early-fail-often
Have the project update playbook warn if role/collection syncing is disabled

In recent AWX, a galaxy credential (even a blank one for galaxy.ansible.com) is required to sync role/collection content. This is done so that server precedence can be properly set, and so that it can be configured to pull only from a private content host.
This does lead to bug reports where the credentials are not set, and users don't understand why their content is not syncing. This makes that more clear.

Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-05-18 15:29:21 +00:00
Alex Corey
5f03768f5d updates ling ui so that we do not need to run npm extract-strings as often 2021-05-18 10:53:36 -04:00
softwarefactory-project-zuul[bot]
df3bd2e082
Merge pull request #10133 from mabashian/ui-next-pendo
Adds support for pendo initialization across the app

SUMMARY
We were already bootstrapping pendo as part of the subscription code I just moved that code to a more general place.  When the app container mounts (after login or on refresh) we check to see if the pendo flag is turned on.  If it is, we initialize pendo.  If it's not then we do nothing.  If a user goes into settings and manually changes the pendo tracking setting then we trigger a hard reload of the browser tab (to take the new setting into account and either initialize or not).  This functionality existed in the old UI as well.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

UI

Reviewed-by: Michael Abashian <None>
Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-18 14:51:07 +00:00
softwarefactory-project-zuul[bot]
3d80eb30b3
Merge pull request #10209 from beeankha/fix_integration_tests
Fix failing integration test playbooks

SUMMARY

Addressing issue #10104

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME


Collections

Reviewed-by: Seth Foster <None>
Reviewed-by: Alan Rominger <arominge@redhat.com>
2021-05-18 14:13:25 +00:00
softwarefactory-project-zuul[bot]
5ad48bda6c
Merge pull request #10203 from jakemcdermott/add-default-error-boundary
Add default error boundary around screens

SUMMARY
Catch any unhandled non-async errors with an error boundary around screens. This will show a generic error message instead
of crashing the page.
The react docs decently summarize the general concept of error boundaries. The example code is informative, but there appears to be a few more edge cases that need to be dealt with. Rather than re-implement solutions for those, I decided to pull in a simple and well-tested library.
ADDITIONAL INFORMATION
before

after

Reviewed-by: Keith Grant <keithjgrant@gmail.com>
Reviewed-by: Kersom <None>
Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
2021-05-18 00:30:29 +00:00
softwarefactory-project-zuul[bot]
fd60105db3
Merge pull request #10005 from AlanCoding/force_on_override
Update with force option if branch_override

Addresses a reported issue where force-pushing to feature branches did not work.
Connect #9371 (comment)

Reviewed-by: Bill Nottingham <None>
2021-05-17 23:58:31 +00:00
Keith J. Grant
25903431bc refactor JobOutput to use replaceNamespacedParams util 2021-05-17 15:25:16 -07:00
Keith J. Grant
f8374def64 refactor ListHeader to use replaceNamespacedParams 2021-05-17 15:09:37 -07:00