Commit Graph

3965 Commits (master)
 

Author SHA1 Message Date
Fabio Greco d818b201b3
Update missing host key checking argument in docs/ansible_detailed.rst
The arguments ansible_ssh_host_key_checking and ansible_host_key_checking were missing in the documentation, while being introduced with the commit "5749845324"
5 months ago
Alex Willmer 2ff904951c
Merge pull request #1296 from moreati/prep-0.3.25a3
Prep 0.3.25a3, again
5 months ago
Alex Willmer d4adce5d7e Resume 0.3.25dev 5 months ago
Alex Willmer 8ccaa48d2a Correct v0.3.25a3 __version__ tuple 5 months ago
Alex Willmer d6b5ea0787
Merge pull request #1295 from moreati/prep-0.3.25a3
Prepare 0.3.25a3
5 months ago
Alex Willmer 8090943031 Resume 0.3.25dev 5 months ago
Alex Willmer 945933854a Prepare v0.3.25a3 5 months ago
Alex Willmer 72cfc785db
Merge pull request #1294 from moreati/issue1281
ansible_mitogen: Support ANSIBLE_SSH_VERBOSITY with Ansible >= 12
5 months ago
Alex Willmer c1296b5d75 ansible_mitogen: Support ANSIBLE_SSH_VERBOSITY with Ansible >= 12
In vanilla Ansible >= 12 (ansible-core 2.19)
- ssh connection plugin `verbosity` controls `ssh [-v[v[v]]]`
- config option `DEFAULT_VERBOSITY` controls whether that output is displayed

In vanilla Ansible <= 11 (ansible-core <= 2.18)
- `DEFAULT_VERBOSITY` controls both `ssh` verbosity & display verbositty

As of this change
- Mitogen + Ansible >= 12 behaviour matches vanilla Ansible >= 12.
- Mitogen + Ansible <= 11 behaviour remains unchanged
  - `DEFAULT_VERBOSITY` only controls display verbosity.
- Mitogen + Ansible respect the Ansible variable `mitogen_ssh_debug_level`

I've chosen not to retroactively replicate the old vanilla Ansible behaviour
in Mitogen + Ansible <= 11 cases. I'm pretty sure it was an oversight,
rather than a design choice, but Ansible+Mitogen with `ANSIBLE_VERBOSITY=3`
is already very verbose.

fixes #1282

See
- https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-verbosity
- https://docs.ansible.com/ansible/devel/collections/ansible/builtin/ssh_connection.html#parameter-verbosity
5 months ago
Alex Willmer 4dc286371f
Merge pull request #1289 from moreati/issue1275-ssh_askpass
CI: Test SSH password authentication without sshpass command
5 months ago
Alex Willmer 55b0ece0e7 CI: Test SSH password authentication without sshpass command
Ansible 12 (ansible-core 2.19) has gained support for specifying an SSH
password, without requiring `sshpass`. It specifies the environment variable
`SSH_ASKPASS` such that `ansible` itself is called.

Mitogen is already able to support this. This change provides test coverage of
the new feature by not installing `sshpass` on macOS runners. when Ansible 12
is under test. Ubuntu runners come with `sshpass` pre-installed.

Required Ansible is also bumped to the latest pre-releases, for relevant
fixes.
5 months ago
Alex Willmer 3cba11a126 CI: Fix ansible_version comparison with ansible-core 2.19.0rc1
Note that tests/ansible/integration/ssh/templated_by_play_taskvar.yml was
previously erroniously being skipped with ansible-core 2.19.0a<N> and
2.19.0b<N>.

fixes #1293
refs #1175
5 months ago
Alex Willmer 98ae5e2c32
Merge pull request #1291 from moreati/issue1285-ci-callback-format
CI: replace `stdout=yaml` with `result_format=yaml` for Ansible >= 6 tests
5 months ago
Alex Willmer f330c2b158 CI: replace stdout=yaml with result_format=yaml for Ansible >= 6 tests
Ansible >= 12 (ansible-core >= 2.19) deprecates `stdout_callback=yaml`,
superceded by `callback_result_format=yaml`. There is a change in behaviour:
`callback_result_format` applies to output of both `ansible-playbook` _and_
`ansible`.

