Commit Graph

797 Commits

Author SHA1 Message Date
Ryan Petrello
471ff69257 stop setting celery's hostname dynamically (it's passed via the cli) 2018-06-19 12:16:00 -04:00
Ryan Petrello
ef6433c6f9 Revert "fix celery task reaper"
This reverts commit 1359208a99.
2018-06-18 16:18:20 -04:00
chris meyers
1359208a99 fix celery task reaper
* celery workers have internal queue names that are named after the
system hostname. This may differ from what tower knows the host by,
Instance.hostname
This adds a mapping so we can convert internal celery names to Instance
names for purposes of reaping jobs.
2018-06-15 16:56:53 -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
chris meyers
fb11967114 remove isolated instance group queue listening 2018-06-08 13:46:58 -04:00
chris meyers
7b0b4f562d get isolated execution at the point its needed
* Instead of passing around the isolated host that the task is to
execute on; grab the isolated execution host from the instance further
down the call stack. Without passing the isolated hostname around.
2018-06-04 10:06:59 -04:00
chris meyers
8d352a4edf conform isolated system to new early node choice
* Randomly chose an instance in the controller instance group for which
to control the isolated node run. Note the chosen instance via a job
controller_node field
2018-06-04 10:06:59 -04:00
chris meyers
e720fe5dd0 decide the node a job will run early
* Deciding the Instance that a Job runs on at celery task run-time makes
it hard to evenly distribute tasks among Instnaces. Instead, the task
manager will look at the world of running jobs and choose an instance
node to run on; applying a deterministic job distribution algo.
2018-06-04 10:06:59 -04:00
Ryan Petrello
8c5f3404bf Merge pull request #2006 from ryanpetrello/port-jinja2-always
allow Jinja2 in ansible -a when ALLOW_JINJA_IN_EXTRA_VARS is 'always'
2018-06-01 07:32:48 -04:00
Ryan Petrello
99d2f3ea34 allow Jinja2 in ansible -a when ALLOW_JINJA_IN_EXTRA_VARS is 'always' 2018-05-31 11:49:50 -04:00
AlanCoding
124fcd6f62 delete network canvas objects in delete inventory task 2018-05-30 12:03:20 -04:00
Ryan Petrello
870adc14f9 fix a bug in the instance policy algorithm when both min and % are used
see: https://github.com/ansible/tower/issues/897
2018-05-24 12:28:46 -04:00
AlanCoding
d369ae7638 do not put deep copy items in activity stream 2018-05-22 16:23:08 -04:00
Wayne Witzel III
9fe44cfaae check EACCES and only refresh cancel_flag 2018-05-18 14:58:58 -04:00
Wayne Witzel III
41fe9e1caf Check if the project update for the project we are trying to lock is canceled 2018-05-18 12:46:54 -04:00
AlanCoding
f9871f32a3 do not fail entire notification chain if one fails 2018-05-16 15:16:40 -04:00
Ryan Petrello
3ab7f06f95 run scm inv syncs at the project root so relative imports work w/ bwrap
see: https://github.com/ansible/tower/issues/1357
2018-05-15 12:00:37 -04:00
Wayne Witzel III
e7e173b576 Merge pull request #1790 from wwitzel3/fix-1744
Prevent creating excessive update computed tasks when copying an Inve…
2018-05-15 08:37:49 -04:00
Wayne Witzel III
5c45b25484 Prevent creating excessive update computed tasks when copying an Inventory 2018-05-15 08:17:48 -04:00
Alan Rominger
5643505a31 Merge pull request #1664 from AlanCoding/more_wfjt_cred_fixes
Correctly check credential permission on WFJT copy
2018-05-10 07:42:49 -04:00
AlanCoding
5a37184e7c add log message when locks are holding up jobs 2018-05-07 07:44:08 -04:00
chris meyers
5668d215fd better cluster membership policy log messages 2018-05-03 11:44:46 -04:00
Wayne Witzel III
538c15141a Merge pull request #1675 from wwitzel3/fix-879
Bulk update host field to null for JobEvents
2018-05-03 11:15:15 -04:00
Wayne Witzel III
91a2466650 Bulk update host field to null for JobEvents 2018-05-03 10:48:36 -04:00
AlanCoding
ec1e94376c correctly check credential permission on WFJT copy 2018-05-03 07:42:59 -04:00
Chris Meyers
a50358afc5 Merge pull request #1638 from chrismeyersfsu/fix-isolated_heartbeat
control celery routes using celery router
2018-05-02 13:51:58 -04:00
chris meyers
9f745dd3b8 control celery routes using celery router
* Each time a route is needed (i.e. when a task is sumitted to celery).
The router will be queried. This is ideal. With the previous method we
had to consider how a change in the routes would propogate to all celery
workers and nodes.

* fully describe the default awx queue
* Our dynamic queue registration would correct awx_private_queue.
However, we don't want celery to even create an "invalid"/extra
queue-exchange-route. This change makes sure we don't create extranious
things in rabbitmq.

* reduce the cluster queue registration output. Only output when the
queue registration list changes.
2018-05-02 12:57:36 -04:00
Ryan Petrello
30af0a1b44 don't run scheduled jobs if there isn't a valid license 2018-05-02 11:52:51 -04:00
AlanCoding
ac20aa954a Replace logging-related restart with dynamic handler
refactor existing handlers to be the related
  "real" handler classes, which are swapped
  out dynamically by external logger "proxy" handler class

real handler swapout only done on setting change

remove restart_local_services method
get rid of uWSGI fifo file

change TCP/UDP return type contract so that it mirrors
  the request futures object
add details to socket error messages
2018-05-02 09:47:22 -04:00
Christian Adams
fd4f78a64c Merge pull request #1637 from rooftopcellist/exp_setting_update
Token Expiration Setting Update
2018-05-01 15:05:33 -04:00
adamscmRH
1963ab689a rm an unnecessary uwsgi restart 2018-05-01 14:12:00 -04:00
chris meyers
648d9165ff broadcast queues get a per-node stable queue name
* Using Kombu's default Broadcast() constructor requires only 1
parameter. That parameter defines the exchange name and the queue name
is randomly generated per-node.
* This caused problems if/when celery enters an infinite restart loop
because too many rabbit queues get created and rabbit OOM's
(gracefully).
* To remedy this we tell Broadcast the queue name to use, which is
derived from some constant + the node name so that the per-node queue
name is stable.
2018-05-01 13:09:10 -04:00
Ryan Petrello
a009d21edc Merge pull request #1592 from ryanpetrello/release_3.3.0
3.2.4 -> 3.3.0
2018-04-26 11:34:16 -04:00
Ryan Petrello
1eb5e98743 Merge branch 'release_3.2.4' into release_3.3.0 2018-04-26 11:10:28 -04:00
AlanCoding
52d8d851fe avoid unrelated errors saving notification 2018-04-26 09:36:43 -04:00
Ryan Petrello
0bc5665e92 remove the legacy fact cleanup system template
see: https://github.com/ansible/tower/issues/1021
2018-04-25 14:20:19 -04:00
chris meyers
a56771c8f0 send all tower work to a user-hidden queue
* Before, we had a special group, tower, that ran any async work that
tower needed done. This allowed users fine grain control over which
nodes did background work. However, this granularity was too complicated
for users. So now, all tower system work goes to a special non-user
exposed celery queue. Tower remains the fallback instance group to
execute jobs on. The tower group will be created upon install and
protected from deletion.
2018-04-20 13:04:36 -04:00
Ryan Petrello
fe47b75aad use a three-prong setting for Jinja extra vars policy 2018-04-17 12:08:07 -04:00
Ryan Petrello
7074dcd677 don't allow usage of jinja templates in certain ansible CLI flags
see: https://github.com/ansible/tower/issues/1338
2018-04-17 09:20:05 -04:00
Ryan Petrello
88c243c92a mark all unsafe launch-time extra vars as !unsafe
see: https://github.com/ansible/tower/issues/1338
see: https://bugzilla.redhat.com/show_bug.cgi?id=1565865
2018-04-16 16:47:44 -04:00
Bill Nottingham
bba7f45972 Pass extra vars via file rather than via commandline, including custom creds.
The extra vars file created lives in the playbook private runtime
directory, and will be reaped along with the rest of the directory.

Adjust assorted unit tests as necessary.
2018-04-16 16:31:50 -04:00
AlanCoding
4ff2f3e061 remove setting corresponding to removed tests 2018-04-16 14:49:54 -04:00
AlanCoding
0a23195a7b always log uncaught task exceptions 2018-04-11 11:03:06 -04:00
Ryan Petrello
ba66996add missing import for celery failure handler 2018-04-09 09:10:50 -04:00
Ryan Petrello
4c0096a524 implement celery failure logging using CELERY_ANNOTATIONS
see: https://github.com/ansible/awx/issues/1720
see: https://github.com/ansible/tower/issues/1190
2018-04-06 11:23:23 -04:00
Alan Rominger
c2446beb6e Merge pull request #1235 from AlanCoding/rm_TOWER_HOST
remove TOWER_HOST from job env vars
2018-04-04 10:42:16 -04:00
AlanCoding
c064195025 remove TOWER_HOST from job env vars 2018-04-04 10:32:41 -04:00
Ryan Petrello
0db24a5c97 more gracefully account for undefined stdout
see: https://github.com/ansible/tower/issues/1215
related: https://github.com/ansible/tower/pull/1192#issuecomment-377982131
2018-04-04 08:29:57 -04:00
chris meyers
88fbb6706f use non-deprecated way of setting many2many 2018-04-03 14:31:37 -04:00
chris meyers
c3100afd0e fixed isolated instance query
* Was considering an isolated instance: any instance that has at least 1
group with no controller. This is technically correct since an iso node
can not be a part of a non-iso group.
* The query is now more robust and considers a node an iso node if ALL
groups that a node belong to ALL have a controller.
* Also added better debugging for the special tower instance group
* Added a check for the existance of the special tower group so that
logs are less "messy" during the install process.
2018-04-03 13:50:57 -04:00