Commit Graph

143 Commits

Author SHA1 Message Date
Steven Robertson c959ce010b created temp action obj for 'meta: reset_connection' python interpreter discovery 2020-03-14 23:09:40 -07:00
Steven Robertson 5b8c9da769 _execute_meta doesn't have an Action nooooo this breaks 'meta: reset_connection' because interpreter_discovery needs an Action 2020-03-04 18:47:12 -08:00
Steven Robertson 33e7d0804f fixed tests, and removed the action hack code 2020-03-04 16:05:29 -08:00
Steven Robertson 7d6d76e444 trying to get docker rhel8 working on a Mac host 2020-03-03 14:50:50 -08:00
Steven Robertson cf1c3aac1c fix typo 2020-02-11 16:33:29 -08:00
Steven Robertson ba350aa6cf assigned interpreter vars to the wrong class 2020-02-11 16:25:57 -08:00
Steven Robertson 496d96c01a need to convert to str because of unicode_literals 2020-02-10 17:45:23 -08:00
Steven Robertson aa0ad5ce8f accidentally broke discovery 2020-02-10 16:42:02 -08:00
Steven Robertson 160dbd86b4 keeping track of interpreter discovery vars in case of ansible < 2.8 2020-02-05 17:20:28 -08:00
Steven Robertson f10fb7d486 more test cases pass 2020-02-05 17:09:34 -08:00
Steven Robertson 19ba2417c8 now able to get the action object, but recursion error in low_level_exec_command 2020-01-31 15:14:44 -08:00
Steven Robertson 806651e112 working on ansible discovery; need to fix passing ActionModuleMixin reference still 2020-01-30 15:44:20 -08:00
Steven Robertson d64adb15d7 reverted autolinted code 2020-01-29 18:55:35 -08:00
Steven Robertson e8f3154cab Merge branch 'master' into complexAnsiblePythonInterpreterArg 2019-11-15 16:08:51 -08:00
David Wilson d6329f3446 Merge devel/290 @ 79b979ec8544ef5d8620c64068d4a42fabf50415 2019-11-02 16:46:59 +00:00
Steven Robertson 4669c8774f handles templating ansible_python_interpreter values 2019-10-30 13:43:48 -07:00
David Wilson efd82dd35a issue #633: various task_vars fixes
- take host_vars from task_vars too
- make missing task_vars a hard error
- update tests to provide stub task_vars
2019-08-20 14:47:33 +01:00
David Wilson fc09b81949 issue #633: handle meta: reset_connection when become is active
- don't create a new connection during reset if no existing connection
  exists
- strip off last hop in connection stack if PlayContext.become is True.
- log a debug message if reset cannot find an existing connection
2019-08-20 14:04:45 +01:00
David Wilson b6d1df749c issue #633: take inventory_hostname from task_vars
It used to be set by on_action_run() from task_vars, but this doesn't
work for meta: reset_connection. That meant MITOGEN_CPU_COUNT>1 would
pick the wrong mux to reset the connection on.
2019-08-20 13:59:01 +01:00
David Wilson 151b490890 issue #615: fetch_file() might be called with AnsibleUnicode. 2019-08-17 02:23:58 +01:00
David Wilson 5af6c9b26f issue #615: use FileService for target->controll file transfers 2019-08-10 00:37:17 +01:00
David Wilson 33bceb6eb4 issue #602: recover task_vars for synchronize and meta: reset_connection 2019-08-02 04:05:34 +01:00
David Wilson 619f4dee07 [linear2] merge fallout: restore optimization from #491 / 7b129e857 2019-08-02 04:05:19 +01:00
David Wilson 75d179e4b9 remove unused imports flagged by lgtm 2019-07-31 11:46:23 +01:00
David Wilson 108015aa22 ansible: gracefully handle failure to connect to MuxProcess
It's possible to hit an ugly exception during early CTRL+C
2019-07-31 01:50:37 +01:00
David Wilson 136dee1fb4 [linear2] more merge fallout, fix Connection._mitogen_reset(mode=) 2019-07-29 17:52:44 +01:00
David Wilson 9035884c77 ansible: abstract worker process model.
Move all details of broker/router setup out of connection.py, instead
deferring it to a WorkerModel class exported by process.py via
get_worker_model(). The running strategy can override the configured
worker model via _get_worker_model().

ClassicWorkerModel is installed by default, which implements the
extension's existing process model.

Add optional support for the third party setproctitle module, so
children have pretty names in ps output.

