Commit Graph

889 Commits (f03276201231f1a00593c9f92f8834b1c29e1e24)

Author SHA1 Message Date
Alex Willmer 1195e39b55 docs: Read release version from changelog
fixes #1157
11 months ago
Alex Willmer 882dc0ca06 docs: Fix "No module named 'imghdr'" when building website
Between Mitogen 0.3.19 & 0.3.20 Netlify changed their default Python to 3.13.
This broke our deployment of https://mitogen.networkgenomics.com/. The
previous default was Python 3.8, based on a recent successful build of
https://spiffy-croissant-696d93.netlify.app.
11 months ago
Alex Willmer 3ee6a0ff93 Begin v0.3.21dev 11 months ago
Alex Willmer f1f8ad11ee Prepare v0.3.20 11 months ago
Alex Willmer 945e360363 ansible_mitogen: Respect interpreter_python and ANSIBLE_PYTHON_INTERPRETER
This adapts PR #740 by @extmind (afe0026890),
which augmented the call to `Connection.get_task_var()` with
`C.config.get_config_value('INTERPRETER_PYTHON'` as a default. Instead this
*replaces* the call to `Connection.get_task_var()`. The aim is greater
simplicity by disentangling templating of a configured interpreter path and
discovery of an interpreter when none is configured. I think this also reduces
the number of times `Connection._get_task_vars()` is called, so reducing the
number of times we do the ugly stack frame inspection.

I've also added test cases.

Co-authored-by: Lars Beckers <lars@extmind.de>
11 months ago
Alex Willmer 5e6d7bf4fb ansible_mitogen: Templated connection timeout
Ansible >= 4 (ansible-core >= 2.11) the SSH plugin has a `timeout` option and
with variable `ansible_ssh_timeout`, but not a `ansible_timeout` variable.
The local plugin has no such option or variable(s). However `ansible_timeout`
is backfilled for all conection plugins, by legacy mechanisms that populate
the play context attribute:
- `ansible.constants.COMMON_CONNECTION_VARS`
- `ansible.constants.MAGIC_VARIABLE_MAPPING`

The `timeout` keyword is for task completion timeout, not connection timeout.
12 months ago
Alex Willmer 6900e88dfd ansible_mitogen: Fix templated python interpreter with `meta: reset_connection`
refs #1079
12 months ago
Alex Willmer 53b4881628 ansible_mitogen: Fix wait_for_connection + templated ansible_python_interpreter
This tightens up our monkey patching `Connection._action` so it's only applied
during `meta: reset_connection` & promptly removed. This fixes "'int' object
has no attribute 'template'" when `ansible.plugins.action.wait_for_connection`
or other code calls `ansible.plugins.connection.ConnectionBase.reset()`.

