Skip to content

(WIP) Add jenkins public key to hosts with Ansible - #20

Open
deepshikhaaa wants to merge 4 commits into
gluster:masterfrom
deepshikhaaa:authorized-key
Open

(WIP) Add jenkins public key to hosts with Ansible#20
deepshikhaaa wants to merge 4 commits into
gluster:masterfrom
deepshikhaaa:authorized-key

Conversation

@deepshikhaaa

@deepshikhaaa deepshikhaaa commented Sep 6, 2017

Copy link
Copy Markdown
Member

Added id_rsa.pub in files folder and task(jenkins_credential.yml) in task folder.
I have not included this task in main.yml yet.
@nigelbabu @mscherer Please review it so that I can add it in main.yml

@nigelbabu nigelbabu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mscherer I created an SSH key on Jenkins server and gave Deepshikha the public key for it. This seemed to be the best way to go about it.

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAtKdhpALPqLAThPbPWe7xRDd5Nv45loeri5bFNG9RnjuX7Xhi0cmgXGfUfyIIAAlm0U0bOKtGaKsT6aiBPfQ/P4EzIsrnmsm7MHdxYQMzQK5lugI0fz77CViUxTzoOdwlT0np0H4uNCmWipUtP52WaR9dGgYdktlxKR8jbP1nzqinIJ0OD/YXPUM+6a3miKEQtUl6GRWgXElBZlTwbSmqWjNWe22dQUgsGtINS0CnRSU8tVeuXjayKf41CJme89t1XhFYIbZAfrPmObOR1f3uzSTRtAF6Ph1yfjZtY1U+jU/AGvUg5umQqdUH/lKvL6WKyuvlMckHAgbw/T81pWLP9XnWYfwiWkaQtvCeG2uW0N9pmuxWjvhFBWSmJzzzsglWlQ0l6M6SaIq3Qqn5RaKWccR6xTIpu92qvRMokICcLkvH0uqqSaPAS/kqIjRD5LsoxOymJBdLdGg9BOHYClLthV6wkpuUl2voWVswLQk4E0fa4n3Q2kkg5qwMZhr1oZzDNbnOS70PLWHtCqtLOCH/GMR6gbASbPc2p3ZmtTWqwAcAp008Ct7lZD5OVkX3jYNZdJadYFlXT9c1jb0lSN3NGkmpzE/edyjj8S3iV2S48Bz7N9UBghXfmHEdu6tCXp24xgeBv7QS69Q+6U9DwjBH76qq42iJtTNrjOFyXDhkGQM= Shared Jenkins Key

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call this file jenkins_key.pub?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've got both files now. Can you git rm roles/jenkins_builder/files/id_rsa.pub

---
- name: Placing ssh public key for Jenkins_int_rht
authorized_key:
user: root

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why root, shouldn't jenkins connect as the jenkins user ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing we need a become? Don't think we have the right keys to connect as root user directly

@mscherer

mscherer commented Sep 7, 2017

Copy link
Copy Markdown
Contributor

Creating a ssh key manually is the easiest, but I would prefer to have that part automated as well. But let's not ask for the moon yet :)

---
- name: Placing ssh public key for Jenkins_int_rht
authorized_key:
user: jenkins

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mscherer Wouldn't this fail because we don't have the ansible master key in the jenkins user?

@mscherer mscherer Sep 13, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it just edit a different file as root if we give a "user" parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants