{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3922","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3922/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3922/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3922/events","html_url":"https://github.com/ansible/ansible-modules-core/pull/3922","id":159690373,"number":3922,"title":"New state on iam_cert module","user":{"login":"Lujeni","id":757902,"avatar_url":"https://avatars.githubusercontent.com/u/757902?v=3","gravatar_id":"","url":"https://api.github.com/users/Lujeni","html_url":"https://github.com/Lujeni","followers_url":"https://api.github.com/users/Lujeni/followers","following_url":"https://api.github.com/users/Lujeni/following{/other_user}","gists_url":"https://api.github.com/users/Lujeni/gists{/gist_id}","starred_url":"https://api.github.com/users/Lujeni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lujeni/subscriptions","organizations_url":"https://api.github.com/users/Lujeni/orgs","repos_url":"https://api.github.com/users/Lujeni/repos","events_url":"https://api.github.com/users/Lujeni/events{/privacy}","received_events_url":"https://api.github.com/users/Lujeni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/cloud","name":"cloud","color":"c7def8"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/core_review","name":"core_review","color":"fad8c7"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/feature_pull_request","name":"feature_pull_request","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-10T18:08:13Z","updated_at":"2016-10-05T09:05:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/pulls/3922","html_url":"https://github.com/ansible/ansible-modules-core/pull/3922","diff_url":"https://github.com/ansible/ansible-modules-core/pull/3922.diff","patch_url":"https://github.com/ansible/ansible-modules-core/pull/3922.patch"},"body":"##### ISSUE TYPE\r\n - Feature Pull Request\r\n\r\n##### COMPONENT NAME\r\ncloud/amazon/iam_cert\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.1.0.0\r\n```\r\n\r\n##### SUMMARY\r\nI added a new state: `ping`\r\nImho it's very useful to retrieve informations about a certificate without manipulation:\r\n- check the expiration date and trigger something...\r\n- retrieve the arn path to create an aws elb with https...\r\n\r\n##### TEST\r\n###### good\r\n```\r\n19:54 $ python ansible/hacking/test-module -m ./ansible-modules-core/cloud/amazon/iam_cert.py -a \"name=xxx.com state='ping'\"\r\n***********************************\r\nRAW OUTPUT\r\n\r\n{\"upload_date\": \"2015-03-16T09:36:04Z\", \"name\": \"xxx.com\", \"expiration_date\": \"2016-09-18T05:47:53Z\", \"changed\": false, \"cert_body\": \"-----BEGIN CERTIFICATE-----\\n\\nIwQYMBaAFGtpKwm\\neO9Z9uifJ+JMspQ39UlTH+t2K+X9IseqwfNA\\n-----END CERTIFICATE-----\", \"invocation\": {\"module_args\": {\"profile\": null, \"new_name\": null, \"dup_ok\": null, \"new_path\": null, \"name\": \"mmtro.com\", \"security_token\": null, \"state\": \"ping\", \"region\": null, \"aws_secret_key\": null, \"aws_access_key\": null, \"cert\": null, \"key\": null, \"ec2_url\": null, \"path\": \"/\", \"validate_certs\": true, \"cert_chain\": null}}, \"cert_path\": \"/cloudfront/xxx.com/\", \"arn\": \"arn:aws:iam::xxx:server-certificate/cloudfront/xxx.com/xxx.com\"}\r\n\r\n\r\n***********************************\r\nPARSED OUTPUT\r\n{\r\n    \"arn\": \"arn:aws:iam::xxxserver-certificate/cloudfront/xxx.com/xxx.com\", \r\n    \"cert_body\": \"-----BEGIN CERTIFICATE-----\\/\\n41W8XFek9i9WpbFROeqZaZEtIsnZ3c5iQq7kY5k4WkykQKDgpWSOqPLhjsZzAsfb\\neO9Z9uifJ+JMspQ39UlTH+t2K+X9IseqwfNA\\n-----END CERTIFICATE-----\", \r\n    \"cert_path\": \"/cloudfront/xxx.com/\", \r\n    \"changed\": false, \r\n    \"expiration_date\": \"2015-09-18T05:47:53Z\", \r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"aws_access_key\": null, \r\n            \"aws_secret_key\": null, \r\n            \"cert\": null, \r\n            \"cert_chain\": null, \r\n            \"dup_ok\": null, \r\n            \"ec2_url\": null, \r\n            \"key\": null, \r\n            \"name\": \"xxx.com\", \r\n            \"new_name\": null, \r\n            \"new_path\": null, \r\n            \"path\": \"/\", \r\n            \"profile\": null, \r\n            \"region\": null, \r\n            \"security_token\": null, \r\n            \"state\": \"ping\", \r\n            \"validate_certs\": true\r\n        }\r\n    }, \r\n    \"name\": \"xxx.com\", \r\n    \"upload_date\": \"2015-03-16T09:36:04Z\"\r\n}\r\n```\r\n##### fail\r\n```\r\n19:54 $ python ansible/hacking/test-module -m ./ansible-modules-core-lujeni/cloud/amazon/iam_cert.py -a \"name=ansible.com state='ping'\"\r\n***********************************\r\nRAW OUTPUT\r\n\r\n{\"invocation\": {\"module_args\": {\"profile\": null, \"new_name\": null, \"dup_ok\": null, \"new_path\": null, \"name\": \"ansible.com\", \"security_token\": null, \"state\": \"ping\", \"region\": null, \"aws_secret_key\": null, \"aws_access_key\": null, \"cert\": null, \"key\": null, \"ec2_url\": null, \"path\": \"/\", \"validate_certs\": true, \"cert_chain\": null}}, \"message\": \"The Server Certificate with name ansible.com cannot be found.\", \"changed\": false, \"name\": \"ansible.com\"}\r\n\r\n\r\n***********************************\r\nPARSED OUTPUT\r\n{\r\n    \"changed\": false, \r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"aws_access_key\": null, \r\n            \"aws_secret_key\": null, \r\n            \"cert\": null, \r\n            \"cert_chain\": null, \r\n            \"dup_ok\": null, \r\n            \"ec2_url\": null, \r\n            \"key\": null, \r\n            \"name\": \"ansible.com\", \r\n            \"new_name\": null, \r\n            \"new_path\": null, \r\n            \"path\": \"/\", \r\n            \"profile\": null, \r\n            \"region\": null, \r\n            \"security_token\": null, \r\n            \"state\": \"ping\", \r\n            \"validate_certs\": true\r\n        }\r\n    }, \r\n    \"message\": \"The Server Certificate with name ansible.com cannot be found.\", \r\n    \"name\": \"ansible.com\"\r\n}\r\n```\r\nThanks"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/251621482","html_url":"https://github.com/ansible/ansible-modules-core/pull/3922#issuecomment-251621482","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3922","id":251621482,"user":{"login":"Lujeni","id":757902,"avatar_url":"https://avatars.githubusercontent.com/u/757902?v=3","gravatar_id":"","url":"https://api.github.com/users/Lujeni","html_url":"https://github.com/Lujeni","followers_url":"https://api.github.com/users/Lujeni/followers","following_url":"https://api.github.com/users/Lujeni/following{/other_user}","gists_url":"https://api.github.com/users/Lujeni/gists{/gist_id}","starred_url":"https://api.github.com/users/Lujeni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lujeni/subscriptions","organizations_url":"https://api.github.com/users/Lujeni/orgs","repos_url":"https://api.github.com/users/Lujeni/repos","events_url":"https://api.github.com/users/Lujeni/events{/privacy}","received_events_url":"https://api.github.com/users/Lujeni/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T09:05:21Z","updated_at":"2016-10-05T09:05:21Z","body":"@gregdek Someone can review this code pls?"}}
{"actor":{"display_login":"Lujeni"}}