This could also have switched to `templar=templar` on the temporary action,
rather than `templar=0`, but it's not strictly necessary to fix this bug. I
anticipate other changes doing so soon, to improve interpreter discovery &
templated python interpreter path support.
12 months ago
Alex Willmer ffb1709630 Begin v0.3.20dev 1 year ago
Alex Willmer 24ba734ff9 Prepare v0.3.19 1 year ago
Alex Willmer 0b99169f42 Support Ansible 11 (ansible-core 2.18) 1 year ago
Alex Willmer 1cd7ea18d3 Begin v0.3.19dev 1 year ago
Alex Willmer d85d9a25ee Prepare v0.3.18 1 year ago
Alex Willmer dd41ddf89b ansible_mitogen: Templated become flag
The code change to support this was already made in transport_config.py, as
part of templated become_user support (commit bf6607e27e, PR #1148). This
commit adds tests to confirm the functionality.
1 year ago
Alex Willmer e120cd2cae ansible_mitogen: Templated become method 1 year ago
Alex Willmer d2db3c3840 Begin v0.3.18dev 1 year ago
Alex Willmer 6cf6f69751 Prepare v0.3.17 1 year ago
Alex Willmer 905b87b71a tests: Test templated ansible_host_key_checking provided by task vars
missed by #1184
1 year ago
Alex Willmer 5ae5bb94ac docs: Changelog entry for templated ansible_host 1 year ago
Alex Willmer 9e0dad2a1a ansible_mitogen: Templated SSH host key checking
refs #1083
1 year ago
Alex Willmer c7df5c97c1 ansible_mitogen: Templated SSH private key file 1 year ago
Alex Willmer 43cc937bc6 CI: Fix incorrect u=r,g=r,o=rw file permissions on mitogen__has_sudo_pubkey.key
The wrong base was used when calculating the mode. So the file became world
readable and writable on a CI runner, until
ansible/integration/ssh/variables.yml happened to correct it near the end of
the integration tests.

I believe this was the only instance.

```console
mitogen git:(issue1182) ✗ ag --python 'int\(.+7\)' . .ci | wc -l
       0
```

fixes #1182
1 year ago
Alex Willmer 757527635d Begin v0.3.17dev 1 year ago
Alex Willmer d28dd09e23 Prepare v0.3.16 1 year ago
Alex Willmer 06df62c8b8 CI: Migrated macOS 12 runners to macOS 13, due to EOL.
macOS Python 2.7 jobs have been removed because the macOS 13 image doesn't
include CPython 2.7.
1 year ago
Alex Willmer 833e2845e9 ansible_mitogen: Templated ssh executable, templated reset_connection fix
Adding a the tt-ssh-executable test target uncovered an Ansible bug during
`meta: reset_connection` tasks. So this commit includes a workaround for
affected versions of Ansible.
1 year ago
Alex Willmer 66ea10d577 ansible_mitogen: Template become command arguments (become_flags)
Uses the same fallback for (mitogen_sudo et al) as become_exe (see #1173).

The new `Spec.become_flags()` is not yet explicitly tested. Note that it
returns a string (matching the Ansible option of the same name), whereas
`Spec.sudo_args()` returns a list.

refs #1083
1 year ago
Alex Willmer ec9b3e5c5d ansible_mitogen: Support templated become_exe option
Some ansible_mitogen connection plugins look more like become plugins (e.g.
mitogen_sudo) & use become plugin options. For now there's special handling in
PlayContextSpec._become_option(). Further design/discussion can go in #1173.

Refs #1087.
1 year ago
Alex Willmer 26c4c33ad3 Begin 0.3.16dev 1 year ago
Alex Willmer 7634e2c469 Prepare v0.3.15 1 year ago
Alex Willmer 7e5b064139 ansible_mitogen: Support templated become passwords 1 year ago
Alex Willmer 8a34b925a4 tests: Re-enable become/sudo tests, fix them on macOS runners
The tasks in tests/imageprep/_user_accounts.yml that create users did not
specify a primary group for those users - this left the decision to Ansible's
user module, and/or the underlying OS. In Ansible 9+ (ansible-core 2.16+ the
user module defaults to primary group "staff." Earlier don't supply a default,
which releases probably results in a primary group nameed "None" (due to
stringifying the Python singleton of the same name), or whatever the macOS
Directory Services has for no data/NULL.

The invalid GID 4294967295 (MAX_UINT32 == 2**32-1) in the sudo error probably
enters the mix via something similar to sudo CVE-2019-14287.

Fixes #692

See
- https://github.com/ansible/ansible/pull/79999
- https://github.com/ansible/ansible/commit/c69c83c962f987c78af98da0746527df
- https://www.sudo.ws/security/advisories/minus_1_uid/

> Bruce Wayne : [confused]  Am I meant to understand any of that?
> Lucius Fox : Not at all, I just wanted you to know how hard it was.
> -- Batman Begins
1 year ago
Alex Willmer cdfaf31ebc ansible_mitogen: Template ssh_*_args connection options
This expands support to setting them in Play scoped variables. Task scoped
variables are also very likely to work, but untested for now.

refs #905
1 year ago
Alex Willmer d35ca3e4af Begin 0.3.15.dev 1 year ago
Alex Willmer c4ca015266 Prepare v0.3.14 1 year ago
Alex Willmer bf6607e27e ansible_mitogen: Support templated become_user
This reads the become username from the `become_user` attribute of the play
context, to the `"become_user"` option of the loaded become plugin. This has
been supported by vanilla Ansible since Ansible 2.10 (ansible-base 2.10).

To support this I've also switched from using the `play_context.become` (a
bool), to `connection.become` (an instance of the appropriate) become plugin.

New tests have been added, modelled on those for templated connection
parameters (see #1147, #1153, #1159).

See
- 480b106d65

refs #1083

Co-authored-by: mordek <m.pirog@bonasoft.pl>
1 year ago
Alex Willmer 28e08ef94c ci: Reduce number of Jobs by parameterizing Mitogen Docker SSH tests
This reduces the number of jobs from 48 to 24. The Mitogen part of the test
suite has been parameterized on the Linux container targets to be run against.
Both the Ansible tests & Mitogen tests now use the same source of truth to
control which targets to use: environment variable MITOGEN_TEST_DISTRO_SPECS.
This replaces the two mutually exclusive env vars DISTRO and DISTROS. I've
also removed vestgial traces of an unused env var MITOGEN_TEST_DISTRO.

Parameterization adapted from
https://eli.thegreenplace.net/2014/04/02/dynamically-generating-python-test-cases

refs #1058, #1059
1 year ago
Alex Willmer 47e25eb8c5 Begin 0.3.14 development 1 year ago
Alex Willmer 8dec038941 Prepare v0.3.13 1 year ago
Alex Willmer b91407a779 docs: Correct v0.3.12 version in changelog
fixes #1149
1 year ago
Alex Willmer 9cdd51cf5b Declare Python 3.13 support
No code changes needed, that I could find.
1 year ago
Alex Willmer 77a01ff8d6 ansible_mitogen: Support templated SSH port
fixes #978
1 year ago
Joshua K 2c4316fa16
Fix rST whitespace error in changelog entry.
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
1 year ago
Joshua M. Keyes 6053e1b5cf ansible_mitogen: Handle templated ansible_ssh_user. 1 year ago
Alex Willmer 1773c9aba6 trivia: Fix trailing whitespace 1 year ago
Alex Willmer 9f0566b522 docs: Changelog entry for migration to GitHub Actions
refs #1138
1 year ago
Alex Willmer 61b800781b Begin v0.3.13 development 1 year ago
Alex Willmer 298d28a650 Prep v0.3.12 1 year ago
Alex Willmer 3f288f934a docs: Correct 0.3.11 release month
Reports of Mitogen's time machine will have been greatly exaggerated.
1 year ago
Alex Willmer b05b2c8c8e CI: Add re-actors/alls-green GitHub Actions job
This will allow a single job to be required in the GitHub branch protection
web UI; regardless of which jobs are added to or removed from the matrix of
platform specific, Ansible specific jobs.
1 year ago