Commit Graph
100 Commits
Author SHA1 Message Date
Ryan Petrello 586c3e4583 document CORS middleware 2019-04-26 11:00:33 -04:00
Ryan Petrello d11dfd0a2b Merge branch 'downstream' into devel 2019-04-26 08:02:04 -04:00
Ryan Petrello 27d74528c0 Merge pull request #3494 from rooftopcellist/analytics_csv
analytics table copies formatted as csv now
2019-04-25 14:48:59 -04:00
Ryan Petrello 0ada1e965f Merge pull request #3508 from ryanpetrello/runner-134
pin runner 1.3.4
2019-04-25 10:16:05 -04:00
Ryan Petrello 2808a852eb pin runner 1.3.4 2019-04-25 09:49:03 -04:00
Ryan Petrello c9424f9af8 fix a few issues with license counts in /api/v2/metrics/
- switched these to gauges so people can track them over time
- fixed a typo that caused `free_instances` to always be zero
2019-04-24 12:23:07 -04:00
Ryan Petrello 519d2eebcb remove unnecessary dotfiles 2019-04-23 17:23:15 -04:00
Ryan Petrello 787e369bcf pin runner to 1.3.3 2019-04-22 12:57:55 -04:00
Ryan Petrello eb0463890c add a loud warning about perf regressions to tasks.py 2019-04-22 10:26:58 -04:00
Ryan Petrello 4159a9b6af make deprecation warnings at /api/ much more obvious 2019-04-18 12:32:49 -04:00
Ryan Petrello d6ecb486d2 deprecate /api/v2/dashboard in favor of /api/v2/metrics 2019-04-18 11:45:37 -04:00
Ryan Petrello 9d000a76de properly set ansible_python_interpreter for local task execution
this works a limitation in ansible for connection: local and makes it so
that you can run connection: local playbooks with a /usr/bin/python that
is Python3 and an Ansible virtualenv that is Python2

see: https://github.com/ansible/awx/issues/3267
2019-04-16 21:24:23 -04:00
Ryan Petrello f1d87bf392 fix a bug that breaks the isolated heartbeat 2019-04-16 16:24:40 -04:00
Ryan Petrello 387682ed8d if runner crashes, attempt to record why
this attempts to surface the underlying runner exception for tracebacks
like this one:

FileNotFoundError: [Errno 2] No such file or directory:
'/tmp/awx_41_93gtgv25/artifacts/41/status'
2019-04-15 13:17:45 -04:00
Ryan Petrello 17a803f49c remove the old callback plugin import paths and callback-specific tests 2019-04-12 16:11:23 -04:00
Ryan Petrello 85898fd708 remove more unnecessary feature flagging for AUTHENTICATION_BACKENDS 2019-04-12 11:28:27 -04:00
Ryan Petrello 0c4ed78bee pin ansible runner to 1.3.2 2019-04-11 12:57:07 -04:00
Ryan Petrello 01a79dd23e remove COMPONENT NAME from our issue templates
this is a remnant from our closed sourced days; upstream bug reporters
only fill this out correctly like 50% of the time, and it's often
difficult to know without knowing how AWX actually works
2019-04-09 12:49:11 -04:00
Ryan Petrello aa0179690d expose CredentialType.namespace in the API
see: https://github.com/ansible/awx/issues/3644
2019-04-08 19:02:10 -04:00
Ryan Petrello fc9da002d2 add an example config file and make target for starting a prometheus 2019-04-08 12:01:46 -04:00
Ryan Petrello dfd4cb55e5 add a unique UUID for identifying an AWX installation 2019-04-05 20:10:55 -04:00
Ryan Petrello a9a479a51b fix a typo 2019-04-05 14:28:39 -04:00
Ryan Petrello cd90ad2497 fix a small bug related to failed inventory counts in the dashboard API 2019-04-05 14:02:19 -04:00
Ryan Petrello 81fe923577 don't write playbook stdout to sys.stdout (it's duplicated in log files)
this instructs runner to _not_ write to stdout when we invoke
runner.interface.run(); AWX consumes/ingests this strictly as events
2019-04-05 11:20:34 -04:00
Ryan Petrello 79d580d5b9 update periodic isolated cleanup to match the new paths post-runner 2019-04-05 09:43:27 -04:00
Ryan Petrello 5a4a812c73 specify --forks on isolated health check calls
this requires ansible-runner 1.3.2
2019-04-04 20:12:14 -04:00
Ryan Petrello 5c5173956d add some additional analytics metrics 2019-04-04 20:10:54 -04:00
Ryan Petrello ce2fc1a9dd fix more py3 centos7 issues 2019-04-04 18:35:59 -04:00
Ryan Petrello 78cd1abbb2 fix a bug in isolated OpenSSH key syncing
OpenSSH keys _must_ end with a \n to be accepted by ssh-add; enforce
a newline if there isn't one
2019-04-03 11:53:45 -04:00
Ryan Petrello 0768c6ac1d store the public key for HashiVault signing in the plugin metadata 2019-04-02 11:21:47 -04:00
Ryan Petrello 2824616ba6 add support for CyberArk Conjur (API v5) 2019-04-02 11:21:44 -04:00
Ryan Petrello 81a509424a prefetch related source credentials in tasks.py 2019-04-02 11:21:33 -04:00
Ryan Petrello 42f4956a7f enforce required credential fields at job start time rather than on save
this is necessary for credential plugins support so that you can (in two
requests):