Tests that run `ansible` in a subprocess are now explicitly configured to use
json (even if they don't inspect that output yet) for more assert-able output
across all versions of Ansible.
5 months ago
Alex Willmer 8ddc181403
Merge pull request #1290 from moreati/prep-0.3.25a2
Prep 0.3.25a2
6 months ago
Alex Willmer 239ee673da Continue 0.3.25dev 6 months ago
Alex Willmer be4a214820 Prep v0.3.25a2 6 months ago
Alex Willmer 08f0eca1c2
Merge pull request #1286 from webknjaz/patch-1
Keep compatibility with `setuptools` tagging wheels with `py2.py3`
6 months ago
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) d481a035c3 Keep comatibility with `setuptools` tagging wheels with `py2.py3`
Modern versions of `setuptools` emit a warning when the `universal = 1` option of `bdist_wheel` is used. This warning will turn into an error on Aug 30, 2025.

The only function of `universal = 1` is assigning the dual `py2.py3` tag to the wheels. It does not perform any content or metadata compatibility validation that might be related to this.

It is possible to keep producing same-tagged wheels by setting the non-deprecated `python_tag` option instead, which is what this PR does.

Fixes #1283

Ref https://github.com/pypa/setuptools/pull/4939
6 months ago
Alex Willmer 432ee9a844
Merge pull request #1280 from moreati/issue1274-json-in-the-dumps
ansible_mitogen: Replace use of deprecated `jsonify()`
6 months ago
Alex Willmer 32b346371d CI: Reject Ansible 12.0a6, avoids bug in yaml callback plugin
Avoids an error when the yaml stdout callback is enabled

> module 'ansible._internal._yaml._dumper' has no attribute 'SafeRepresenter'

refs #1284
6 months ago
Alex Willmer 41bee1a693 CI: Ansible wheels and development releases notes 6 months ago
Alex Willmer 2598941384 tests: Add Debian 11/bullseye security archive signing key
Tests that install packages are failing due to repos/packages that are signed
with this key.

```console
$ wget https://ftp-master.debian.org/keys/archive-key-11-security.asc
--2025-06-17 14:36:04--  https://ftp-master.debian.org/keys/archive-key-11-security.asc
Resolving ftp-master.debian.org (ftp-master.debian.org)... 192.91.235.231
Connecting to ftp-master.debian.org (ftp-master.debian.org)|192.91.235.231|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11873 (12K) [application/pgp-keys]
Saving to: ‘archive-key-11-security.asc’

archive-key-11-security.asc 100%[=================>]  11.59K  --.-KB/s    in 0.002s

2025-06-17 14:36:05 (6.64 MB/s) - ‘archive-key-11-security.asc’ saved [11873/11873]

$ sha256sum archive-key-11-security.asc
716e79393c724d14ecba8be46e99ecbe1b689f67ceff3cb3cab28f6e69e8b8b8  archive-key-11-security.asc
$ cp archive-key-11-security.asc \
     ~/src/mitogen/tests/image_prep/roles/package_manager/files/debian-archive-bullseye-security-automatic.asc
```
6 months ago
Alex Willmer 667dd4237a ansible_mitogen: Replace use of `ansible.parsing.utils.jsonify.jsonify()`
The function is Ansible >= 12 (ansible-core >= 2.19). See #1274 for analysis
of `json.dumps()` vs `jsonify()` differences. This change is a middle ground
between full backward compatibility and using `json.dumps()` unadorned.

- if `data` is `None`, then it will still be transferred as `{}` on older
  versions of Ansible, but 'null' in newer releases. Cases where 'null'
  caused a problem are suspected/reported, but no reproducers are available.
- `ensure_ascii=True` will be still be tried, with fallback. I believe this
  is only relevant on Python 2.x.
- `sort_keys=True` will no longer be used.
- No indentation/pretty printing will be applied, this remains unchanged

fixes #1274
6 months ago
Alex Willmer 0d6aa99370
Merge pull request #1279 from moreati/issue1272-strategic-notice
docs: Mention Ansible strategy plugin deprecation in changelog
6 months ago
Alex Willmer 5f33849311 docs: Mention Ansible strategy plugin deprecation in changelog
fixes #1272
6 months ago
Alex Willmer 0e6d795db0
Merge pull request #1277 from moreati/docs-version-stable-only
docs: Fix website download link when there is a pre-release
6 months ago
Alex Willmer 5ec61c90a6 docs: Fix website download link when there is a pre-release
The previous regex was incorrectly matching a prefix (e.g. 1.2.3) of a
pre-release (e.g. 1.2.3a1, 1.2.3rc1).

