This post will be demonstrated using Secret File.
- Select the Credentials “Kind” – “Secret File”
- Enter the password in a plain text file
- Enter a ID, Description and upload the plain text file
- UsingĀ Credentials Binding Plugin, enter the following in the Jenkinsfile where credentialsId refers to ID field above
withCredentials([file(credentialsId: ‘ID’, variable: ‘FILE’)]) {
ansiblePlaybook(
playbook: ‘playbook.yml’,
sudo: true)
}
}
Leave a Reply