{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/231","labels_url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/231/comments","events_url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/231/events","html_url":"https://github.com/jenkinsci/puppet-jenkins/pull/231","id":53828001,"number":231,"title":"Add ldap and roles","user":{"login":"abayer","id":120218,"avatar_url":"https://avatars.githubusercontent.com/u/120218?v=3","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-09T02:44:13Z","updated_at":"2015-01-09T12:08:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/pulls/231","html_url":"https://github.com/jenkinsci/puppet-jenkins/pull/231","diff_url":"https://github.com/jenkinsci/puppet-jenkins/pull/231.diff","patch_url":"https://github.com/jenkinsci/puppet-jenkins/pull/231.patch"},"body":"So this is very very preliminary and annoyingly chock full of my IDE reindenting the shit out of things, but...\r\n\r\n* Rework puppet_helper.groovy to use groovy.util.CliBuilder, so that we don't have to worry about things like order of arguments and the like. Not huuuuuge yet, but I think it's valuable, so that we could do null values for arguments etc.\r\n* As a result, change all the methods to take a Map as their only argument - this is so that the magic method dispatch stuff doesn't need to know the names of the arguments for each method. That map is generated from CliBuilder's results (with some twiddling to always have unspecified arguments show up as an empty string, rather than null, just to make things safer), and then the values there are accessed by \"args.whatever_argument_flag_name\".\r\n** The above two may be excessive, I admit. But future proofing, yo. Future proofing.\r\n* In security.pp, add ldapconfig and permissions variables, intended to be specified in hiera. This stuff is the gnarly part - to get hashes in particular from Puppet to something puppet_helper.groovy can know about is...yeah. So we serialize these down to /tmp/something.json via templates, and then pass the path to those files as arguments to puppet_helper. puppet_helper then knows to slurp them in and use 'em. Woo.\r\n* And then we take the new possible values for security_model (global_matrix) and user_realm (ldap) - if they're selected, we instantiate/populate the objects using the data we just deserialized. Tada!\r\n\r\nSo yeah, no idea if it actually *works* yet. But I wanted to throw this up to make sure I wasn't too batshit. As I write this, I'm thinking I probably am in some parts (most notably the CliBuilder and args as Maps bits - I'm not 100% sure we actually *need* either of those things as this currently stands, but they both come in handy for further extensions in the future). So tell me what's too crazy and I will clean it out."},"comment":{"url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/comments/69326658","html_url":"https://github.com/jenkinsci/puppet-jenkins/pull/231#issuecomment-69326658","issue_url":"https://api.github.com/repos/jenkinsci/puppet-jenkins/issues/231","id":69326658,"user":{"login":"adilmehmoodbutt","id":6523178,"avatar_url":"https://avatars.githubusercontent.com/u/6523178?v=3","gravatar_id":"","url":"https://api.github.com/users/adilmehmoodbutt","html_url":"https://github.com/adilmehmoodbutt","followers_url":"https://api.github.com/users/adilmehmoodbutt/followers","following_url":"https://api.github.com/users/adilmehmoodbutt/following{/other_user}","gists_url":"https://api.github.com/users/adilmehmoodbutt/gists{/gist_id}","starred_url":"https://api.github.com/users/adilmehmoodbutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adilmehmoodbutt/subscriptions","organizations_url":"https://api.github.com/users/adilmehmoodbutt/orgs","repos_url":"https://api.github.com/users/adilmehmoodbutt/repos","events_url":"https://api.github.com/users/adilmehmoodbutt/events{/privacy}","received_events_url":"https://api.github.com/users/adilmehmoodbutt/received_events","type":"User","site_admin":false},"created_at":"2015-01-09T12:08:36Z","updated_at":"2015-01-09T12:08:36Z","body":"How can i  migrate Gitlab accounts from standard accounts to ldap users along with work history."}}