:source: fmgd_vpn_certificate_local.py
:orphan:
.. _fmgd_vpn_certificate_local:
fmgd_vpn_certificate_local -- Local keys and certificates.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. versionadded:: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- This module is able to configure a FortiManager device.
- Examples include all parameters and values need to be adjusted to data sources before usage.
- Tested with FortiManager v7.x.
Requirements
------------
The below requirements are needed on the host that executes this module.
- ansible-core>=2.16.0
FortiManager Version Compatibility
----------------------------------
.. raw:: html
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
Parameters
----------
.. raw:: html
- access_token -The token to access FortiManager without using username and password. type: str required: false
- bypass_validation - Only set to True when module schema diffs with FortiManager API structure, module continues to execute without validating parameters. type: bool required: false default: False
- enable_log - Enable/Disable logging for task. type: bool required: false default: False
- forticloud_access_token - Access token of forticloud managed API users, this option is available with FortiManager later than 6.4.0. type: str required: false
- proposed_method - The overridden method for the underlying Json RPC request. type: str required: false choices: set, update, add
- rc_succeeded - The rc codes list with which the conditions to succeed will be overriden. type: list required: false
- rc_failed - The rc codes list with which the conditions to fail will be overriden. type: list required: false
- state - The directive to create, update or delete an object type: str required: true choices: present, absent
- workspace_locking_adom - Acquire the workspace lock if FortiManager is running in workspace mode. type: str required: false choices: global, custom adom including root
- workspace_locking_timeout - The maximum time in seconds to wait for other users to release workspace lock. type: integer required: false default: 300
- device - The parameter in requested url type: str required: true
- vdom - The parameter in requested url type: str required: true
- vpn_certificate_local - Local keys and certificates. type: dict
- acme_ca_url (Alias name: acme-ca-url) The url for the acme ca server (lets encrypt is the default provider). type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- acme_domain (Alias name: acme-domain) A valid domain that resolves to this fortigate unit. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- acme_email (Alias name: acme-email) Contact email address that is required by some cas like letsencrypt. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- acme_renew_window (Alias name: acme-renew-window) Beginning of the renewal window (in days before certificate expiration, 30 by default). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- acme_rsa_key_size (Alias name: acme-rsa-key-size) Length of the rsa private key of the generated cert (minimum 2048 bits). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- auto_regenerate_days (Alias name: auto-regenerate-days) Number of days to wait before expiry of an updated local certificate is requested (0 = disabled). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- auto_regenerate_days_warning (Alias name: auto-regenerate-days-warning) Number of days to wait before an expiry warning message is generated (0 = disabled). type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- ca_identifier (Alias name: ca-identifier) Ca identifier of the ca server for signing via scep. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- certificate Pem format certificate. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- cmp_path (Alias name: cmp-path) Path location inside cmp server. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- cmp_regeneration_method (Alias name: cmp-regeneration-method) Cmp auto-regeneration method. type: str choices: [keyupate, renewal]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- cmp_server (Alias name: cmp-server) Address and port for cmp server (format = address:port). type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- cmp_server_cert (Alias name: cmp-server-cert) Cmp server certificate. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- comments Comment. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- csr Certificate signing request. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- enroll_protocol (Alias name: enroll-protocol) Certificate enrollment protocol. type: str choices: [none, scep, cmpv2, acme2, est]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- est_ca_id (Alias name: est-ca-id) Ca identifier of the ca server for signing via est. type: str
more...
Supported Version Ranges: v7.4.3 -> latest
- est_client_cert (Alias name: est-client-cert) Certificate used to authenticate this fortigate to est server. type: list
more...
Supported Version Ranges: v7.4.3 -> latest
- est_http_password (Alias name: est-http-password) Http authentication password for signing via est. type: str
more...
Supported Version Ranges: v7.4.3 -> latest
- est_http_username (Alias name: est-http-username) Http authentication username for signing via est. type: str
more...
Supported Version Ranges: v7.4.3 -> latest
- est_server (Alias name: est-server) Address and port for est server (e. type: str
more...
Supported Version Ranges: v7.4.3 -> latest
- est_server_cert (Alias name: est-server-cert) Est servers certificate must be verifiable by this certificate to be authenticated. type: list
more...
Supported Version Ranges: v7.4.3 -> latest
- est_srp_password (Alias name: est-srp-password) Est srp authentication password. type: str
more...
Supported Version Ranges: v7.4.3 -> latest
- est_srp_username (Alias name: est-srp-username) Est srp authentication username. type: str
more...
Supported Version Ranges: v7.4.3 -> latest
- ike_localid (Alias name: ike-localid) Local id the fortigate uses for authentication as a vpn client. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- ike_localid_type (Alias name: ike-localid-type) Ike local id type. type: str choices: [fqdn, asn1dn]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- last_updated (Alias name: last-updated) Time at which certificate was last updated. type: int
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- name Name. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- name_encoding (Alias name: name-encoding) Name encoding method for auto-regeneration. type: str choices: [printable, utf8]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- password Password as a pem file. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- private_key (Alias name: private-key) Pem format key encrypted with a password. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- private_key_retain (Alias name: private-key-retain) Enable/disable retention of private key during scep renewal (default = disable). type: str choices: [disable, enable]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- range Either a global or vdom ip address range for the certificate. type: str choices: [global, vdom]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- scep_password (Alias name: scep-password) Scep server challenge password for auto-regeneration. type: list
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- scep_url (Alias name: scep-url) Scep server url. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- source Certificate source type. type: str choices: [factory, user, bundle, fortiguard]
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- source_ip (Alias name: source-ip) Source ip address for communications to the scep server. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- state State. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- tmp_cert_file (Alias name: tmp-cert-file) Temporary certificate file. type: str
more...
Supported Version Ranges: v7.2.6 -> v7.2.12, v7.4.3 -> latest
- est_regeneration_method (Alias name: est-regeneration-method) Est behavioral options during re-enrollment. type: str choices: [create-new-key, use-existing-key]
more...
Supported Version Ranges: v7.4.6 -> v7.4.10, v7.6.3 -> latest
- acme_eab_key_hmac (Alias name: acme-eab-key-hmac) External account binding hmac key (url-encoded base64). type: list
more...
Supported Version Ranges: v7.6.3 -> latest
- acme_eab_key_id (Alias name: acme-eab-key-id) External account binding key id (optional setting). type: str
more...
Supported Version Ranges: v7.6.3 -> latest
- hsm_keytype (Alias name: hsm-keytype) Hsm keytype. type: str choices: [rsa, ec]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- hsm_slot (Alias name: hsm-slot) Hsm slot. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- hsm_vendor (Alias name: hsm-vendor) Hsm vendor. type: str choices: [safenet, primus]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- nethsm_slot (Alias name: nethsm-slot) Nethsm slot. type: str
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
- type Type. type: str choices: [normal, hsm]
more...
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
Notes
-----
.. note::
- Running in workspace locking mode is supported in this FortiManager module, the top level parameters workspace_locking_adom and workspace_locking_timeout help do the work.
- To create or update an object, use state: present directive.
- To delete an object, use state: absent directive
- Normally, running one module can fail when a non-zero rc is returned. you can also override the conditions to fail or succeed with parameters rc_failed and rc_succeeded
Examples
--------
.. code-block:: yaml+jinja
- name: Example playbook (generated based on argument schema)
hosts: fortimanagers
connection: httpapi
gather_facts: false
vars:
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_httpapi_port: 443
tasks:
- name: Local keys and certificates.
fortinet.fmgdevice.fmgd_vpn_certificate_local:
# bypass_validation: false
# workspace_locking_adom:
# workspace_locking_timeout: 300
# rc_succeeded: [0, -2, -3, ...]
# rc_failed: [-2, -3, ...]
device:
vdom:
state: present #
vpn_certificate_local:
name: "your value" # Required variable, string
# acme_ca_url:
# acme_domain:
# acme_email:
# acme_renew_window:
# acme_rsa_key_size:
# auto_regenerate_days:
# auto_regenerate_days_warning:
# ca_identifier:
# certificate:
# cmp_path:
# cmp_regeneration_method:
# cmp_server:
# cmp_server_cert:
# comments:
# csr:
# enroll_protocol:
# est_ca_id:
# est_client_cert:
# est_http_password:
# est_http_username:
# est_server:
# est_server_cert:
# est_srp_password:
# est_srp_username:
# ike_localid:
# ike_localid_type:
# last_updated:
# name_encoding:
# password:
# private_key:
# private_key_retain:
# range:
# scep_password:
# scep_url:
# source:
# source_ip:
# state:
# tmp_cert_file:
# est_regeneration_method:
# acme_eab_key_hmac:
# acme_eab_key_id:
# hsm_keytype:
# hsm_slot:
# hsm_vendor:
# nethsm_slot:
# type:
Return Values
-------------
Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:
.. raw:: html
- meta - The result of the request.returned: always type: dict
- request_url - The full url requested. returned: always type: str sample: /sys/login/user
- response_code - The status of api request. returned: always type: int sample: 0
- response_data - The data body of the api response. returned: optional type: list or dict
- response_message - The descriptive message of the api response. returned: always type: str sample: OK
- system_information - The information of the target system. returned: always type: dict
- rc - The status the request. returned: always type: int sample: 0
- version_check_warning - Warning if the parameters used in the playbook are not supported by the current FortiManager version. returned: if at least one parameter not supported by the current FortiManager version type: list
Status
------
- This module is not guaranteed to have a backwards compatible interface.
Authors
-------
- Xinwei Du (@dux-fortinet)
- Xing Li (@lix-fortinet)
- Jie Xue (@JieX19)
- Link Zheng (@chillancezen)
- Frank Shen (@fshen01)
- Hongbin Lu (@fgtdev-hblu)