fixes #1276
6 months ago
Alex Willmer d4a19ae9d3
Merge pull request #1267 from moreati/ansible-lint-ignore
chore: Ignore locally installed collections, dummy modules, etc
6 months ago
Alex Willmer d224a61556 chore: Ignore locally installed collections, dummy modules, etc
With mock_modules ansible-lint creates files here, e.g.

```console
✗ find .ansible
.ansible
.ansible/roles
.ansible/modules
.ansible/modules/test_echo_module.py
.ansible/modules/custom_python_leaky_class_vars.py
.ansible/modules/custom_python_new_style_module.py
...
```
6 months ago
Alex Willmer 837111c6d5
Merge pull request #1271 from moreati/prep-0.3.25a1
Prepare v0.3.25a1
6 months ago
Alex Willmer dd4b5755ef Continue 0.3.25dev 6 months ago
Alex Willmer bd774b7489 Prepare v0.3.25a1 6 months ago
Alex Willmer 208e37abef packaging: Handle pre-release __version__ tuples 6 months ago
Alex Willmer 9dee94641f
Merge pull request #1264 from moreati/ansible-2.19
Ansible 2.19 (review/sandbox)
6 months ago
Alex Willmer 0187418697 ansible_mitogen: alpha datatag handling & CI for Ansible 12 (ansible-core 2.19)
refs #1258
6 months ago
Alex Willmer e5a56a833c docs: Add Ansible 12 to support table 6 months ago
Alex Willmer 8ed4e9d41c
Merge pull request #1259 from stefanor/ansible-2.19
Ansible 2.19 alpha support
6 months ago
Stefano Rivera 8abafe8c8e Changelog entry for ansible 12 support 6 months ago
Lee Garrett 375cdbe5cf Work around missing internal method
ansible 2.19 has removed the _strip_unsafe internal method, so work
around this for now.
6 months ago
Lee Garrett d3413372b4 Allow running with ansible-core 2.19 6 months ago
Stefano Rivera 54ad3341f1 Support tox tests on ansible 12 alphas 6 months ago
Alex Willmer b382855aa2
Merge pull request #1269 from moreati/prep-0.3.24
Prep v0.3.24
6 months ago
Alex Willmer 65a81121c5 Begin 0.3.25dev 6 months ago
Alex Willmer 229fd67e97 Prepare v0.3.24 6 months ago
Alex Willmer 07028c190b
Merge pull request #1268 from moreati/stdio-no-no-no
mitogen: Only close stdio file descriptors that were open at process startup
6 months ago
Alex Willmer 566a4c1e3c mitogen: log child file objects rather than descriptors
The repr() of file objects is more self descriptive, and includes the fd.
6 months ago
Alex Willmer 6cec613daa mitogen: Only close stdio file descriptors that were open at process startup
File descriptors 0, 1, and 2 are usually stdin, stdout, stderr; but not
always. If a process is started without one of these then the first descriptor
allocated by the process opening a file or socket will be allocated an fd <=
STDERR_FILENO. This isn't common, but it does occur, e.g. Windows GUI apps
started without being connected to a console, controller side plugins run
under Ansible 12 (ansible-core 2.19).

In such cases the corresponding sys attribute (e.g. sys.stderr) will be None.

refs #1258

See also
- https://docs.python.org/3/library/sys.html#sys.__stdin__
- https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_12.html#porting-guide-for-v12-0-0a1
- https://github.com/ansible/ansible/pull/82770
- https://github.com/python/typeshed/issues/11778
- https://gist.github.com/moreati/034fef45f73d809d9411a8a63eca34d6
6 months ago
Alex Willmer 49fea37879 mitogen: Use pty.STD*_FILENO constants
Makes it more obvious and easier to find where stdin, stdout, and stderr file
descriptors are being interacted with.
6 months ago
Alex Willmer 8faae13d7e mitogen: Improve readability of stderr initialisation in create_child()
There should be no behaviour change.
6 months ago