Commit Graph

3795 Commits (32b346371d438aba3d760d6fb175f8ec62169830)
 

Author SHA1 Message Date
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
7 months ago
Alex Willmer 5f33849311 docs: Mention Ansible strategy plugin deprecation in changelog
fixes #1272
7 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
7 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
7 months ago
Alex Willmer d4a19ae9d3
Merge pull request #1267 from moreati/ansible-lint-ignore
chore: Ignore locally installed collections, dummy modules, etc
7 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
...
```
7 months ago
Alex Willmer 837111c6d5
Merge pull request #1271 from moreati/prep-0.3.25a1
Prepare v0.3.25a1
7 months ago
Alex Willmer dd4b5755ef Continue 0.3.25dev 7 months ago
Alex Willmer bd774b7489 Prepare v0.3.25a1 7 months ago
Alex Willmer 208e37abef packaging: Handle pre-release __version__ tuples 7 months ago
Alex Willmer 9dee94641f
Merge pull request #1264 from moreati/ansible-2.19
Ansible 2.19 (review/sandbox)
7 months ago
Alex Willmer 0187418697 ansible_mitogen: alpha datatag handling & CI for Ansible 12 (ansible-core 2.19)
refs #1258
7 months ago
Alex Willmer e5a56a833c docs: Add Ansible 12 to support table 7 months ago
Alex Willmer 8ed4e9d41c
Merge pull request #1259 from stefanor/ansible-2.19
Ansible 2.19 alpha support
7 months ago
Stefano Rivera 8abafe8c8e Changelog entry for ansible 12 support 7 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.
7 months ago
Lee Garrett d3413372b4 Allow running with ansible-core 2.19 7 months ago
Stefano Rivera 54ad3341f1 Support tox tests on ansible 12 alphas 7 months ago
Alex Willmer b382855aa2
Merge pull request #1269 from moreati/prep-0.3.24
Prep v0.3.24
7 months ago
Alex Willmer 65a81121c5 Begin 0.3.25dev 7 months ago
Alex Willmer 229fd67e97 Prepare v0.3.24 7 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
7 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.
7 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
7 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.
7 months ago
Alex Willmer 8faae13d7e mitogen: Improve readability of stderr initialisation in create_child()
There should be no behaviour change.
7 months ago
Alex Willmer ab63864ace CI: Fix indentation 7 months ago
Alex Willmer e19397ee59 CI: Timeout Linux jobs after 25 minutes
Some tests have been seen deadlocked. They continued running for an hour+,
until the default Github timeout. Linux timeout higher than macOS because the
Linux jobs run more tests.
7 months ago
Alex Willmer a00263d963 CI: Fix cosmetic typos in get_with_context() regression test 7 months ago
Alex Willmer 68f17420e2 CI: Name Ansible stack construction plays
Simplifies matching a failed test to the play/task.
7 months ago
Alex Willmer c31d902dc8 CI: Skip tests that require Mitogen when Ansible strategy is linear
The Van_* GitHub Actions jobs (corresponding to Tox factor strategy_linear,
environment variable ANSIBLE_STRATEGY=linear) were failing inside Mitogen
modules, which they should not touch. The jobs are intended as a cross
validation of the test suite, they should only fail if Ansible itself has a
problem.
7 months ago
Alex Willmer 4c41bf02f1 CI: Specify ANSIBLE_STRATEGY in tasks that run ansible or ansible-playbook
This makes the behaviour more consistent across jobs that run with
`mitogen_linear` or plain `linear`.
7 months ago
Alex Willmer a9048f0f7d CI: Use Ansible finished test (`result.finished` -> `result is finished`)
Required by Ansible 12 (ansible-core-2.19).

refs #1298
7 months ago
Alex Willmer 491d438427 CI: Add is_macos_controller Ansible variable for become_unpriv_available
This eliminates the need for ansible_facts to be gathered before
become_unpriv_available can be referenced.
7 months ago
Alex Willmer dcff603267
Merge pull request #1261 from moreati/prep-0.3.23
Prepare 0.3.23
8 months ago
Alex Willmer c146682e2e Begin 0.3.24dev 8 months ago
Alex Willmer 8e25944c94 Prepare v0.3.23 8 months ago
Alex Willmer 4a75648774 packaging: Fix InvalidVersion in release versions
fixes #1263
8 months ago
Alex Willmer fa28024810
Merge pull request #1257 from moreati/issue1256
CI: Upgrade Linux runner to Ubuntu 22.04 & 24.04
8 months ago
Alex Willmer 27b4b77bba CI: Upgrade Github jobs from Ubuntu 20.04 to 22.04 & 24.04
Python 2.7 (distro package) and 3.6 (pyenv managed) jobs run on Ubuntu 22.04.
More recent Pythons (distro or Github provided) run on 24.04.

fixes #1256

Ansible tasks that run locally (e.g. `connection: local`, `delegate_to:
localhost`) must now specify their `ansible_python_interpreter`, typically as
`{{ ansible_playbook_python }}`; otherwise the system Python on the controller
(e.g. `/usr/bin/python`) is likely to be used and this is often outside the
version range supported by the Ansible verison under test. If this occurs then
the symptom is often a failure to import a builtin from
`ansible.module_utils.six.moves`, e.g.

```
fatal: [target-centos6-1]: FAILED! => changed=true
  cmd:
  - ansible
  - -m
  - shell
  - -c
  - local
  - -a
  - whoami
  - -i
  - /tmp/mitogen_ci_ansibled3llejls/hosts
  - test-targets
  delta: '0:00:02.076385'
  end: '2025-04-17 17:27:02.561500'
  msg: non-zero return code
  rc: 8
  start: '2025-04-17 17:27:00.485115'
  stderr: |-
  stderr_lines: <omitted>
  stdout: |-
    An exception occurred during task execution. To see the full traceback,
    use -vvv. The error was:     from ansible.module_utils.six.moves import
    map, reduce, shlex_quote
```
8 months ago
Alex Willmer 1f737568b2 ci: Remove vestigial Python 2.7 support in macOS Github jobs 8 months ago
Alex Willmer 9b17f2839c ci: Label Github jobs by OS/distribution & Tox environment 8 months ago
Alex Willmer b130cd9f90
Merge pull request #1252 from moreati/issue1118-update-containers
CI: Mark and use 2021 test containers
10 months ago
Alex Willmer fdbd1a8c9b ci: Configure package managers using a role
This allows code sharing between integration tests and test image prep.
10 months ago
Alex Willmer 1e12edbf95 ci: Use file module to set mitogen__readonly_homedir permissions 10 months ago
Alex Willmer f2e0e552ac ci: Fix sshd configuration during image prep
This will allow image preparation using Ansible versions that
- predate ansible_facts.*
- predate loop keyword
- predate collections
10 months ago