Ryan Petrello
56e3d98e62
don't require credentials to relaunch a job
...
see: https://github.com/ansible/awx/issues/1291
2018-02-19 11:15:55 -05:00
Ryan Petrello
218dfb680e
changes to license compliance
...
now if a license is expired or over the managed node limit, it won't
prevent host creation or Job/JobTemplate launches
see: https://github.com/ansible/ansible-tower/issues/7860
2018-02-14 15:51:19 -05:00
Ryan Petrello
1c62c142f1
we don't use travis for tests; remove .travis.yml
2018-02-14 10:07:17 -05:00
Ryan Petrello
613d48cdbc
add support for new "BECOME" prompt in Ansible 2.5+ for adhoc commands
...
see: https://github.com/ansible/ansible-tower/issues/7850
2018-02-13 14:26:27 -05:00
Ryan Petrello
82e41b40bb
enforce strings for secret password inputs on Credentials
...
see: https://github.com/ansible/ansible-tower/issues/7898
2018-02-12 17:03:32 -05:00
Ryan Petrello
194c2dcf0b
improve a bwrap test
2018-02-12 10:14:37 -05:00
Ryan Petrello
2a168faf6a
upgrade to the latest pexpect
...
see: https://github.com/ansible/awx/issues/417
2018-02-12 09:18:14 -05:00
Ryan Petrello
605c5e3276
fix celery pid restart issues
2018-02-09 11:03:00 -05:00
Ryan Petrello
3c43aaef21
normalize dates in the Swagger output to minimize diffs
2018-02-09 10:16:27 -05:00
Ryan Petrello
fe02abe630
move swagger doc metadata out of the awx repo
2018-02-09 09:45:23 -05:00
Ryan Petrello
7472026cca
remove the new_in_<version> in API doc gen
...
see: https://github.com/ansible/awx/issues/73
2018-02-08 16:21:22 -05:00
Ryan Petrello
72715df751
fix a bug for "users should be able to change type of unused credential"
...
see: https://github.com/ansible/ansible-tower/issues/7516
related: https://github.com/ansible/tower/pull/441
2018-02-08 15:44:14 -05:00
Ryan Petrello
f2c5859fde
properly handle STDOUT_MAX_BYTES_DISPLAY for system jobs
...
see: https://github.com/ansible/ansible-tower/issues/7890
2018-02-08 11:37:05 -05:00
Ryan Petrello
5b9dc41015
add indention to swagger docs
...
this will make it easier to spot changes as our APIs change
2018-02-08 10:51:42 -05:00
Ryan Petrello
c866d85b8c
update zoneinfo endpoint to be a list of dicts
2018-02-08 09:12:26 -05:00
Ryan Petrello
3c799b007e
don't allow rrule values that contain both COUNT and UNTIL
...
see: https://github.com/ansible/ansible-tower/issues/7887
2018-02-08 08:59:52 -05:00
Ryan Petrello
887f16023a
improve detection of expensive DTSTART RRULE values
2018-02-08 08:54:30 -05:00
Ryan Petrello
1adb4cefec
fix a bad swagger-related import that breaks the build
2018-02-07 08:56:59 -05:00
Ryan Petrello
cc3659d375
fix a busted swagger import
2018-02-06 13:43:31 -05:00
Ryan Petrello
b1695fe107
add instructions for generating Swagger/OpenAPI docs
2018-02-06 13:37:33 -05:00
Ryan Petrello
8b976031cb
use VERSION_TARGET for Swagger doc generation
2018-02-06 10:48:51 -05:00
Ryan Petrello
7ff9f0b7d1
build example Swagger request and response bodies from our API tests
2018-02-06 10:36:25 -05:00
Ryan Petrello
527594285f
more Swagger template markup
2018-02-06 10:12:58 -05:00
Ryan Petrello
07dfab648c
add some tests to prove that OpenAPI JSON compilation works
2018-02-06 10:12:58 -05:00
Ryan Petrello
10974159b5
add support for marking Swagger paths deprecated
2018-02-06 10:12:58 -05:00
Ryan Petrello
ac7c5f8648
clean up API markdown docs
2018-02-06 10:12:57 -05:00
Ryan Petrello
57c22c20b2
add support for building swagger/OpenAPI JSON
...
to build, run `make swagger`; a file named `swagger.json` will be
written to the current working directory
2018-02-06 10:12:57 -05:00
Ryan Petrello
35230eded1
run the celery reload in a shell so the uwsgi hook isn't fatal on fail
2018-02-01 22:32:08 -05:00
Ryan Petrello
0a8df7fde2
work around a bug in dateutil that incorrectly parses Z dates
...
related: https://github.com/dateutil/dateutil/issues/349
2018-02-01 15:51:59 -05:00
Ryan Petrello
81bdbef785
fix a bug which can break the schedules list endpoint
...
see: https://github.com/ansible/ansible-tower/issues/7881
related: https://github.com/ansible/awx/pull/1095
2018-02-01 14:30:56 -05:00
Ryan Petrello
8ddc1c61ef
add related links to the inventory and project for a schedule
...
see: https://github.com/ansible/awx/issues/276
2018-01-31 15:18:11 -05:00
Ryan Petrello
0aa6c7b83f
remove some leaky mock.patch() that were causing sporadic test failures
2018-01-31 15:12:59 -05:00
Ryan Petrello
2a6f6111dc
add documentation for how awx uses/interacts with ansible
2018-01-31 14:02:18 -05:00
Ryan Petrello
81af34fce3
fix a bug which causes /api/v2/auth/ to list disabled auth backends
...
see: https://github.com/ansible/awx/issues/1073
2018-01-30 16:20:29 -05:00
Ryan Petrello
8fed469975
fix a bug in custom venv support that breaks legacy POST /api/v1/jobs
...
see: https://github.com/ansible/ansible-tower/issues/7876
2018-01-30 15:29:11 -05:00
Ryan Petrello
e642af82cc
fix a few bugs for scheduled jobs that run without inventories
...
see: https://github.com/ansible/ansible-tower/issues/7865
see: https://github.com/ansible/ansible-tower/issues/7866
2018-01-29 15:15:57 -05:00
Ryan Petrello
6753f1ca35
adhere to RFC5545 regarding UNTIL timezones
...
If the "DTSTART" property is specified as a date with UTC time or a date with
local time and time zone reference, then the UNTIL rule part MUST be specified
as a date with UTC time.
2018-01-29 12:42:31 -05:00
Ryan Petrello
982539f444
fix a bug when testing UDP-based logging configuration
...
see: https://github.com/ansible/ansible-tower/issues/7868
2018-01-29 12:05:51 -05:00
Ryan Petrello
6f0c937236
don't allow distant DTSTART values for schedules; it's slow
...
see: https://github.com/ansible/ansible-tower/issues/7869
2018-01-29 10:16:03 -05:00
Ryan Petrello
a15e257b9e
fix a unicode bug in the stdout endpoint when ?content_encoding=base64
...
see: https://github.com/ansible/awx/issues/1042
2018-01-25 15:53:43 -05:00
Ryan Petrello
e7ed4811c1
reload the entire celery worker pool when uwsgi reloads the Python app
...
this is for the development environment only; when uwsgi notices a code
change, it automatically reloads the uwsgi workers; this patch includes
a hook that sends `SIGHUP` to the celery process, causing it to spawn
a new set of workers as well
2018-01-25 14:59:40 -05:00
Ryan Petrello
ef80ecd3b6
only import the redbaron library on-demand
...
redbaron is a library we use to facilitate parsing local settings files;
at _import_ time it generates a parse tree and caches it to disk at
`/tmp`; this process is _really time consuming, and only necessary if
we're actually *using* the library
right now, we're importing this library and paying the penalty
_every_ time we load the awx application
2018-01-25 10:23:44 -05:00
Ryan Petrello
d57470ce49
don't process artifacts from custom set_stat calls asynchronously
...
previously, we persisted custom artifacts to the database on
`Job.artifacts` via the callback receiver. when the callback receiver
is backed up processing events, this can result in race conditions for
workflows where a playbook calls `set_stat()`, but the artifact data is
not persisted in the database before the next job in the workflow starts
see: https://github.com/ansible/ansible-tower/issues/7831
2018-01-23 17:09:23 -05:00
Ryan Petrello
9857c8272e
add more tests for weird timezone/DST boundaries in schedules
...
see: https://github.com/ansible/awx/pull/1024
2018-01-22 14:57:57 -05:00
Ryan Petrello
15906b7e3c
support TZID= in schedule rrules
...
this commit allows schedule `rrule` strings to include local timezone
information via TZID=NNNNN; occurrences are _generated_ in the local
time specific by the user (or UTC, if e.g., DTSTART:YYYYMMDDTHHMMSSZ)
while Schedule.next_run, Schedule.dtstart, and Schedule.dtend will be
stored in the UTC equivalent (i.e., the scheduler will still do math on
"what to run next" based on UTC datetimes).
in addition to this change, there is now a new API endpoint,
`/api/v2/schedules/preview/`, which takes an rrule and shows the next
10 occurrences in local and UTC time.
see: https://github.com/ansible/ansible-tower/issues/823
related: https://github.com/dateutil/dateutil/issues/614
2018-01-22 11:50:00 -05:00
Ryan Petrello
ac3f7d0fac
fix a bug that breaks workflows w/ a survey password + inventory sync
...
prior versions of awx did not raise an exception for this scenario
- they simply ignored kwargs that they couldn't accept. this change is
a sort of middle ground - it ignores them, but gives a clue in the logs
as to why
see: https://github.com/ansible/awx/issues/955
related: https://github.com/ansible/awx/pull/803
2018-01-22 09:41:30 -05:00
Ryan Petrello
43f19cc94b
fix another bug that breaks the JT callback process
...
see: https://github.com/ansible/awx/issues/980
related: 17cd0595d7
2018-01-18 13:17:06 -05:00
Ryan Petrello
e5aaeedc43
don't require an IRC password in the notification UI
...
see: https://github.com/ansible/awx/issues/1010
2018-01-18 09:14:22 -05:00
Ryan Petrello
dbb4d2b011
refactor credential injection for builtin types
...
this cleanups up a _lot_ of code duplication that we have for builtin
credential types. it will allow customers to setup custom inventory
sources that utilize builtin credential types (e.g., a custom inventory
script that could use an AzureRM credential)
see: https://github.com/ansible/ansible-tower/issues/7852
2018-01-17 16:50:28 -05:00
Ryan Petrello
838b793704
fix a minor unicode handling bug in project names
...
see: https://github.com/ansible/ansible-tower/issues/7853
2018-01-17 13:37:06 -05:00
Ryan Petrello
17cd0595d7
fix a bug which broke the callback plugin launch process
...
see: https://github.com/ansible/awx/issues/980
2018-01-17 11:28:13 -05:00
Ryan Petrello
51f7907a01
optimize OutputEventFilter for large stdout streams
...
update our event data search algorithm to be a bit lazier in event data
discovery; this drastically improves processing speeds for stdout >5MB
see: https://github.com/ansible/awx/issues/417
2018-01-16 14:41:35 -05:00
Ryan Petrello
2955842c44
don't overwrite env['ANSIBLE_LIBRARY'] when fact caching is enabled
...
see: https://github.com/ansible/awx/issues/815
see: https://github.com/ansible/ansible-tower/issues/7830
2018-01-15 13:39:46 -05:00
Ryan Petrello
e1d50a43fd
only allow facts to cache in the proper file system location
2018-01-15 11:45:49 -05:00
Ryan Petrello
983b192a45
replace our memcached-based fact cache implementation with local files
...
see: https://github.com/ansible/ansible-tower/issues/7840
2018-01-15 09:16:44 -05:00
Ryan Petrello
4a2ca20b60
fix a minor bug in the JT launch related to support for zero credentials
...
see: https://github.com/ansible/ansible-tower/issues/7841
2018-01-12 11:37:33 -05:00
Ryan Petrello
563f730268
add support for new "BECOME" prompt in Ansible 2.5+
...
see: https://github.com/ansible/ansible-tower/issues/7850
2018-01-12 10:40:40 -05:00
Ryan Petrello
b8758044e0
fix a bug in inventory generation for isolated nodes
...
see: https://github.com/ansible/ansible-tower/issues/7849
related: https://github.com/ansible/awx/pull/551
2018-01-11 10:41:58 -05:00
Ryan Petrello
a5007ccd41
fix a unicode handling bug
...
see: https://github.com/ansible/ansible-tower/issues/7843
related: https://github.com/ansible/awx/pull/807
2018-01-10 15:56:31 -05:00
Ryan Petrello
b01b229fea
add an example for custom virtualenv setup in containers
2018-01-10 13:48:55 -05:00
Ryan Petrello
4c40791d06
properly handle unicode for isolated job buffers
...
from: https://docs.python.org/2/library/stringio.html#module-cStringIO
"Unlike the StringIO module, this module is not able to accept Unicode
strings that cannot be encoded as plain ASCII strings."
see: https://github.com/ansible/ansible-tower/issues/7846
2018-01-10 10:56:59 -05:00
Ryan Petrello
4bb2b5768e
properly compose stdout downloads that contain unicode
2018-01-09 23:52:02 -05:00
Ryan Petrello
c0a641ed52
properly handle unicode for isolated job buffers
...
from: https://docs.python.org/2/library/stringio.html#module-cStringIO
"Unlike the StringIO module, this module is not able to accept Unicode
strings that cannot be encoded as plain ASCII strings."
see: https://github.com/ansible/ansible-tower/issues/7846
2018-01-09 23:46:17 -05:00
Ryan Petrello
1e8c89f536
implement support for per-playbook/project/org virtualenvs
...
see: https://github.com/ansible/awx/issues/34
2018-01-09 22:47:01 -05:00
Ryan Petrello
60743d6ba6
add the vault_id to the response payload on the JT launch endpoint
...
see: https://github.com/ansible/awx/issues/914
2018-01-04 15:13:48 -05:00
Ryan Petrello
f28f7c6184
refactor job event signal generation code
2018-01-04 12:50:12 -05:00
Ryan Petrello
1494c8395b
update websockets docs to reflect new event groups
2018-01-04 11:40:15 -05:00
Ryan Petrello
2691e1d707
make the fact caching plugin fail more gracefully for large payloads
...
related: https://github.com/ansible/ansible/pull/34424
2018-01-04 11:33:47 -05:00
Ryan Petrello
c6b6a3ad89
send and subcribe to summary events for all new events
2018-01-03 09:09:45 -05:00
Ryan Petrello
2bd656e61d
calculate stdout download length using the ORM, not raw SQL
2018-01-03 09:09:44 -05:00
Ryan Petrello
35b8e40d3c
remove deprecation from the stdout endpoint; text downloads still use it
2018-01-03 09:09:44 -05:00
Ryan Petrello
c4d901bf2c
add functional API tests for deprecated job event stdout composition
...
see: https://github.com/ansible/awx/issues/200
2018-01-03 09:09:44 -05:00
Ryan Petrello
1369f72885
add new API endpoints and websocket emit for new job event types
...
see: https://github.com/ansible/awx/issues/200
2018-01-03 09:09:44 -05:00
Ryan Petrello
0b30e7907b
change stdout composition to generate from job events on the fly
...
this approach totally removes the process of reading and writing stdout
files on the local file system at settings.JOBOUTPUT_ROOT when jobs are
run; now stdout content is only written on-demand as it's fetched for
the deprecated `stdout` endpoint
see: https://github.com/ansible/awx/issues/200
2018-01-03 09:09:43 -05:00
Ryan Petrello
fc94b3a943
generalize stdout event processing to emit events for *all* job types
...
* introduces three new models: `ProjectUpdateEvent`,
`InventoryUpdateEvent`, and `SystemJobEvent`
* simplifies the stdout callback management in `tasks.py` - now _all_
job run types capture and emit events to the callback receiver
* supports stdout reconstruction from events for stdout downloads for
_all_ job types
* configures `ProjectUpdate` runs to configure the awx display callback
(so we can capture real playbook events for `project_update.yml`)
* ProjectUpdate, InventoryUpdate, and SystemJob runs no longer write
text blobs to the deprecated `main_unifiedjob.result_stdout_text` column
see: https://github.com/ansible/awx/issues/200
2018-01-03 09:09:42 -05:00
Ryan Petrello
ea4cd99003
fix a few tests caused by fallout between 3.2.2 bugs and 3.3 multicred
2017-12-13 14:02:25 -05:00
Ryan Petrello
d35bfafcf5
more test cleanup from 3.2.2 merge
2017-12-13 13:14:22 -05:00
Ryan Petrello
a978d094b4
fix a number of failing unit tests related to the 3.2.2 merge
2017-12-13 13:03:17 -05:00
Ryan Petrello
202161f090
move legacy UnifiedJob stdout data to a separate unmanaged model
...
This data often (in the case of inventory updates) represents large data
blobs (5+MB per job run). Storing it on the polymorphic base class
table, `main_unifiedjob`, causes it to be automatically fetched on every
query (and every polymorphic join) against that table, which can result
in _very_ poor performance for awx across the board. Django offers
`defer()`, but it's quite complicated to sprinkle this everywhere (and
easy to get wrong/introduce side effects related to our RBAC and usage
of polymorphism).
This change moves the field definition to a separate unmanaged model
(which references the same underlying `main_unifiedjob` table) and adds
a proxy for fetching the data as needed
see https://github.com/ansible/awx/issues/200
2017-12-12 18:16:19 -05:00
Ryan Petrello
8c90d36290
add some more tests and acceptance docs to wrap up multivault support
...
see: https://github.com/ansible/awx/issues/352
2017-12-11 16:56:02 -05:00
Ryan Petrello
ce94ba4c83
change how we detect the current user to avoid a nuanced recursion error
...
see: https://github.com/ansible/ansible-tower/issues/7802
2017-12-08 15:35:47 -05:00
Ryan Petrello
1fb890f4eb
fix a race condition in "host.last_job" when jobs are deleted
...
see: https://github.com/ansible/ansible-tower/issues/7815
2017-12-06 11:30:19 -05:00
Ryan Petrello
fe93ef5488
more unit tests for survey default handling
2017-12-05 09:04:57 -05:00
Ryan Petrello
33dedc88c8
don't fetch stdout when purging jobs - it's slow and causes OOMs
...
see: https://github.com/ansible/ansible-tower/issues/7751
2017-12-04 15:14:55 -05:00
Ryan Petrello
112757e202
properly handle JT launch POST for required survey fields w/ no default
...
see: ansible/ansible-tower#7805
2017-12-04 09:45:21 -05:00
Ryan Petrello
12380fe1b1
add more tests for survey default encryption
...
see: https://github.com/ansible/ansible-tower/issues/7805
see: https://github.com/ansible/ansible-tower/issues/7806
see: https://github.com/ansible/ansible-tower/issues/7807
2017-12-04 09:45:14 -05:00
Ryan Petrello
6c7851b51f
fix another survey encryption-related bug
2017-12-01 17:11:00 -05:00
Ryan Petrello
1057b93570
refactor survey spec validation into a separate testable function
2017-12-01 15:34:07 -05:00
Ryan Petrello
8c6a1e348d
upgrade survey encryption migration to work around an old survey bug
...
see: https://github.com/ansible/ansible-tower/issues/7800
2017-12-01 11:34:47 -05:00
Ryan Petrello
a1f8f65add
support specifying multiple vault IDs for a playbook run
...
see: https://github.com/ansible/awx/issues/352
2017-11-30 16:55:17 -05:00
Ryan Petrello
a3dd9eb4b7
removing some cruft we thought would help us catch bugs (it didn't)
2017-11-29 16:23:07 -05:00
Ryan Petrello
68ada92f3b
more survey password encryption bug squashing
...
the nature of this latest bug is that the WorkflowJob has a *different*
implementation of _accept_or_ignore_job_kwargs, and it wasn't performing
encryption for extra vars provided at launch time; this change places the
encryption mechanism in UJT.create_unified_job so that it works the same
for _all_ UJTs
see: https://github.com/ansible/ansible-tower/issues/7798
see: https://github.com/ansible/ansible-tower/issues/7046
2017-11-29 14:40:41 -05:00
Ryan Petrello
1425021106
fix another encrypted survey password bug
...
properly encrypt extra_vars that overlap with survey passwords when
`ask_variables_on_launch=true`
see: https://github.com/ansible/ansible-tower/issues/7796
2017-11-28 16:52:47 -05:00
Ryan Petrello
26845642f0
fix a bug which caused v1 cred backwards-compat to apply to v2 requests
...
see: https://github.com/ansible/ansible-tower/issues/7793
2017-11-28 13:05:13 -05:00
Ryan Petrello
6fa0d9d4ed
rename oVirt4 to Red Hat Virtualization
...
see: https://github.com/ansible/ansible-tower/issues/7790
2017-11-28 11:02:42 -05:00
Ryan Petrello
044c047ac6
fix a bug in survey password default validation
...
see: https://github.com/ansible/ansible-tower/issues/7046
see: https://github.com/ansible/ansible-tower/issues/7764
see: https://github.com/ansible/ansible-tower/issues/7784
2017-11-27 17:25:45 -05:00
Ryan Petrello
a80d5b1b39
reencrypt WFJT.survey_spec too
...
https://github.com/ansible/ansible-tower/issues/7046
2017-11-16 23:00:22 -05:00
Ryan Petrello
4187d02b8a
make settings.AWX_ISOLATED_KEY_GENERATION readonly
...
see: https://github.com/ansible/ansible-tower/issues/7380
2017-11-16 13:35:37 -05:00
Ryan Petrello
35c374fc79
fix a bug in the survey reencryption migration
...
see: https://github.com/ansible/ansible-tower/issues/7046
2017-11-15 10:26:46 -05:00
Ryan Petrello
fa09d68603
add a few minor optimizations and some refactoring for multi-cred
2017-11-14 16:47:28 -05:00