From 60ff1c572e74fc53d518c6fca9eff37df37952f3 Mon Sep 17 00:00:00 2001
From: Karol Hosiawa <hosiawak@gmail.com>
Date: Mon, 28 Apr 2014 19:48:52 +0200
Subject: [PATCH] Add validate_certs option to apt_repository

---
 library/packaging/apt_repository | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/library/packaging/apt_repository b/library/packaging/apt_repository
index a9f061ec37e..c49b4003f4b 100644
--- a/library/packaging/apt_repository
+++ b/library/packaging/apt_repository
@@ -55,6 +55,13 @@ options:
         required: false
         default: "yes"
         choices: [ "yes", "no" ]
+    validate_certs:
+        description:
+            - If C(no), SSL certificates for the target repo will not be validated. This should only be used
+              on personally controlled sites using self-signed certificates.
+        required: false
+        default: 'yes'
+        choices: ['yes', 'no']
 author: Alexander Saltanov
 version_added: "0.7"
 requirements: [ python-apt ]
@@ -377,6 +384,7 @@ def main():
             update_cache = dict(aliases=['update-cache'], type='bool', default='yes'),
             # this should not be needed, but exists as a failsafe
             install_python_apt=dict(required=False, default="yes", type='bool'),
+            validate_certs = dict(default='yes', type='bool'),
         ),
         supports_check_mode=True,
     )