added setup needed for dateutil dependency
parent
2d3faa1b87
commit
6347b8c500
|
@ -18,6 +18,7 @@ description:
|
||||||
- "This module allows one to generate or delete GPG private and public keys using GnuPG (gpg)."
|
- "This module allows one to generate or delete GPG private and public keys using GnuPG (gpg)."
|
||||||
requirements:
|
requirements:
|
||||||
- gpg >= 2.1
|
- gpg >= 2.1
|
||||||
|
- python-dateutil
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.crypto.attributes
|
- community.crypto.attributes
|
||||||
attributes:
|
attributes:
|
||||||
|
@ -367,7 +368,7 @@ def generate_keypair(module, params, matching_keys, check_mode):
|
||||||
def run_module(module, params, check_mode=False):
|
def run_module(module, params, check_mode=False):
|
||||||
if params['expire_date']:
|
if params['expire_date']:
|
||||||
try:
|
try:
|
||||||
dp.parse(params['expire_date'])
|
dp.isoparse(params['expire_date'])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
if not (params['expire_date'].isnumeric() or (params['expire_date'][:-1].isnumeric() and params['expire_date'][-1] in ['w', 'm', 'y'])):
|
if not (params['expire_date'].isnumeric() or (params['expire_date'][:-1].isnumeric() and params['expire_date'][-1] in ['w', 'm', 'y'])):
|
||||||
module.fail_json('Invalid format for expire date')
|
module.fail_json('Invalid format for expire date')
|
||||||
|
|
|
@ -5,3 +5,4 @@
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- setup_gnupg
|
- setup_gnupg
|
||||||
|
- setup_python_dateutil
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
# Copyright (c) 2024, Austin Lucas Lake <53884490+austinlucaslake@users.noreply.github.com>
|
||||||
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- setup_python_info
|
||||||
|
- setup_remote_constraints
|
||||||
|
- setup_pkg_mgr
|
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
# Copyright (c) 2024, Austin Lucas Lake <53884490+austinlucaslake@users.noreply.github.com>
|
||||||
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
####################################################################
|
||||||
|
# WARNING: These are designed specifically for Ansible tests #
|
||||||
|
# and should not be used as examples of how to write Ansible roles #
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
- name: Install python-dateutil (PyPi)
|
||||||
|
become: true
|
||||||
|
ansible.builtin.pip:
|
||||||
|
name: python-dateutil
|
||||||
|
state: 'latest'
|
||||||
|
extra_args: "-c {{ remote_constraints }}"
|
Loading…
Reference in New Issue