1.  Save a Credential with _no_ input values defined
2.  Create/associate one (or more) CredentialInputSource records to the
    new Credential
2019-04-02 11:21:29 -04:00
Ryan Petrello 368d933799 remove association behavior from /api/v2/credentials/input_sources/ 2019-04-02 11:21:14 -04:00
Ryan Petrello b911f8bf77 allow creation at /api/v2/credential_input_sources 2019-04-02 11:21:06 -04:00
Ryan Petrello e727909a61 rename the CredentialInputSource related_names so they're plural 2019-04-02 11:21:02 -04:00
Ryan Petrello 13366c1e75 Encrypt machine.ssh_public_key_data (in case users paste in signed data) 2019-04-02 11:20:58 -04:00
Ryan Petrello ca6d124417 add API examples for supported credential plugins 2019-04-02 11:20:55 -04:00
Ryan Petrello 35cca68f04 add RBAC definitions for CredentialInputSource 2019-04-02 11:20:51 -04:00
Ryan Petrello dcf17683e2 mark cred plugin strings for translation 2019-04-02 11:20:48 -04:00
Ryan Petrello b851e2be4a don't add hvac as a dependency for hashicorp vault integration
hvac is just based on requests anyways, and it doesn't support half of
what we need (like the SSH secrets engine API)
2019-04-02 11:20:44 -04:00
Ryan Petrello 69368d874e move path parameterization to the CredentialInputSource model 2019-04-02 11:20:36 -04:00
Ryan Petrello 7a43f00a5d add support for HashiCorp signed SSH certificates 2019-04-02 11:20:29 -04:00
Ryan Petrello 4ed5bca5e3 add credential plugin support for Azure Key Vault 2019-04-02 11:20:26 -04:00
Ryan Petrello 0a87469225 give credential plugins an explicit namespace 2019-04-02 11:20:22 -04:00
Ryan Petrello 63997838cd support HashiCorp Vault versioned secrets (API v2) 2019-04-02 11:20:19 -04:00
Ryan Petrello 89b731a0cb Improve the HashiCorp Vault KV name and field labels/help_text 2019-04-02 11:20:15 -04:00
Ryan Petrello 9036ba492c switch CredentialInput creation to use the associate/disassociate view 2019-04-02 11:20:10 -04:00
Ryan Petrello 52a2ed2786 fix a py3 compat issue in the insights action plugin 2019-04-01 17:07:37 -04:00
Ryan Petrello 7ef68a03c6 index unified_job.status
this is a fairly importantj column that we join on for a number of
queries throughout AWX, particularly the task scheduler and analytics
2019-03-29 12:59:43 -04:00
Ryan Petrello 563a0cc2a4 move awx.main.expect to awx.main.isolated 2019-03-29 12:14:40 -04:00
Ryan Petrello a59bc33280 slightly refactor isolated event consumption 2019-03-29 10:48:42 -04:00
Ryan Petrello 8f089c02a5 fix some faulty logic in isolated syncs that caused SSH keys to not work 2019-03-29 10:32:24 -04:00
Ryan Petrello d663d397f8 clean up some isolated adhoc code
if it's adhoc, there's not project directory to copy
2019-03-29 10:31:56 -04:00
Ryan Petrello 546281d435 work around a bug where runner doesn't provide atomic event writes 2019-03-29 10:31:12 -04:00
Ryan Petrello 9160d91278 clean up old usage of idle_timeout
cmeyers and I looked at this and can't tell where/why/how you'd actually
set this setting - it looks like really old ~2014-2015 Tower history
that probably isn't actually in use
2019-03-28 17:31:32 -04:00
Ryan Petrello ab11f18957 send an EOF event if isolated dispatch fails 2019-03-28 16:48:52 -04:00
Ryan Petrello ea30547754 remove main.expect tests (this functionality exists in runner now) 2019-03-28 16:13:14 -04:00
Ryan Petrello dd81f59d9a set PYTHONPATH properly for isolated usage of runner 2019-03-28 12:40:21 -04:00
Ryan Petrello 99478f5d25 replace our usage of pexpect in IsolatedManager with ansible-runner 2019-03-28 12:40:21 -04:00
Ryan Petrello c586fa9821 add a minimal framework for generating analytics/metrics
annotate queries & add license analytics
2019-03-27 19:53:00 -04:00
Ryan Petrello a983d4bc1f properly handle isolated cancellation 2019-03-27 11:44:26 -04:00
Ryan Petrello f7cffbfe5c pin runner 1.3.1 2019-03-27 11:23:25 -04:00
Ryan Petrello 8e4a87d0af fix tests for add /etc/ssh in bind mounted folder 2019-03-26 08:04:16 -04:00
Ryan Petrello b2a1824d21 store set_stat data for isolated job runs 2019-03-25 18:53:42 -04:00
Ryan Petrello 495dc2202f more iso cleanup and bug fixes 2019-03-25 17:47:58 -04:00
Ryan Petrello 8674e3b4de remove an errant console.log 2019-03-25 15:24:34 -04:00
Ryan Petrello af8e071840 remove old callback plugin code and tests 2019-03-25 12:26:51 -04:00
Ryan Petrello e6abd77c96 remove py2 compatability from awx.main.expect.run
this module is no longer run on isolated nodes (they use runner now)
2019-03-25 12:26:47 -04:00
Ryan Petrello 42bfff301c remove python-memcached as a base dependency for playbook execution 2019-03-25 12:26:44 -04:00
Ryan Petrello b02d9ae282 pin apache-libcloud to a version that doesn't use PyCrypto
once a new version lands on PyPI, we'll pin to _it_
2019-03-21 14:21:04 -04:00
Ryan Petrello 602ef9750f update isolated task execution for ansible-runner 2019-03-18 14:21:47 -04:00
Ryan Petrello 32ee9838af use the correct logger for the callback receiver
the callback receiver and dispatcher share several modules, so add logic
to use the correct logger
2019-03-15 08:09:47 -04:00
Ryan Petrello 50d8eb30e1 fix a failing test in the unit-test target used to generate swagger docs 2019-03-12 14:59:24 -04:00
Ryan Petrello 023fbc931d generate Swagger schemas as if view permissions didn't matter
this fixes several scenarios where certain POST endpoints don't show up
in our generated Swagger doc; /api/swagger is only
discoverable/accessible in the development environment where we generate
the schema
2019-03-11 21:26:32 -04:00
Ryan Petrello 13c05c68fc fix a few additional py3 issues
related: https://github.com/ansible/awx/issues/3329
2019-02-27 16:56:36 -05:00
Ryan Petrello 04622d5786 remove redbaron and update dependencies 2019-02-21 10:08:24 -05:00
Ryan Petrello b1a33869dc convey OpenStack verify_ssl defaults in the CredentialType schema 2019-02-20 09:02:48 -05:00
Ryan Petrello 43ca4526b1 define native CredentialType inputs/injectors in code, not in the DB
This has a few benefits:

1.  It makes adding new fields to built-in CredentialTypes _much_
    simpler.  In the past, we've had to write a migration every time we
    want to modify an existing type (changing a label/help text,
    changing options like the recent become_method changes) or
    when adding a new field entirely

2.  It paves the way for third party credential plugins support, where
    importable libraries will define their own source code-based schema
2019-02-19 10:22:26 -05:00
Ryan Petrello 1e4cd9ea8f document the SQL profiler 2019-02-15 16:34:34 -05:00
Ryan Petrello 954ccccbc5 fix a bug in the display of playbooks using serial or free strategy 2019-02-15 16:13:12 -05:00
Ryan Petrello 6f43875e80 record profile data in /var/log/tower, not /var/lib/awx 2019-02-15 14:34:55 -05:00
Ryan Petrello 4f83d44142 mark a workflow convergence error message for i18n 2019-02-14 15:55:20 -05:00
Ryan Petrello eed94b641e add a custom DB backend that provides system-level SQL profiling
run this command on _any_ node in an awx cluster:

$ awx-manage profile_sql --threshold=2.0 --minutes=1

...and for 1 minute, the timing for _every_ SQL query in _every_ awx
Python process that uses the Django ORM will be measured

queries that run longer than (in this example) 2 seconds will be
written to a per-process sqlite database in /var/lib/awx/profile, and
the file will contain an EXPLAIN VERBOSE for the query and the full
Python stack that led to that SQL query's execution (this includes not
just WSGI requests, but background processes like the runworker and
dispatcher)

