{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/21097","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/21097/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/21097/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/21097/events","html_url":"https://github.com/ansible/ansible/pull/21097","id":205931661,"number":21097,"title":"Added option validate_certs to the jenkins_job module","user":{"login":"samyray","id":230967,"avatar_url":"https://avatars.githubusercontent.com/u/230967?v=3","gravatar_id":"","url":"https://api.github.com/users/samyray","html_url":"https://github.com/samyray","followers_url":"https://api.github.com/users/samyray/followers","following_url":"https://api.github.com/users/samyray/following{/other_user}","gists_url":"https://api.github.com/users/samyray/gists{/gist_id}","starred_url":"https://api.github.com/users/samyray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samyray/subscriptions","organizations_url":"https://api.github.com/users/samyray/orgs","repos_url":"https://api.github.com/users/samyray/repos","events_url":"https://api.github.com/users/samyray/events{/privacy}","received_events_url":"https://api.github.com/users/samyray/received_events","type":"User","site_admin":false},"labels":[{"id":454885231,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.3","name":"affects_2.3","color":"5319e7","default":false},{"id":48457821,"url":"https://api.github.com/repos/ansible/ansible/labels/feature_pull_request","name":"feature_pull_request","color":"006b75","default":false},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":61436281,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_revision","name":"needs_revision","color":"eb6450","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-02-07T15:57:54Z","updated_at":"2017-02-20T20:21:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/21097","html_url":"https://github.com/ansible/ansible/pull/21097","diff_url":"https://github.com/ansible/ansible/pull/21097.diff","patch_url":"https://github.com/ansible/ansible/pull/21097.patch"},"body":"##### ISSUE TYPE\r\n - Feature Pull Request\r\n\r\n\r\n##### COMPONENT NAME\r\nOption to disable SSL verification for jenkins_job module\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.2.1.0 (detached HEAD 5362910000) last updated 2017/01/21 16:09:44 (GMT +100)\r\n  lib/ansible/modules/core: (detached HEAD 7e8bb413b7) last updated 2017/01/21 16:10:55 (GMT +100)\r\n  lib/ansible/modules/extras: (detached HEAD c501e006ea) last updated 2017/01/21 16:11:38 (GMT +100)\r\n  config file =\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\nMany companies using self-sign SSL certificates in their estate for Jenkins masters and as a result, if you're trying to use \"jenkins_job\" module it fails with following error:\r\n\r\n```\r\nansible-playbook -i localhost site.yml -e jenkins_url=\"https://jenkins-internal.test.com\" -e jenkins_token=\"XXXXXXXXX\"\r\n [WARNING]: Host file not found: localhost\r\n\r\n [WARNING]: provided hosts list is empty, only localhost is available\r\n\r\n\r\nPLAY [localhost] ***************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [localhost]\r\n\r\nTASK [Load variables] **********************************************************\r\nok: [localhost]\r\n\r\nTASK [Add jenkins job] *********************************************************\r\nfailed: [localhost] (item=({u'name': u'Test job'], \"msg\": \"Unable to validate if job exists, Error in request: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) for https://jenkins-internal.test.com\"}\r\n```\r\n\r\nI've added additional option to this module:\r\n\r\n```\r\n  validate_certs:\r\n    description:\r\n      - If set to C(False), the SSL certificates will not be validated.\r\n        This should only set to C(False) used on personally controlled sites\r\n        using self-signed certificates as it avoids verifying the source site.\r\n    required: False\r\n    default: True\r\n```\r\n\r\nAnd now with this option it ignores SSL errors:\r\n\r\n```\r\nansible-playbook -i localhost site.yml -e jenkins_url=\"https://jenkins-internal.test.com\" -e jenkins_token=\"XXXXXXXXX\"\r\n [WARNING]: Host file not found: localhost\r\n\r\n [WARNING]: provided hosts list is empty, only localhost is available\r\n\r\n\r\nPLAY [localhost] ***************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [localhost]\r\n\r\nTASK [Load variables] **********************************************************\r\nok: [localhost]\r\n\r\nTASK [Add jenkins job] *********************************************************\r\nok: [localhost] => (item=({u'name': u'Test job'}))\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=3    changed=0    unreachable=0    failed=0\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/281173230","html_url":"https://github.com/ansible/ansible/pull/21097#issuecomment-281173230","issue_url":"https://api.github.com/repos/ansible/ansible/issues/21097","id":281173230,"user":{"login":"sermilrod","id":5130619,"avatar_url":"https://avatars.githubusercontent.com/u/5130619?v=3","gravatar_id":"","url":"https://api.github.com/users/sermilrod","html_url":"https://github.com/sermilrod","followers_url":"https://api.github.com/users/sermilrod/followers","following_url":"https://api.github.com/users/sermilrod/following{/other_user}","gists_url":"https://api.github.com/users/sermilrod/gists{/gist_id}","starred_url":"https://api.github.com/users/sermilrod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sermilrod/subscriptions","organizations_url":"https://api.github.com/users/sermilrod/orgs","repos_url":"https://api.github.com/users/sermilrod/repos","events_url":"https://api.github.com/users/sermilrod/events{/privacy}","received_events_url":"https://api.github.com/users/sermilrod/received_events","type":"User","site_admin":false},"created_at":"2017-02-20T20:21:15Z","updated_at":"2017-02-20T20:21:15Z","body":"@mattclay Thank you very much! \r\n\r\nFor me this new feature looks good now. I give my 'shipit' and waiting for another OK."}}
{"actor":{"display_login":"sermilrod"}}