Add optional support for per-CPU multiplexers to classic runs.
2019-07-29 13:52:30 +01:00
Jordan Webb 1a02a86331
Add buildah transport 2019-06-08 18:15:58 -05:00
David Wilson 3620fce071 issue #593: expose configurables for SSH keepalive and increase the default 2019-06-03 17:40:58 +01:00
David Wilson f35194fe0f issue #587: mitogen_doas should not become_exe for doas_path
Looks like this has always been wrong - when used as a connection
method, PlayContext.become_method/become_exe may hold totally unrelated
data.
2019-05-27 14:59:57 +01:00
David Wilson f30a4c05c8 issue #581: expose mitogen_mask_remote_name variable. 2019-04-16 22:46:12 +01:00
David Wilson 7743e57ff3 issue #554: track and remove multiple make_tmp_path() calls. 2019-03-06 10:55:07 +00:00
David Wilson 26e6194d0a issue #548: always treat transport=smart as 'ssh' for mitogen_via=.
The idea behind transport=smart is to select between paramiko and
OpenSSH given the availability of connection multiplexing and/or OSX
kernel bugs. We need to make no such choice.
2019-02-19 16:26:47 +00:00
David Wilson 1f77d24bec Update copyright year everywhere. 2019-02-13 16:16:49 +00:00
David Wilson d1cadf8ac8 tests/ansible: Spec.password() test, document interactive pw limitation. 2019-02-12 16:04:05 +00:00
David Wilson 604b418412 ansible: fix a crash on 2.3 when mitogen_via= host is missing. 2019-02-12 02:10:32 +00:00
David Wilson b89e53fd70 ansible: raise error with correct exception type. 2019-02-09 22:20:40 +00:00
David Wilson 7badb4a25b ansible: hacky parser to alow bools to be specified on command line 2019-02-09 22:04:19 +00:00
David Wilson b499fbe29b ansible: add mitogen_ssh_compression variable. 2019-02-09 22:04:19 +00:00
David Wilson 7b129e8576 ansible: use Poller for WorkerProcess; closes #491. 2019-02-09 22:04:18 +00:00
David Wilson a1121c5a84 issue #499: respect C.BECOME_ALLOW_SAME_USER. 2019-01-29 02:53:21 +00:00
David Wilson 38a553d42d issue #490: prevent double close() destroying unrelated Connection. 2019-01-27 18:46:03 +00:00
David Wilson 8f5b65f7ec issue #477: introduce subprocess isolation.
Since Python 2.4 fork is so defective, we must use subprocesses for
mitogen_task_isolation=fork. This has plenty of upside, since the long
term goal is to dump forking altogether. This allows a gentle
introduction of its replacement.
2019-01-27 03:01:42 +00:00
David Wilson f52f7f6a62 ansible: merge away unused return values / functions. 2019-01-22 09:20:40 +00:00
David Wilson b5c14cecda docs: docs and docstrings. 2019-01-22 05:25:10 +00:00
David Wilson 115c3c5657 issue #412: add docstrings/boilerplate to transport_config.py. 2019-01-22 01:38:58 +00:00
David Wilson 2ad05f1238 issue #251, #412, #434: fix connection configuration brainwrong
This refactors connection.py to pull the two huge dict-building
functions out into new transport_transport_config.PlayContextSpec and
MitogenViaSpec classes, leaving a lot more room to breath in both files
to figure out exactly how connection configuration should work.

The changes made in 1f21a30 / 3d58832 are updated or completely removed,
the original change was misguided, in a bid to fix connection delegation
taking variables from the wrong place when delegate_to was active.

The Python path no longer defaults to '/usr/bin/python', this does not
appear to be Ansible's normal behaviour. This has changed several times,
so it may have to change again, and it may cause breakage after release.

Connection delegation respects the c.DEFAULT_REMOTE_USER whereas the
previous version simply tried to fetch whatever was in the
'ansible_user' hostvar. Many more connection delegation variables closer
match vanilla's handling, but this still requires more work. Some of the
variables need access to the command line, and upstream are in the
process of changing all that stuff around.
2019-01-22 00:40:32 +00:00
David Wilson 4bdf60326c issue #424: ansible: make put_file() raise AnsibleFileNotFound 2019-01-20 19:01:14 +00:00
David Wilson 1e9f3446c8 issue #426: big hack so reset_connection has task_var access 2019-01-19 05:17:39 +00:00
David Wilson 22de7f0e72 issue #436: fix string parsing of mitogen_ssh_debug_level
It can be a string when specified on the command line.
2018-12-08 16:07:41 +00:00