Project

General

Profile

Actions

Bug #26722

closed

ansible_user is not used when running ansible roles

Added by Tim Kächele almost 5 years ago. Updated almost 3 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Files


Related issues 1 (1 open0 closed)

Is duplicate of Ansible - Bug #32215: Job AD-HOC filled SSH related inputs are not honored by AnsibleNewActions
Actions #1

Updated by Tim Kächele almost 5 years ago

  • Subject changed from Ansible user is not used. to ansible_user is not used when connecting to host

I encountered the following problems, I have set my `ansible_user` as well as my `remote_execution_ssh_user` host parameters to `ubuntu` to in order to run my ansible roles on an ec2 instance. The connection method was ssh.

Instead of using the given username the plugin prefers to still use the default `root` user, despite those settings.

I went through the code that builds the ansible inventory and logged the `to_hash` method output to check the variables and as far as I am concerned my `ansible_user` has the correct value. But apparently the setting is not used when executing the playbook.

I used the `Run Ansible Roles` button in the hosts#show view to run ansible.

The hash produced by `InventoryCreator.to_hash` is attached to this ticket https://projects.theforeman.org/attachments/3084/inventory_creator_hash_output.json

I tested this with a fresh installation based on the foreman develop branch at `7e172ab4b6bc2a5bdb0ea18e5eac60246577534b`.
My foreman plugins are:

foreman_remote_execution: 1.7.1
foreman-tasks: 0.15.1
foreman_remote_execution_core: 1.1.6
foreman-tasks-core: 0.3.2
foreman_ansible: v2.3.3

My smart proxy plugins are:

smart_proxy_dynflow: 0784b4627f7f
smart_proxy_dynflow_core: 0784b4627f7f
foreman_remote_execution_core: 1.1.6
smart_proxy_remote_execution_ssh: 77ca00aa16cd
smart_proxy_remote_execution_ssh_core: 77ca00aa16cd
smart_proxy_ansible: 0784b4627f7f

Actions #3

Updated by Tim Kächele almost 5 years ago

  • Subject changed from ansible_user is not used when connecting to host to ansible_user is not used when running ansible roles
Actions #4

Updated by Dirk Götz almost 5 years ago

  • Found in Releases foreman-ansible 3.0.3 added

I changed Found in Releases to foreman-ansible 3.0.3 as I can confirm this bug, but only affects my environment after update to Katello 3.12/Foreman 1.22 and was running fine with at least 3.10/1.20 and 3.11/1.21 with the version 2.x of the plugin.

Actions #5

Updated by Dirk Götz almost 5 years ago

For me it is solved with remote_execution 1.8 hitting 1.22 repositories.

@Tim Kächele: Can you please update and verify? If this solves the issue for you, can you also mark it as solved.

Actions #6

Updated by Ondřej Ezr almost 3 years ago

  • Status changed from New to Duplicate

I believe this is duplicate of #32215

Actions #7

Updated by Ondřej Ezr almost 3 years ago

  • Is duplicate of Bug #32215: Job AD-HOC filled SSH related inputs are not honored by Ansible added
Actions

Also available in: Atom PDF