Skip to content

Commit

Permalink
Temp disable ssh post-provision task.
Browse files Browse the repository at this point in the history
  • Loading branch information
greylabel committed Jul 12, 2024
1 parent 2e294a6 commit 5c74b69
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion default.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,4 +499,4 @@ pre_provision_tasks:
# Glob pattern to ansible task files to run after all other tasks are finished.
post_provision_tasks:
- tasks/post-provision.yml
- tasks/ssh-post.yml
# - tasks/ssh-post.yml # needs refactoring
26 changes: 14 additions & 12 deletions tasks/ssh-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@
set -o pipefail
"ps -p {{ lookup('ansible.builtin.env', 'SSH_AGENT_PID') }}"
register: ssh_agent_started
when: ssh_agent_pid != '' # should be checking type == int
when: ssh_agent_pid != ''
changed_when: false

- name: Check if key has been added to ssh-agent.
ansible.builtin.shell: |
set -o pipefail
ssh-add -l | grep "no identities"
register: ssh_key_added
changed_when: false
# - name: Check if key has been added to ssh-agent.
# ansible.builtin.shell: |
# set -o pipefail
# ssh-add -l | grep "no identities"
# when: ssh_agent_started.rc == 0
# register: ssh_key_not_added
# failed_when: ssh_key_not_added.rc >= 2
# changed_when: false

# - name: Ensure ssh-agent is running and add SSH key to the ssh-agent.
# shell: |
# eval "$(ssh-agent)"
# ssh-add --apple-use-keychain ~/.ssh/id_ed25519
# when: ssh_agent_started.skipped == true
- name: Ensure ssh-agent is running and add SSH key to the ssh-agent.
shell: |
eval "$(ssh-agent)"
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
when: ssh_agent_started.rc == 0

0 comments on commit 5c74b69

Please sign in to comment.