Connection plugin openstack.osa.ssh does not respect REMOTE_USER
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack-Ansible |
New
|
High
|
Dmitriy Rabotyagov |
Bug Description
When running playbook or ad-hoc and passing "-u USER" as an argument, it is ignored by connection plugin.
Intended behaviour:
/opt/openstack-
Variable files: "-e @/etc/openstack
ansible [core 2.13.8]
config file = None
configured module search path = ['/etc/
ansible python module location = /opt/ansible-
ansible collection location = /etc/ansible
executable location = /opt/ansible-
python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
jinja version = 3.1.2
libyaml = True
No config file found; using defaults
host_list declined parsing /opt/openstack-
Parsed /opt/openstack-
host_list declined parsing /opt/openstack-
script declined parsing /opt/openstack-
auto declined parsing /opt/openstack-
yaml declined parsing /opt/openstack-
Parsed /opt/openstack-
host_list declined parsing /etc/openstack_
script declined parsing /etc/openstack_
auto declined parsing /etc/openstack_
yaml declined parsing /etc/openstack_
Parsed /etc/openstack_
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
META: ran handlers
Using module file /opt/ansible-
Pipelining is enabled.
<172.16.8.73> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<172.16.8.73> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=300 -o StrictHostKeyCh
<172.16.8.73> (0, b'\n{"ping": "pong", "invocation": {"module_args": {"data": "pong"}}}\n', b"Warning: Permanently added '172.16.8.73' (ED25519) to the list of known hosts.\r\n")
compute23 | SUCCESS => {
"changed": false,
"invocation": {
"data": "pong"
}
},
"ping": "pong"
}
META: ran handlers
META: ran handlers
=======
Actual behavior with our connection plugin:
/opt/openstack-
Variable files: "-e @/etc/openstack
ansible [core 2.13.8]
config file = None
configured module search path = ['/etc/
ansible python module location = /opt/ansible-
ansible collection location = /etc/ansible
executable location = /opt/ansible-
python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
jinja version = 3.1.2
libyaml = True
No config file found; using defaults
host_list declined parsing /opt/openstack-
Parsed /opt/openstack-
host_list declined parsing /opt/openstack-
script declined parsing /opt/openstack-
auto declined parsing /opt/openstack-
yaml declined parsing /opt/openstack-
Parsed /opt/openstack-
host_list declined parsing /etc/openstack_
script declined parsing /etc/openstack_
auto declined parsing /etc/openstack_
yaml declined parsing /etc/openstack_
Parsed /etc/openstack_
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
META: ran handlers
container_name: "compute23"
physical_host: "compute23"
Using module file /opt/ansible-
Pipelining is enabled.
<172.16.8.73> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<172.16.8.73> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=300 -o StrictHostKeyCh
<172.16.8.73> (142, b'Please login as the user "ubuntu" rather than the user "root".\n\n', b'')
<172.16.8.73> Failed to connect to the host via ssh:
compute23 | FAILED! => {
"changed": false,
"module_
"module_
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 142
}
=======
So while you see "ESTABLISH SSH CONNECTION FOR USER: ubuntu" in output, it in fact has no effect, since "-o 'User="ubuntu"'" is never added to the actual command.
Workaround:
Supplying `-e ansible_
root@cc-
Variable files: "-e @/etc/openstack
ansible [core 2.13.8]
config file = None
configured module search path = ['/etc/
ansible python module location = /opt/ansible-
ansible collection location = /etc/ansible
executable location = /opt/ansible-
python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
jinja version = 3.1.2
libyaml = True
No config file found; using defaults
host_list declined parsing /opt/openstack-
Parsed /opt/openstack-
host_list declined parsing /opt/openstack-
script declined parsing /opt/openstack-
auto declined parsing /opt/openstack-
yaml declined parsing /opt/openstack-
Parsed /opt/openstack-
host_list declined parsing /etc/openstack_
script declined parsing /etc/openstack_
auto declined parsing /etc/openstack_
yaml declined parsing /etc/openstack_
Parsed /etc/openstack_
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
META: ran handlers
container_name: "compute23"
physical_host: "compute23"
Using module file /opt/ansible-
Pipelining is enabled.
container_name: "compute23"
physical_host: "compute23"
<172.16.8.73> ESTABLISH SSH CONNECTION FOR USER: ubuntu
<172.16.8.73> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=300 -o StrictHostKeyCh
<172.16.8.73> (0, b'\n{"ping": "pong", "invocation": {"module_args": {"data": "pong"}}}\n', b'')
compute23 | SUCCESS => {
"changed": false,
"invocation": {
"data": "pong"
}
},
"ping": "pong"
}
META: ran handlers
META: ran handlers
root@cc-
description: | updated |
description: | updated |
Changed in openstack-ansible: | |
assignee: | nobody → Dmitriy Rabotyagov (noonedeadpunk) |
importance: | Undecided → High |