Refactoring interface common routines#1079
Conversation
This should also fix up direct role execution when run from the command line using an execution environment
| # If running via the transmit-worker-process method, we must only extract things as read-only | ||
| # inside of one of these commands. That could be either transmit or worker. | ||
| if kwargs.get('streamer') not in ('worker', 'process'): | ||
| if kwargs.get('process_isolation') or kwargs.get('streamer') not in ('worker', 'process'): |
There was a problem hiding this comment.
These lines are what I was really looking for in here. Trying to use direct role execution from the CLI using an execution environment didn't work because of the path assignment behavior.
There was a problem hiding this comment.
Whoa, wait. Just on the surface of it, it seems like making this change would break the transmit phase of streaming runner.
There was a problem hiding this comment.
... or I misread the logic.
There was a problem hiding this comment.
After reconsidering, though, I'm not sure how it helps to do the dump_artifacts writing to disk in the worker and processor cases when we have process isolation? The worker should already have everything by unzipping everything that came over the wire from the transmit phase, and I don't think that the processor phase needs any of it.
There was a problem hiding this comment.
In practice, artifacts shouldn't be getting dumped because of suppress_env_files
| if vargs.get('command') in ('transmit', 'worker', 'process'): | ||
| streamer = vargs.get('command') | ||
|
|
||
| # TODO: Remove / Refactor unused role context manager |
|
I tested in conjunction with AWX / AAP controller, and normal jobs error with this from the worker: In this case, it should be running a normal playbook, but it seems to somehow interpret that as direct role execution. |
This should also fix up direct role execution when run from the command line using an execution environment.
Still need to sort out some tests and make sure the cli entrypoint is doing the right thing in all circumstances.