Commit Graph
77 Commits
Author SHA1 Message Date
Jeff Bradberry 80a855c57a Do some basic slugification of the remediation playbook name 2019-04-22 14:17:47 -04:00
Jeff Bradberry a97865de0c Refactor HostInsights
for better reuse of the error handling of the Insights API calls.
2019-04-22 14:17:47 -04:00
Jeff Bradberry 63209197dd Iterate over the pages of remediations available 2019-04-22 14:17:47 -04:00
Jeff Bradberry af2484cd97 Update the Insights API urls to use the new url structure 2019-04-22 14:17:47 -04:00
Jeff Bradberry 04521f5c5c Update the Insights action plugin to make calls against the new API 2019-04-22 14:17:47 -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 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
softwarefactory-project-zuul[bot] 5debfdf5e8 Merge pull request #3545 from chrismeyersfsu/fix-tower_header_on_insights_playbook_fetches
include tower header to insights on plan fetch

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
2019-04-04 15:51:06 +00:00
Ryan Petrello 52a2ed2786 fix a py3 compat issue in the insights action plugin 2019-04-01 17:07:37 -04:00
chris meyers 71fcb1a82c process host facts for iso runs
* Move isolated clean to our final run hook
* ISO and non-iso code path now share the post-fact-processing code
2019-03-29 16:16:22 -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
chris meyers 926d6a6525 include tower header to insights on plan fetch
* We include a special header value in the user agent when tower proxies
requests to get per-host rules.
* This extends that header logic to when we fetch plans (playbooks)
2019-03-28 10:56:56 -04:00
Ryan Petrello 495dc2202f more iso cleanup and bug fixes 2019-03-25 17:47:58 -04:00
Ryan Petrello 602ef9750f update isolated task execution for ansible-runner 2019-03-18 14:21:47 -04:00
Bill Nottingham 5df384edd6 Fix project updates to properly pull in role requirements.
"check" runs check out the version that is saved in the database,
so for git repos, any subsequent "checkout" run on the same node
would always report that we have the proper version, and we would
not properly force a role update when requiremets.yml changes.

Also, don't use `scm_result` for all SCMs, as the skipped tasks will
overwrite earlier `scm_result` variables.
2019-02-06 13:20:09 -05:00
Ryan Petrello 18f6f68540 Merge remote-tracking branch 'tower/release_3.3.0' into devel 2018-08-10 11:54:34 -04:00
John Westcott IV 0ba8022eac #2073 - Support setting to prevent Tower from pulling from requirements.yml files for an SCM project 2018-07-23 09:37:49 -04:00
Ryan Petrello 84eacfc360 fix a few isolated dev issues
the main goal of this change is to make `make docker-isolated` work out
of the box

- specify the proper version for awx-expect --version
- update some deprecated playbook bits
- change the isolated container to privileged so bwrap will work
- fix awx-manage test_isolated_connection
- expedite the first isolated heartbeat so you don't have to wait 10m;
  this is accomplished by _not_ setting Instance.last_isolated_check to
  now() at insertion time (which causes the next check not to happen for
  10 minutes)
- fix a bug that caused isolated node execution to fail when bwrap was
  enabled

see: https://github.com/ansible/tower/issues/2150

This reverts commit 9863fe71dc.
2018-06-13 14:17:58 -04:00
Bill Nottingham efd0085ba2 Fix checkout of role requirements.
'omit' is only special as a module argument, it cannot be used in this way.
Hence, just have two conditional tasks.
2018-05-15 01:22:13 -04:00
Bill Nottingham c3d720cbd4 Fix checkout of role requirements.
'omit' is only special as a module argument, it cannot be used in this way.
Hence, just have two conditional tasks.
2018-05-15 01:20:51 -04:00
Bill Nottingham b3ca7acb41 Only pass --force if we have an scm_result (i.e., we ran an actual checkout/revision change.) 2018-04-25 13:46:46 -04:00
AlanCoding affaf23a6b fix deprecation warning for project update 2018-04-16 13:22:58 -04:00
Ryan Petrello 7d9e4d6e2f support fact caching for isolated hosts
see: https://github.com/ansible/awx/issues/198
2018-02-20 15:00:47 -05:00
Matthew Jones 9dbcc5934e Merge remote-tracking branch 'tower/release_3.2.2' into devel 2017-12-13 12:25:47 -05:00
Bill Nottingham a2b18a9f6e Add test to short-circuit checkout if revision is already checked out.
Move role checkout to a separate play, to work with this.
2017-11-08 18:29:59 -05:00
Bill Nottingham c827e73dac Update comments and task names. 2017-11-02 14:11:48 -04:00
AlanCoding 48ec69c4f5 retry cleanup of build artifacts for bwrap race condition 2017-10-26 13:33:21 -04:00
Bill Nottingham 871dc81da3 Avoid task duplication by using default(omit). 2017-10-25 21:30:46 -04:00
Bill Nottingham 1285e8ffef Add blocks around the different SCMs, for clarity purposes. 2017-10-25 16:58:41 -04:00
AlanCoding f03b40aa50 enforce max line length of 160 characters 2017-10-11 12:38:39 -04:00
Chris Meyers 3dea02ceac use insights v3 api 2017-07-31 11:04:15 -04:00
adamscmRH 3dcd6ef2c2 Blocks creation of Hosts, Groups, and IS for Smart Inventories
* Updated View unit tests

