Ansible Tower - passphrase in Custom credentials

225 views Asked by At

I am using ansible git module for cloning the bitbucket repository. Instead of using username and the password, I am using the private key.

my private key is generated and protected with a passphrase.

My keys are configured good with bitbucket. I am able to clone the repository without any issues from backend.

Issue arises when I try to use the key with git module in a playbook. I use the bitbucket custom credentials with the below input and inject configurations. Input Configuration:

fields:
  -  multiline: true
     secret: true
     type: string
     id: bitbucket_private_key
     label: Custome Bitbucket Private Key

Injector Configuration:

extra_vars:
  bitbucket_key: "{{tower.filename.scm_key}}"
file: 
  template.scm_key: "{{bitbucket_private_key}}"

The account I am using is a service account, so the key is protected with a passphrase.

If I use a private key without a passphrase, it works absolutely fine. But if I use a private key with passphrase, I always get permission denied, for cloning using git module.

Can some one please help me either "How to configure custom credentials with private key and passphrase" or any other solution.

Thanks in advance.

0

There are 0 answers