{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":333083924,"defaultBranch":"main","name":"the-bastion-ansible-wrapper","ownerLogin":"ovh","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2021-01-26T12:51:27.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/1698434?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1714123947.0","currentOid":""},"activityList":{"items":[{"before":"0364e2038c65e9727a83965207d22031574ae8d0","after":"df3bf51e78ca83ff8869bcd523598c9e5116a6a8","ref":"refs/heads/mitogen","pushedAt":"2024-04-26T10:18:12.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"wilfriedroset","name":"Wilfried ROSET","path":"/wilfriedroset","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/12611310?s=80&v=4"},"commit":{"message":"Add support for mitogen\n\nCompared to the Vanilla Ansible, [Mitogen](https://github.com/mitogen-hq/mitogen) calls `sshwrapper.py`\ndifferently. This imply a different parsing to extract the options, host\nand command. Moreover, Mitogen does not passes the `remote_user`\ntherefore we must set as well `BASTION_ANSIBLE_REMOTE_USER` env var.\n\nApart from setting the `BASTION_ANSIBLE_REMOTE_USER` the wrapper works\nfor both vanilla and mitogen connection. Users should refer to mitogen\nto learn about the installation process.\n\nThe following commit has been tested with:\n* Test case 1\n * Mitogen 0.3.7\n * Ansible 210.8\n * Python 3.9.2\n * Debian 11.9\n* Test case 2\n * Mitogen 0.3.7\n * Ansible 2.16.6\n * Python 3.12\n * MacOS 14.2\n\nThis playbook works as expected with and without mitogen enabled\n```\n❯ cat test.yaml\n---\n- name: test\n hosts: test\n gather_facts: false\n tasks:\n - name: Run the equivalent of \"apt-get update\" as a separate step\n ansible.builtin.apt:\n update_cache: true\n\n - name: Create files with copy content module\n copy:\n content: |\n test file {{ item }}\n dest: /tmp/file_{{item}}\n with_sequence: start=1 end=10\n\n - name: demo template\n ansible.builtin.template:\n src: demo.txt.j2\n dest: /tmp/demo.txt\n mode: 0640\n```\nHere is the ansible.cfg\n```\n[defaults]\ninterpreter_python = /usr/bin/python3\nhost_key_checking = False\ndeprecation_warnings = False\nsyslog_facility = LOG_USER\nbin_ansible_callbacks = True\n\ngathering = explicit\ncallbacks_enabled = ansible.posix.profile_tasks\n\nstrategy_plugins = ./mitogen/ansible_mitogen/plugins/strategy/\nstrategy = mitogen_linear\n\n[ssh_connection]\nscp_if_ssh = False\npipelining = True\ntransfer_method = sftp\nssh_executable = ./bastion-ansible-wrapper/sshwrapper.py\nsftp_executable = ./bastion-ansible-wrapper/sftpbastion.sh\nretries = 1\n```\n\nSigned-off-by: Wilfried Roset ","shortMessageHtmlLink":"Add support for mitogen"}},{"before":"c3da2d24c31c9505dfa1d5521904aeac54cac951","after":"0364e2038c65e9727a83965207d22031574ae8d0","ref":"refs/heads/mitogen","pushedAt":"2024-04-26T10:08:32.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"wilfriedroset","name":"Wilfried ROSET","path":"/wilfriedroset","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/12611310?s=80&v=4"},"commit":{"message":"Add support for mitogen\n\nCompared to the Vanilla Ansible, Mitogen calls `sshwrapper.py`\ndifferently. This imply a different parsing to extract the options, host\nand command. Moreover, Mitogen does not passes the `remote_user`\ntherefore we must set as well `BASTION_ANSIBLE_REMOTE_USER` env var.\n\nApart from setting the `BASTION_ANSIBLE_REMOTE_USER` the wrapper works\nfor both vanilla and mitogen connection. Users should refer to mitogen\nto learn about the installation process.\n\nThe following commit has been tested with:\n* Test case #1\n * Mitogen 0.3.7\n * Ansible 210.8\n * Python 3.9.2\n * Debian 11.9\n* Test case #2\n * Mitogen 0.3.7\n * Ansible 2.16.6\n * Python 3.12\n\nSigned-off-by: Wilfried Roset ","shortMessageHtmlLink":"Add support for mitogen"}},{"before":null,"after":"c3da2d24c31c9505dfa1d5521904aeac54cac951","ref":"refs/heads/mitogen","pushedAt":"2024-04-26T09:32:27.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"wilfriedroset","name":"Wilfried ROSET","path":"/wilfriedroset","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/12611310?s=80&v=4"},"commit":{"message":"Add support for mitogen\n\nSigned-off-by: Wilfried Roset ","shortMessageHtmlLink":"Add support for mitogen"}},{"before":"c88030ea7a920610055747619faf057dccac02b7","after":"5c7c446f050e66887c5aabbb21eea12813db5591","ref":"refs/heads/main","pushedAt":"2024-03-06T15:30:43.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"speed47","name":"Stéphane Lesimple","path":"/speed47","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/218502?s=80&v=4"},"commit":{"message":"feat: add specific code path for AWX (#26)\n\n* feat: add specific code path for AWX\r\n\r\nThe ansible bastion wrapper default lookup to get bastion vars, is to run \"ansible-inventory --list\"\r\nA downside of this way of doing, is that the whole inventory is going to be evaluated, and if we are using some custom vars plugins, there are executed to.\r\nIt can end up being very time consuming.\r\n\r\nWhen using AWX, the whole inventory is available in the AWX Execution Environment as a file.\r\nSo it is much easier and faster to get the host associated to the requested ip (the ip sent by Ansible to the ssh wrapper).\r\nThen, we can look for the bastion vars in the host vars, and if not found, execute \"ansible-inventory --host\" on the specific host, instead of the whole inventory.\r\n\r\n* remove isort, as it conflicts with black to maange import with style\r\n\r\n---------\r\n\r\nCo-authored-by: Damien Cavagnini ","shortMessageHtmlLink":"feat: add specific code path for AWX (#26)"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEOwfzmQA","startCursor":null,"endCursor":null}},"title":"Activity · ovh/the-bastion-ansible-wrapper"}