To access a Git repository Jenkins can use an SSH key.
To add the SSH key to the Jenkins server use the following Chef script
All SSL Certificates require a private key to work. The private key is a separate file that’s used in the encryption/decryption of data sent between your server and the connecting clients. A private key is created by you—the certificate owner—when you request. I'm trying to understand the concept of Chef clients and validators, and their relationship to the bootstrapping process. Generate ssh key linux ubuntu. Spss 24 license key generator. According to this article, the chef-client will use the /etc/chef/validation.pem private key to authenticate itself for the initial run, because /etc/chef/client.pem doesn't exist yet. The location of the file that contains the client key. Default value: /etc/chef/client.pem.-K KEYFILE, -validationkey KEYFILE. The location of the file that contains the key used when a Chef Infra Client is registered with a Chef Infra Server. A validation key is signed using the.
Store the SSH key in an encrypted data bag called “keys”.
Add the following to the Jenkins Chef recipe
- Install Git
- Install the Git and Credentials Jenkins plugins
- Copy the SSH key to the Jenkins server
- Add github.com to the known hosts
To specify the SSH key in the Git step
Chef Server Generate Private Key Blockchain
- When the Jenkins server is operational, navigate to the Web interface
- Create a new Jenkins project
- In the Source Code Management section
- Select Git
- Enter the SSH URL of the repository
- When you are adding the first project, click the Add button to create the credential
- Click Jenkins to select the credentials provider
- Select SSH Username with private key as the Kind
- Enter the username you used when you created the SSH key for the Git repository
- Select From the Jenkins master ~/.ssh as the Private Key
- Click the Add button
- Click Jenkins to select the credentials provider
- In the Credentials drop down select the credential you have created (the Git user name)