Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize fails - Issue with "ansible_ssh_pipelining" #29

Closed
malywut opened this issue Oct 13, 2017 · 3 comments
Closed

Initialize fails - Issue with "ansible_ssh_pipelining" #29

malywut opened this issue Oct 13, 2017 · 3 comments
Labels

Comments

@malywut
Copy link

malywut commented Oct 13, 2017

I am running in an issue with the task "Ensure PostgreSQL database is initialized." in initialize.yml. The task fails with

TASK [postgresql : Ensure PostgreSQL database is initialized.] *****************
fatal: [myhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Failed to add the host to the list of known hosts (/root/.ssh/known_hosts).\r\nFailed to add the ho st to the list of known hosts (/root/.ssh/known_hosts).\r\nsudo: sorry, you must have a tty to run sudo\n", "module_stdout": "", "msg": "MODULE FAILURE"}

I use this role by installing it with ansible-galaxy, and in a playbook with
name: Install postgresql
hosts: myhost
become: yes
roles:
- postgresql
vars:
postgresql_global_config_options:
- option: listen_addresses
value: '*'
postgresql_version: 9.4
tags:
- hdp
- database
The playbook is run in a vagrant environment.

I suspect that this issue is coming from the fact that I am using a ssh config with a ProxyCommand to ssh to "myhost" through a bastion host.
"myhost" and the bastion host are both running CentOS 7.

The task runs successfully when I comment the line
ansible_ssh_pipelining: true

Would it be possible to make this "ansible_ssh_pipelining" value overridable ?

@tatwell
Copy link

tatwell commented Oct 31, 2017

I hit this same issue when trying to run this role against a VirtualBox VM running Red Hat 7. Following @malywut's lead, I comment out the ansible_ssh_pipelining lines in the following files:

You can see from the source that the command references this comment:

There's a discussion of the role of SSH pipelining in Ansible here:

As I read it, the settings is tied to performance rather than security so making the value overridable makes sense to me:

With pipelining enabled, Ansible will connect only once per task using ssh to execute python, and write the module source to its stdin. Even with persistent ssh connections enabled, it's a noticeable improvement to make only one ssh connection per task.

But I freely admit to not knowing all the implications of the change.

I'm also not clear on why it's an issue in the first place. Another member of my team ran the same playbook in a very similar environment with default pipeline setting enabled and did not encounter this issue.

@stale
Copy link

stale bot commented Mar 6, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Mar 6, 2020
@stale
Copy link

stale bot commented Apr 5, 2020

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

@stale stale bot closed this as completed Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants