Summary
I have an ansible playbook that does something awesome. This works because I've setup ssh to allow me to spread the awesomeness on my servers. I wanted to setup jenkins to deliver the awesomeness automatically at the conclusion of a successful build.
This fails because jenkins does not have the same ssh capability I have. How can I achieve continuous delivery of my app using ansible and jenkins?
Option: authorize-project-plugin
https://wiki.jenkins-ci.org/display/JENKINS/Authorize+Project+plugin
I installed this plugin so that if I trigger the job it would run as me.
- Enabled 'Run as User who Triggered Build' under Configure Global Security
- Enabled 'Configure Build Authorization' and 'Run as User who Triggered Build' in my project
- Added Build step to run shell command
whoami
The console output says:
Started by user my name
Running as my name
Building in workspace my path
+ whoami
jenkins
I would have expected my username there, not jenkins.
UPDATE: I did learn that this plugin is intended for jenkins application authorizations, not system authentication. The jenkins user would need to sudo user
as part of any script execution.
Option: give jenkins user NOPASSWD sudo
The jenkins
acct is a system account, no tty by default. I could make it a full user account, grant sudo access, etc. but that seems like a bigger security issue than impersonating a user account.
Option: docker
Option: ansible tower
- jenkins version 1.617
- authorize project plugin version 1.1.0