Skip to content

Commit

Permalink
ansible config: set private key explicitly
Browse files Browse the repository at this point in the history
Apart from adding the SSH private key to the SSH arguments, we need to
set the `private_key_file` option in ansible.cfg.

Signed-off-by: Antonio Torres <[email protected]>
  • Loading branch information
antoniotorresm committed Dec 12, 2023
1 parent b566238 commit 3d32a1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ipaperftest/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def getLevelName(level):
remote_user = root
host_key_checking = False
deprecation_warnings = False
private_key_file = {private_key_path}
roles_path = {cwd}/ansible-freeipa/roles
library = {cwd}/ansible-freeipa/plugins/modules
module_utils = {cwd}/ansible-freeipa/plugins/module_utils
Expand Down
2 changes: 1 addition & 1 deletion src/ipaperftest/core/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def clone_ansible_freeipa(self, ctx):
with open("runner_metadata/ansible.cfg", "w") as f:
f.write(ANSIBLE_CFG_TEMPLATE.format(
cwd=os.path.join(os.getcwd(), "runner_metadata"),
private_key_path=ctx.params["private_key"],
private_key_path=ctx.params["private_key"] or self.provider.default_private_key,
default_private_key_path=self.provider.default_private_key
)
)
Expand Down

0 comments on commit 3d32a1d

Please sign in to comment.