Skip to content

Commit

Permalink
always use root for ansible_user
Browse files Browse the repository at this point in the history
while the user is currently not exposed via the api (see [1]), it's
always `root` and inventory consumers should not have to set this
themself

[1] CentOS/duffy#608
  • Loading branch information
evgeni committed Sep 13, 2022
1 parent 51fa416 commit 29a9f4e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/inventory/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def parse(self, inventory, loader, path, cache=True):
self.inventory.add_host(node.hostname)

self.inventory.set_variable(node.hostname, 'ansible_host', str(node.ipaddr))
# always use `root` until https://github.com/CentOS/duffy/issues/608 is fixed
self.inventory.set_variable(node.hostname, 'ansible_user', 'root')

host_vars = {'duffy_session': session.id}
for key, value in dict(node).items():
Expand Down

0 comments on commit 29a9f4e

Please sign in to comment.