-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compared to the Vanilla Ansible, [Mitogen](https://github.com/mitogen-hq/mitogen) calls `sshwrapper.py` differently. This imply a different parsing to extract the options, host and command. Moreover, Mitogen does not passes the `remote_user` therefore we must set as well `BASTION_ANSIBLE_REMOTE_USER` env var. Apart from setting the `BASTION_ANSIBLE_REMOTE_USER` the wrapper works for both vanilla and mitogen connection. Users should refer to mitogen to learn about the installation process. The following commit has been tested with: * Test case 1 * Mitogen 0.3.7 * Ansible 210.8 * Python 3.9.2 * Debian 11.9 * Test case 2 * Mitogen 0.3.7 * Ansible 2.16.6 * Python 3.12 * MacOS 14.2 This playbook works as expected with and without mitogen enabled ``` ❯ cat test.yaml --- - name: test hosts: test gather_facts: false tasks: - name: Run the equivalent of "apt-get update" as a separate step ansible.builtin.apt: update_cache: true - name: Create files with copy content module copy: content: | test file {{ item }} dest: /tmp/file_{{item}} with_sequence: start=1 end=10 - name: demo template ansible.builtin.template: src: demo.txt.j2 dest: /tmp/demo.txt mode: 0640 ``` Here is the ansible.cfg ``` [defaults] interpreter_python = /usr/bin/python3 host_key_checking = False deprecation_warnings = False syslog_facility = LOG_USER bin_ansible_callbacks = True gathering = explicit callbacks_enabled = ansible.posix.profile_tasks strategy_plugins = ./mitogen/ansible_mitogen/plugins/strategy/ strategy = mitogen_linear [ssh_connection] scp_if_ssh = False pipelining = True transfer_method = sftp ssh_executable = ./bastion-ansible-wrapper/sshwrapper.py sftp_executable = ./bastion-ansible-wrapper/sftpbastion.sh retries = 1 ``` Signed-off-by: Wilfried Roset <[email protected]>
- Loading branch information
1 parent
5c7c446
commit df3bf51
Showing
3 changed files
with
236 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters