prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Bump Ansible to 2.4
  ## Description
  
  The current version of Ansible in the admin workstation uses PyCrypto==2.6.1 as a dependency, which is causing CI safety failures when checking the admin pip requirements due to the fact that there is a CVE in PyCrypto 2.6.1. See upstream discussion in https://github.com/ansible/ansible/issues/23179. 
  
  We should bump to a more recent version of Ansible in the admin workstations that does not have PyCrypto as a dependency
  
  ## User Stories
  
  As a SecureDrop administrator, I don't want to run software relying on unmaintained dependencies.
  Temporarily disable safety check
  ## Description
  
  We'll need to temporarily disable safety in order to merge until #2926 is resolved (and we'll need to cherry pick the disabling of safety into the 0.5.2 release branch). 
  
  ## User Stories
  
  As a SecureDrop maintainer, I don't want to merge with failing CI. 
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `install_files/ansible-base/callback_plugins/ansible_version_check.py`
  Content:
  ```
  1 # -*- encoding:utf-8 -*-
  2 from __future__ import absolute_import, division, print_function, unicode_literals
  3 
  4 import sys
  5 
  6 import ansible
  7 
  8 try:
  9     # Version 2.0+
  10     from ansible.plugins.callback import CallbackBase
  11 except ImportError:
  12     CallbackBase = object
  13 
  14 
  15 def print_red_bold(text):
  16     print('\x1b[31;1m' + text + '\x1b[0m')
  17 
  18 
  19 class CallbackModule(CallbackBase):
  20     def __init__(self):
  21         # Can't use `on_X` because this isn't forwards compatible with Ansible 2.0+
  22         required_version = '2.3.2'  # Keep synchronized with group_vars/all/main.yml
  23         if not ansible.__version__.startswith(required_version):
  24             print_red_bold(
  25                 "SecureDrop restriction: only Ansible {version}.* is supported. "
  26                 .format(version=required_version)
  27             )
  28             sys.exit(1)
  29
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/install_files/ansible-base/callback_plugins/ansible_version_check.py b/install_files/ansible-base/callback_plugins/ansible_version_check.py
  --- a/install_files/ansible-base/callback_plugins/ansible_version_check.py
  +++ b/install_files/ansible-base/callback_plugins/ansible_version_check.py
  @@ -19,7 +19,7 @@
   class CallbackModule(CallbackBase):
       def __init__(self):
           # Can't use `on_X` because this isn't forwards compatible with Ansible 2.0+
  -        required_version = '2.3.2'  # Keep synchronized with group_vars/all/main.yml
  +        required_version = '2.4.2'  # Keep synchronized with requirements files
           if not ansible.__version__.startswith(required_version):
               print_red_bold(
                   "SecureDrop restriction: only Ansible {version}.* is supported. "
  
verification_info: {"golden_diff": "diff --git a/install_files/ansible-base/callback_plugins/ansible_version_check.py b/install_files/ansible-base/callback_plugins/ansible_version_check.py\n--- a/install_files/ansible-base/callback_plugins/ansible_version_check.py\n+++ b/install_files/ansible-base/callback_plugins/ansible_version_check.py\n@@ -19,7 +19,7 @@\n class CallbackModule(CallbackBase):\n     def __init__(self):\n         # Can't use `on_X` because this isn't forwards compatible with Ansible 2.0+\n-        required_version = '2.3.2'  # Keep synchronized with group_vars/all/main.yml\n+        required_version = '2.4.2'  # Keep synchronized with requirements files\n         if not ansible.__version__.startswith(required_version):\n             print_red_bold(\n                 \"SecureDrop restriction: only Ansible {version}.* is supported. \"\n", "issue": "Bump Ansible to 2.4\n## Description\r\n\r\nThe current version of Ansible in the admin workstation uses PyCrypto==2.6.1 as a dependency, which is causing CI safety failures when checking the admin pip requirements due to the fact that there is a CVE in PyCrypto 2.6.1. See upstream discussion in https://github.com/ansible/ansible/issues/23179. \r\n\r\nWe should bump to a more recent version of Ansible in the admin workstations that does not have PyCrypto as a dependency\r\n\r\n## User Stories\r\n\r\nAs a SecureDrop administrator, I don't want to run software relying on unmaintained dependencies.\nTemporarily disable safety check\n## Description\r\n\r\nWe'll need to temporarily disable safety in order to merge until #2926 is resolved (and we'll need to cherry pick the disabling of safety into the 0.5.2 release branch). \r\n\r\n## User Stories\r\n\r\nAs a SecureDrop maintainer, I don't want to merge with failing CI. \n", "before_files": [{"content": "# -*- encoding:utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport sys\n\nimport ansible\n\ntry:\n    # Version 2.0+\n    from ansible.plugins.callback import CallbackBase\nexcept ImportError:\n    CallbackBase = object\n\n\ndef print_red_bold(text):\n    print('\\x1b[31;1m' + text + '\\x1b[0m')\n\n\nclass CallbackModule(CallbackBase):\n    def __init__(self):\n        # Can't use `on_X` because this isn't forwards compatible with Ansible 2.0+\n        required_version = '2.3.2'  # Keep synchronized with group_vars/all/main.yml\n        if not ansible.__version__.startswith(required_version):\n            print_red_bold(\n                \"SecureDrop restriction: only Ansible {version}.* is supported. \"\n                .format(version=required_version)\n            )\n            sys.exit(1)\n", "path": "install_files/ansible-base/callback_plugins/ansible_version_check.py"}], "after_files": [{"content": "# -*- encoding:utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport sys\n\nimport ansible\n\ntry:\n    # Version 2.0+\n    from ansible.plugins.callback import CallbackBase\nexcept ImportError:\n    CallbackBase = object\n\n\ndef print_red_bold(text):\n    print('\\x1b[31;1m' + text + '\\x1b[0m')\n\n\nclass CallbackModule(CallbackBase):\n    def __init__(self):\n        # Can't use `on_X` because this isn't forwards compatible with Ansible 2.0+\n        required_version = '2.4.2'  # Keep synchronized with requirements files\n        if not ansible.__version__.startswith(required_version):\n            print_red_bold(\n                \"SecureDrop restriction: only Ansible {version}.* is supported. \"\n                .format(version=required_version)\n            )\n            sys.exit(1)\n", "path": "install_files/ansible-base/callback_plugins/ansible_version_check.py"}]}