Commit Graph

3972 Commits (9c0052857fb3e3970402da0aa49df83d2030c745)
 

Author SHA1 Message Date
Alex Willmer 9c0052857f
Merge 2411779305 into 2398df1159 2 weeks ago
Alex Willmer 2398df1159
Merge pull request #1393 from moreati/firststage-linecomments
mitogen: Line comments in first stage
3 weeks ago
Alex Willmer 606a21fb27 mitogen: Add first line comments to _first_stage() 3 weeks ago
Alex Willmer 733f4bca81 mitogen: Allow line comments in first stage, strip them. 3 weeks ago
Alex Willmer 9c71a158e7
Merge pull request #1390 from mhartmay/fix-hanging-tests
testlib: Fix hanging tests
3 weeks ago
Marc Hartmayer 0a559ec8d8 testlib: Fix hanging tests
When I run

$ MITOGEN_LOG_LEVEL=debug SKIP_ANSIBLE=1 ./run_tests -v -k first_stage_test.CommandLineTest

in a interactive Shell (with a tty), it ends in a hanging process as the
`have_python2` and `have_python3` ends up ends up in an interactive Python
shell. Therefore check the Python version instead.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
3 weeks ago
Alex Willmer 7be79d05e9
Merge pull request #1013 from moreati/issue1011-blacklist-msg
mitogen: Clarify blacklisted import error message
4 weeks ago
Alex Willmer ccaaf4b7fe mitogen: Clarify blacklisted ModuleNotFoundError message
Previous phrasing was misleading - it implied a given module was explicitly on
the blacklist, even if it was due to a restrictive whitelist and the blacklist
was empty.

Arguably the blacklist/whitelist semantics are themselves misleading. A
redesign is tempting.
4 weeks ago
Alex Willmer 073fc48afc tests: Remove BlacklistTest stubs (covered by ImporterBlacklistTest) 4 weeks ago
Alex Willmer e0de4d3b8e
Merge pull request #1386 from moreati/issue1237
Tidy ups
4 weeks ago
Alex Willmer 64a581b2ac tests: Add Ubuntu 16.04 to image_prep inventory
I missed this when committing what built 2025.02 iamges
4 weeks ago
Alex Willmer 823d1d8b47 docs: Document Ansible 13 (ansible-core 2.20) support 4 weeks ago
Alex Willmer 9b46882478 ansible_mitogen: Remove a use of ansible.module_utils.six 4 weeks ago
Alex Willmer b105877f4d mitogen: Re-declare Python 2.4 compatibility
With CentOS 5 now covered by the Mitogen unit tests I'm content to
reverse/clarify 104865e866
4 weeks ago
Alex Willmer fb9efb24ca
Merge pull request #1383 from moreati/prepare-v0.3.35
Prepare v0.3.35
1 month ago
Alex Willmer 9ce6a43329 Begin 0.3.36dev 1 month ago
Alex Willmer 4af6a75278 Prepare v0.3.35 1 month ago
Alex Willmer be3d496110
Merge pull request #1382 from moreati/issue1225-interpreter-python-fallback
ansible_mitogen: Use INTERPRETER_PYTHON_FALLBACK as python candidates
1 month ago
Alex Willmer 699a8ebfb5 ansible_mitogen: Use INTERPRETER_PYTHON_FALLBACK as python candidates
This shouldn't change the interpreter ultimately chosen by Ansible. It should
only improve the hit rate of performing interpreter discovery, particular in
cases where only pythonX.Y is present on the target.

Interpreter discovery may take longer or shorter, depending on the Ansible
version and the interpreters present on the target.
1 month ago
Alex Willmer abb77e77e1
Merge pull request #1374 from moreati/prepare-v0.3.34
Prepare v0.3.34
1 month ago
Alex Willmer 19938ec05a Begin 0.3.35.dev 1 month ago
Alex Willmer 8e6a93dd0f Prepare v0.3.34 1 month ago
Alex Willmer 682faf85fc
Merge pull request #1126 from moreati/issue1124
Ansible: Avoid sending `__main__` and its dependencies from controller to targets
1 month ago
Alex Willmer 83b6cdb616 ansible_mitogen: Speedup startup by not sending `__main__`
On my laptop his reduces the time to execute `ansible -mping ...` by approx
300 ms with `strategy=mitogen_linear`.

Until this commit Mitogen was unnecessarily sending large chunks of Ansible
from the controller to targets, due to `__main__` being identified as a
related module of `ansible.module_utils.basic`, and resolving to something
within `ansible.cli...`.

On Ansible target hosts executing any Ansible Module `__main__` is imported by
`ansible.module_utils.basic` as part of Ansible's module delivery mechanism.
When `mitogen.master.ModuleResponder` (on the controller) processes the
request for `ansible.module_utils.basic` from the target, it scans
`ansible.module_utils.basic` for related imports and finds `__main__`. However
`__main__` on the controller is not the same module as `__main__` on the
target. On the controller it is a module in `ansible.cli...` that implements
one of the ansible commands (e.g. `ansible`, `ansible-playbook`).
1 month ago
Alex Willmer f191f050bf mitogen: Log why a module is sent or not sent by ModuleResponder
This should not change the logic
1 month ago
Alex Willmer f556ec12b1
Merge pull request #1373 from moreati/issue1118-new-os-releases
CI: Expand test coverage of OS releases
1 month ago
Alex Willmer a208daa461 CI: Add OS release coverage: Ubuntu 22.04, Ubuntu 24.04 1 month ago
Alex Willmer 14e8334705 CI: Add OS release coverage: Debian 12 1 month ago
Alex Willmer 1fe55f1c67 CI: Add OS release coverage: CentOS 5
Only the Mitogen unit tests will run against CentOS 5, providing atleast some
Python 2.4test coverage. There is no version of Ansible that supports Python
2.4 that is also supported by Mitogen 0.3.

