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

EE Getting started: add SSH forwarding #39

Merged
merged 6 commits into from
Apr 23, 2024
Merged
16 changes: 15 additions & 1 deletion docs/getting_started_ee/run_execution_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Execute a playbook inside the `postgresql_ee` EE against a remote host machine a
cat > test_remote.yml<<EOF
- name: Gather and print facts
hosts: all
become: true
gather_facts: true
tasks:

Expand All @@ -82,6 +81,21 @@ Execute a playbook inside the `postgresql_ee` EE against a remote host machine a
ansible-navigator run test_remote.yml -i inventory --execution-environment-image postgresql_ee:latest --mode stdout --pull-policy missing --enable-prompts -u student -k -K
```

## SSH keys forwarding
Andersson007 marked this conversation as resolved.
Show resolved Hide resolved

If you run Ansible with SSH-keys-based authentication to avoid authentication prompts, use `ssh-agent` to forward the SSH keys to your EE:
Andersson007 marked this conversation as resolved.
Show resolved Hide resolved

``` bash
eval $(ssh-agent)
ssh-add </path/to/your/private/key>
```

To test the above playbook, add the `remote_user: <your_ssh_user>` field to the play and then run:
Andersson007 marked this conversation as resolved.
Show resolved Hide resolved

``` bash
ansible-navigator run test_remote.yml -i inventory --execution-environment-image postgresql_ee:latest --mode stdout --pull-policy missing
```

## See also

- [Execution Environment Definition](https://ansible-builder.readthedocs.io/en/stable/definition/) provides information about the about Execution Environment definition file and available options.
Expand Down