Commit Graph

17 Commits

Author SHA1 Message Date
David Wilson 2e3d04bbb8 issue #342: forward _create_control_path() to SSH plugin.
network_cli connection type loads the "ssh" (mitogen_ssh) plugin and
expects a private method to exist.
2018-08-19 21:28:34 +01:00
David Wilson 4077182fb2 ansible: plugins were missing absolute_import. 2018-08-18 16:43:59 +01:00
napkindrawing 745d72bb1d core: support for "doas" become_method 2018-07-12 14:54:41 -04:00
David Wilson 6dd9e8984d issue #297: fix viewkeys use on 3.x. 2018-07-10 20:20:22 +01:00
David Wilson d8e0c9e12c issue #297: local commands must execute with WorkerProcess environment. 2018-07-10 18:42:09 +01:00
David Wilson 012745efea issue #297: local actions must execute with fixed directory.
Local actions must execute in the the parent directory of the playbook
that defines the action.
2018-07-10 17:56:05 +01:00
David Wilson 1eb5c20f57 ansible: add dummy init.pys so setup.py find_packages() DTRT. 2018-05-15 21:29:00 +01:00
David Wilson 9cc8b21a07 ansible: missing mitogen_su module. 2018-05-02 16:41:35 +01:00
David Wilson 90f7b4baea ansible: stub plugin documentation. 2018-04-29 02:18:26 +01:00
David Wilson bba2a42e44 ansible: add mitogen_sudo method, split out connection subclasses.
Slowly moving towards real implementations in those files.
2018-04-29 01:45:52 +01:00
David Wilson 0a9126c510 ansible: connection plugins missing from previous commit. 2018-04-29 01:22:01 +01:00
David Wilson 098995539d ansible: implement FreeBSD jail support. 2018-04-27 06:21:10 +01:00
David Wilson b1563cd8c1 ansible: hijack lxd connections too. 2018-04-27 04:45:40 +01:00
David Wilson 131bc768c7 ansible: implement LXC support. 2018-04-27 04:40:56 +01:00
David Wilson 3fab8a3af5 ansible: connection delegation v1
This implements the first edition of Connection Delegation, where
delegating connection establishment is initially single-threaded.

ansible_mitogen/strategy.py:
ansible_mitogen/plugins/connection/*:

  Begin splitting connection.Connection into subclasses, exposing them
  directly as "mitogen_ssh", "mitogen_local", etc. connection types.

  This is far from removing strategy.py, but it's a tiny start.

ansible_mitogen/connection.py:

  * config_from_play_context() and config_from_host_vars() build up a
    huge dictionary containing either more or less PlayContext contents,
    or our best attempt at reconstructing a host's connection config
    from its hostvars, where that config is not the current
    WorkerProcess target.

    They both produce the same format with the same keys, allowing
    remaining code to have a single input format.

    These dicts contain fields named after how Ansible refers to them,
    e.g. "sudo_exe".

  * _config_from_via() parses a basic connection specification like
    "username@inventory_name" into one of the aforementioned dicts.

  * _stack_from_config() produces a list of dicts describing the order
    in which (Mitogen) connections should be established, such that each
    element is proxied via= the previous element. The dicts produced by
    this function use Mitogen keyword arguments, the former di.

    These dicts contain fields named after how Mitogen refers to them,
    e.g. "sudo_path".

  * Pass the stack to ContextService, which is responsible for actual
    setup of the full chain.

ansible_mitogen/services.py:

  Teach get() to walk the supplied stack, establishing each connection
  in turn, creating refounts for it before continuing.

  TODO: refcounting is broken in a variety of cases.
2018-04-27 01:23:23 +01:00
David Wilson 485e489aa2 ansible: correct sys.path fixup. 2018-03-19 21:58:32 +05:45
David Wilson bde6f888a0 ansible: restructure package to avoid yet more madness
Ansible's PluginLoader makes up bullshit when it imports a module
(mostly because it has to make up something), therefore we ended up with
duplicate copies of ansible_mitogen loaded: one under
ansible.plugins.*.mitogen, and one under the canonical namespace.

Which broke isinstance().
2018-03-19 21:58:32 +05:45