The SSH key exchange argument is to persuade newer SSH clients to talk with
such an old SSH server.

See https://www.openssh.org/legacy.html
1 month ago
Alex Willmer e0103eb66c CI: Add OS release coverage: AlmaLinux 9 1 month ago
Alex Willmer e044893a88 tests: Variabalize virtualenv creation in isssue 152 regression test
Prep for AlamaLinux 9 introduction
1 month ago
Alex Willmer 1cbd1777bc tests: Check Mitogen+Ansible discovered interpreter fresh Ansible result
Previously this test used a manually compiled list of results, which is
fragile and an ongoing maintenance burden. New method should 'just work' and
be more transparent.

This technique might be more widely applicable in the test suite.
1 month ago
Alex Willmer 0bafbd501c tests: Remove unused distros_* Tox factors 1 month ago
Alex Willmer f0a83168bf
Merge pull request #1370 from moreati/ci-macos15
CI: bump macOS 13 runner -> macOS 15
1 month ago
Alex Willmer 15b2619fb2 CI: Bump deprecated macOS 13 runner to macOS 15 1 month ago
Alex Willmer 5c9abeda94
Merge pull request #1372 from moreati/issue1118-ci-use-2025.02-images
CI: Use 2025.02 test images
1 month ago
Alex Willmer 006d497c25 CI: Show details of failed ci_lib.run_batches() commands 1 month ago
Alex Willmer 9609437262 CI: Use 2025.02 test images, keeping same OS releases
centos8-test:2025.02 no longer has a /usr/bin/python installed, so use
centos8-py3 target which sets `ansible_python_interpreter=/usr/bin/python3` in
the templated inventory.

Ansible <= 9 (ansible-core <= 2.6) now discover the interpreter as
/usr/bin/python3 on debian11-test:2025.02, as opposed to
/usr/bin/python3.9 on debian11-test:2021. I'm don't know the exact
cause. From manual tests the change in observed behaviour appears to be common to
vanilla Ansible (strategy=linear) and Mitogen flavour
(strategy=mitogen_linear).

```console
(ans9) ➜  mitogen git:(4efb7158) ✗ ANSIBLE_STRATEGY=mitogen_linear ANSIBLE_STRATEGY_PLUGINS=ansible_mitogen/plugins/strategy ans9/bin/ansible -e ansible_python_interpreter=auto -mping d11.lan
d11.lan | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
(ans9) ➜  mitogen git:(4efb7158) ✗ ans9/bin/ansible -e ansible_python_interpreter=auto -mping d11.lan
d11.lan | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
```

Update some tests which assume `/usr/bin/python` exists or that `env python`
will resolve successfully.
1 month ago
Alex Willmer 7eabcc61c1 tests: Only test doas on targets with doas binary installed 1 month ago
Alex Willmer 017de4c8e1
Merge pull request #1254 from moreati/issue1118-update-containers
CI: Build newer test images
1 month ago
Alex Willmer 7996a03a37 ci: Bootstrap Debian like containers with python-apt or python3-apt
The Ansible apt module requires it
1 month ago
Alex Willmer 5b6b076c4e ci: Avoid ansible_virtualization_type to check for docker targets
It's not consistant across Ansible versions, particular the oldest ones. This
may have contributed to older test images containing usernames from the host
OS that they were built on (e.g. dmw, alex).
1 month ago
Alex Willmer 4ecafc564d ci: Use command: true as noop handler
meta: noop failed on older Ansibles (e.g. 2.3)
1 month ago
Alex Willmer 56dce28906 ci: Dont show arguments in task name during image prep
A bit to noisy for my taste
1 month ago
Alex Willmer ff973775ce ci: Push new container images to GitHub Container Registry 1 month ago
Alex Willmer 5ffdbb5999 ci: Add Alma 9, Debian 12, Ubuntu 22.04, & Ubuntu 24.04 to image prep 1 month ago
Alex Willmer 01e24f9ddf ci: Use highest supported Ansible version during image prep
It was necessary to split setup.yml because there is no common subset of
supported include/import keywords across Ansible 2.3 - 2.11. The yaml stdout
callback is unavailabe in Ansible 2.3.
1 month ago
Alex Willmer 22e7046cf6 ci: Run image-prep as fast as possible
Mitogen maintainer(s) got better laptops in the last decaade or so.
1 month ago
Alex Willmer cc8a39864d ci: Only install default Python 3.x during image prep
Newer images will shortly be generated, so these higher Python versions aren't
needed anymore.
1 month ago
Alex Willmer 40fbfe58fc ci: Install doas package during image prep, delete vendored doas
Debian 11 is the earliest Debian release with such a package. Ubuntu first
included it in 22.04 CentOS doesn't have it.
1 month ago