* Refactored Validators

* Validator Fix for Blocking
2017-07-28 16:24:09 -04:00
Ryan Petrello e29492a259 more tower -> awx for task execution and isolated tooling 2017-07-25 10:36:06 -04:00
Ryan Petrello 8ce1421c6a fix tower-expect -> awx-expect for isolated tower builds 2017-07-24 16:03:58 -04:00
Ryan Petrello d42ea31f75 use a named pipe for isolated secret passthrough (not stdin)
it's not unusual for the secret data we pass into the `run_isolated.yml`
playbook to be quite long, namely because it can contain RSA key
data; by passing this value into the ansible-playbook process using
`vars_prompt`, we're limited by pexpect's tty line limit (which looks
like it caps out around 4k).  Because of this, large payloads are
being truncated and causing job run failures.

this changes the implementation to use a named pipe instead, which
doesn't have the same limitation

see: #7183
2017-07-20 12:42:03 -04:00
Chris Meyers 6652a960b7 make insights playbook fetching an Ansible module
* Gone are the days of playbook abuse.
* Our project update can now call a single Insight Ansible module to
loop over the set of maintenance plans to download and save playbooks
for use by job templates.
2017-07-11 16:28:01 -04:00
Ryan Petrello 0a5b9c458b standardize tasks.py temporary file paths under a single parameter
see: #3472
2017-07-05 13:50:43 -04:00
AlanCoding 70b1b9c81d isolated connection timeout and log file for playbook out 2017-07-05 08:48:01 -04:00
Ryan Petrello 405c01a847 more isolated production tinkering
see: #5903
see: #6507
2017-06-29 09:35:26 -04:00
Alan Rominger 2c92f623d8 Merge pull request #6617 from ansible/isolated_setup
setup playbook and heartbeat for isolated deployments
2017-06-20 17:20:53 -04:00
AlanCoding 40287d8e78 multi-host isolated heartbeat w tower-isolated check
* use tower-expect command to determine job status when running
  the isolated heartbeat playbook
* grok JSON output of playbook to obtain result information
* run playbook against multiple isolated hosts at the same time
  (addresses scalability concerns)
2017-06-20 14:36:18 -04:00
Ryan Petrello c35d83df13 fix a race condition in isolated stdout processing 2017-06-19 16:59:03 -04:00
AlanCoding 1d9f2be0e4 add task in isolated heartbeat to delete rogue files 2017-06-19 12:13:36 -04:00
AlanCoding dd1a261bc3 setup playbook and heartbeat for isolated deployments
* Allow isolated_group_ use in setup playbook
* Tweaks to host/queue registration commands complementing setup
* Create isolated heartbeat task and check capacity
* Add content about isolated instances to acceptance docs
2017-06-19 12:13:36 -04:00
Ryan Petrello 1ea03aa4c9 more isolated task execution tweaking
* set a more reasonable default `AWX_ISOLATED_CHECK_INTERVAL`
* make manual cancellation work for high values of
  `AWX_ISOLATED_CHECK_INTERVAL`
* remove the `/tmp/ansible_tower/jobs/` symlink directory

see: #6616
2017-06-16 15:37:07 -04:00
Ryan Petrello 44e0c8621a isolated ramparts: replace systemd unit with a tower-expect binary
instead of launching isolated tasks via `systemctl`, treat
`awx.main.isolated.run` as an executable that knows how to daemonize

additionally, add `setup.py isolated_build` for isolated Tower source
distribution
2017-06-16 09:59:21 -04:00
Ryan Petrello 422950f45d Support for executing job and adhoc commands on isolated Tower nodes (#6524) 2017-06-14 11:47:30 -04:00
Chris Meyers 0c034f29af use insights etag as a cache
* During insights project updates, if the etag from insights matches the
last etag (scm_revision) then don't get all the maintenance playbooks.
Otherwise, get all the maintenance playbooks and update scm_revision
with the etag.
2017-05-30 18:30:13 -04:00
Chris Meyers b9b0b29d97 associate insights machine id w/ host on fact scan
* Add inisghts fact scan module
* Update fact scan playbook to call new insight fact scan module
* JT run w/ store_facts=True will save scanned facts. We "skim" the
machine_id fact from Insights fact scans and associate it with the host
that the fact scan came from.
2017-05-11 11:20:52 -04:00
Matthew Jones 189ea4d7f8 Fix insights related spelling mistake that could cause failure 2017-04-06 10:57:19 -04:00