Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additionally mount ~/.ssh/ to /root/.ssh inside EEs #834

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ansible_runner/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ def cli_mounts():
'src': '{}/.ssh/'.format(os.environ['HOME']),
'dest': '/home/runner/.ssh/'
},
{
'src': '{}/.ssh/'.format(os.environ['HOME']),
'dest': '/root/.ssh/'
},
{
'src': '/etc/ssh/ssh_known_hosts',
'dest': '/etc/ssh/ssh_known_hosts'
Expand Down
3 changes: 2 additions & 1 deletion test/unit/config/test__base.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ def test_containerization_settings(tmp_path, container_runtime, mocker):
'--interactive',
'--workdir',
'/runner/project',
'-v', '{}/.ssh/:/home/runner/.ssh/'.format(str(tmp_path))
'-v', '{}/.ssh/:/home/runner/.ssh/'.format(str(tmp_path)),
'-v', '{}/.ssh/:/root/.ssh/'.format(str(tmp_path)),
]

if container_runtime == 'podman':
Expand Down
1 change: 1 addition & 0 deletions test/unit/config/test_ansible_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def test_prepare_config_command_with_containerization(tmp_path, container_runtim
'--workdir',
'/runner/project',
'-v', '{}/.ssh/:/home/runner/.ssh/'.format(rc.private_data_dir),
'-v', '{}/.ssh/:/root/.ssh/'.format(str(tmp_path)),
]

if container_runtime == 'podman':
Expand Down
1 change: 1 addition & 0 deletions test/unit/config/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def test_prepare_run_command_with_containerization(tmp_path, container_runtime,
'/runner/project',
'-v', '{}/:{}/'.format(cwd, cwd),
'-v', '{}/.ssh/:/home/runner/.ssh/'.format(rc.private_data_dir),
'-v', '{}/.ssh/:/root/.ssh/'.format(rc.private_data_dir),
]

if container_runtime == 'podman':
Expand Down
2 changes: 2 additions & 0 deletions test/unit/config/test_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def test_prepare_plugin_docs_command_with_containerization(tmp_path, container_r
'--workdir',
'/runner/project',
'-v', '{}/.ssh/:/home/runner/.ssh/'.format(rc.private_data_dir),
'-v', '{}/.ssh/:/root/.ssh/'.format(rc.private_data_dir),
]

if container_runtime == 'podman':
Expand Down Expand Up @@ -161,6 +162,7 @@ def test_prepare_plugin_list_command_with_containerization(tmp_path, container_r
'--workdir',
'/runner/project',
'-v', '{}/.ssh/:/home/runner/.ssh/'.format(rc.private_data_dir),
'-v', '{}/.ssh/:/root/.ssh/'.format(rc.private_data_dir),
]

if container_runtime == 'podman':
Expand Down
1 change: 1 addition & 0 deletions test/unit/config/test_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def test_prepare_inventory_command_with_containerization(tmp_path, container_run
'--workdir',
'/runner/project',
'-v', '{}/.ssh/:/home/runner/.ssh/'.format(rc.private_data_dir),
'-v', '{}/.ssh/:/root/.ssh/'.format(rc.private_data_dir),
]

if container_runtime == 'podman':
Expand Down