$ awx-manage profile_sql --threshold=0

...can be used to disable profiling again (if you don't want to wait for
the minute to expire)
2019-02-14 15:04:46 -05:00
Ryan Petrello 9bebf3217e remove usage of import * and enforce F405 in our linter
import * is a scourge upon the earth
2019-02-13 17:10:33 -05:00
Ryan Petrello 2a94611801 fix /migrations_notran 2019-02-13 08:59:20 -05:00
Ryan Petrello e4eda3ef0d remove field size limit on adhoc limit
related: 4b669fb16d
2019-02-13 08:34:10 -05:00
Ryan Petrello e245e50ee4 optimize a slow query in inventory script generation
if we don't preload this column, Django needs it, and so it generates
one query per-host (!!!) to get it.  For large (10k+ host) inventories,
this is incredibly slow.

see: https://github.com/ansible/awx/issues/3214
2019-02-12 12:55:38 -05:00
Ryan Petrello 229e997e7e don't update parent event changed|failed in bulk (it's expensive) 2019-02-06 20:02:52 -05:00
Ryan Petrello a6b362e455 fix a subtle bug in ansible_facts lookup filtering 2019-02-06 11:02:47 -05:00
Ryan Petrello 5e84782b9c provide a better ansible-inventory fallback error message old ansibles
see: https://github.com/ansible/awx/issues/3139
2019-02-05 17:12:48 -05:00
Ryan Petrello bb5312f4fc prevent field lookups on Host.ansible_facts keys (it doesn't work)
under the hood, Host.ansible_facts is a postgres jsonb field which
performs match operations using the JSON containment operator (@>)

this operator _only_ works on exact matches on containment (i.e.,
"does the `ansible_distribution` jsonb value contain _this exact_ JSON
structure"):

SELECT ...
FROM main_host
WHERE ansible_facts @> '{"ansible_distribution": "centos"}'

SELECT ...
FROM main_host
WHERE ansible_facts @> '{"packages": {"dnsmasq": [{"version": 2}]}}'

postgres does _not_ expose any operator for fuzzy or lookup-based
matches with this operator, so host filter values like these don't
really make sense (postgres can't _filter_ in the way intended in these
examples):

ansible_distribution__startswith=\"Cent\"
ansible_distribution__icontains=\"CentOS\"
ansible_facts__packages__dnsmasq[]__version__startswith=\"2\"
2019-02-05 10:43:51 -05:00
Ryan Petrello 10945faba1 properly detect ansible-playbook vs ansible runs in bwrap arg building
a recent change (65641c7) made it so that we call
ansible-playbook using its _absolute path_ (i.e.,
/usr/bin/ansible-playbook, /var/lib/venv/xyz/bin/ansible-playbook), so
this logic is no longer correct
2019-01-31 11:06:50 -05:00
Ryan Petrello d10d5f1539 work around a bug in Django that breaks the stdout HTML view in py3
see: https://github.com/ansible/awx/issues/3108
2019-01-31 01:01:40 -05:00
Ryan Petrello 1eeffe4ae2 remove awx-manage migrate_to_database_settings 2019-01-30 12:23:36 -05:00
Ryan Petrello 2927803a82 fix overindent lint failures 2019-01-30 12:12:39 -05:00
Ryan Petrello 88eaf1154a move awx.main.utils.ansible tests data into the correct location 2019-01-25 11:11:12 -05:00
Ryan Petrello daeeaf413a clean up unnecessary usage of the six library (awx only supports py3) 2019-01-25 00:19:48 -05:00
Ryan Petrello 4707dc2a05 clean up some unnecessary dispatcher reaping code 2019-01-24 11:11:05 -05:00
Ryan Petrello 9817ab14d0 clean up some minor linting issues 2019-01-24 10:23:56 -05:00