From 29a9f4ea0c8ce059680f175208d5909e6992afe6 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 13 Sep 2022 11:36:44 +0200 Subject: [PATCH] always use root for `ansible_user` 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] https://github.com/CentOS/duffy/issues/608 --- plugins/inventory/inventory.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/inventory/inventory.py b/plugins/inventory/inventory.py index 7bfc751..15e82a9 100644 --- a/plugins/inventory/inventory.py +++ b/plugins/inventory/inventory.py @@ -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():