Skip to content

Comments

apply keychain shell#137

Merged
thaim merged 2 commits intomasterfrom
ssh-keychain-shell
Aug 8, 2025
Merged

apply keychain shell#137
thaim merged 2 commits intomasterfrom
ssh-keychain-shell

Conversation

@thaim
Copy link
Owner

@thaim thaim commented Aug 1, 2025

No description provided.

@thaim thaim requested a review from Copilot August 1, 2025 17:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Updates SSH keychain configuration in Ansible shell setup to use a more robust block-based approach instead of a single line replacement. This change improves the reliability of SSH agent loading by checking for existing keychain files before evaluation.

  • Changed from lineinfile to blockinfile for better management of multi-line shell configuration
  • Added conditional check for existing keychain files before sourcing them
  • Maintained the same keychain evaluation command with SSH agent inheritance

Comment on lines +12 to +13
if [[ -f ~/.keychain/$(hostname)-sh ]]; then
. ~/.keychain/$(hostname)-sh
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using $(hostname) in shell scripts can be unreliable in some environments. Consider using $HOSTNAME environment variable or a more explicit hostname determination method for better portability.

Suggested change
if [[ -f ~/.keychain/$(hostname)-sh ]]; then
. ~/.keychain/$(hostname)-sh
if [[ -f ~/.keychain/${HOSTNAME:-$(hostname)}-sh ]]; then
. ~/.keychain/${HOSTNAME:-$(hostname)}-sh

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@thaim thaim merged commit 91815b0 into master Aug 8, 2025
2 checks passed
@thaim thaim deleted the ssh-keychain-shell branch August 8, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant