Skip to content

Instantly share code, notes, and snippets.

@mkanoor
Created March 2, 2024 00:54
Show Gist options
  • Select an option

  • Save mkanoor/85b60d441eadf4a350fa303a8d1e0d56 to your computer and use it in GitHub Desktop.

Select an option

Save mkanoor/85b60d441eadf4a350fa303a8d1e0d56 to your computer and use it in GitHub Desktop.
- hosts: localhost
user: root
connection: local
gather_facts: no
vars:
key_file: /tmp/testing.key
key_pass_phrase: passphrase
tasks:
- name: add identity
expect:
command: ssh-add "{{ key_file }}"
responses:
passphrase: "{{ key_pass_phrase }}"
when: key_pass_phrase != None
- name: Git Clone
ansible.builtin.git:
repo: git@github.com:mkanoor/eda-project.git
dest: /tmp/myclone2
key_file: "{{ key_file }}"
- name: remove identity
command: ssh-add -D "{{ key_file }}"
when: key_pass_phrase != None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment