Namecheap ssl management
New in version 2017.7.0.
Use this module to manage ssl certificates through the namecheap api. The Namecheap settings will be set in grains.
This module uses the following python libraries to communicate to the namecheap API:
requests
pip install requestsAs saltstack depends on
requests
this shouldn’t be a problem
The namecheap username, api key and url should be set in a minion configuration file or pillar
namecheap.name: companyname namecheap.key: a1b2c3d4e5f67a8b9c0d1e2f3 namecheap.client_ip: 162.155.30.172 #Real url namecheap.url: https://api.namecheap.com/xml.response #Sandbox url #namecheap.url: https://api.sandbox.namecheap.xml.response
salt.modules.namecheap_ssl.
activate
(csr_file, certificate_id, web_server_type, approver_email=None, http_dc_validation=False, **kwargs)¶Activates a newly purchased SSL certificate
returns a dictionary of result values
CLI Example:
salt 'my-minion' namecheap_ssl.activate my-csr-file my-cert-id apachessl
salt.modules.namecheap_ssl.
create
(years, certificate_type, promotion_code=None, sans_to_add=None)¶Creates a new SSL certificate
- returns a dictionary with the following values:
- issuccess Indicates whether SSL order was successful orderid A unique integer value that represents the order transactionid A unique integer value that represents the transaction chargedamount The amount charged for the order certificateid A unique integer value that represents the SSL created The date on which the certificate is created expires The date on which the certificate expires ssltype Type of SSL cerificate years Number of years for which the certificate is purchased status The current status of SSL certificate
- Required parameters:
- years
- integer Number of years to register
- Default: 1
- certificate_type
- string Type of SSL Certificate,
- Possible Values: QuickSSL Premium, RapidSSL, RapidSSL Wildcard,
- PremiumSSL, InstantSSL, PositiveSSL, PositiveSSL Wildcard, True BusinessID with EV, True BusinessID, True BusinessID Wildcard, True BusinessID Multi Domain, True BusinessID with EV Multi Domain, Secure Site, Secure Site Pro, Secure Site with EV, Secure Site Pro with EV, EssentialSSL, EssentialSSL Wildcard, InstantSSL Pro, PremiumSSL Wildcard, EV SSL, EV SSL SGC, SSL123, SSL Web Server, SGC Supercert, SSL Webserver EV, EV Multi Domain SSL, Multi Domain SSL, PositiveSSL Multi Domain, Unified Communications
- Optional parameters:
- promotional_code
- string Promotional (coupon) code for the certificate
- sans_to_add
- integer This parameter defines the number of add-on domains to be purchased in
- addition to the default number of domains included with a multi-domain certificate. Each certificate that supports SANs has the default number of domains included. You may check the default number of domains included and the maximum number of domains that can be added to it in the table below. Default: 0
domains (domain from total domains of domains CSR is counted here) that can be
passed in SANStoADD parameter
CLI Example:
salt 'my-minion' namecheap_ssl.create 2 RapidSSL
salt.modules.namecheap_ssl.
get_info
(certificate_id, returncertificate=False, returntype=None)¶Retrieves information about the requested SSL certificate
“ssl” contains the metadata information “certificate” contains the details for the certificate like
the CSR, Approver, and certificate data
CLI Example:
salt 'my-minion' namecheap_ssl.get_info my-cert-id
salt.modules.namecheap_ssl.
get_list
(**kwargs)¶Returns a list of SSL certificates for a particular user
Optional parameters:
- ListType
- string Possible values: All,Processing,EmailSent,
TechnicalProblem,InProgress,Completed, Deactivated,Active,Cancelled,NewPurchase, NewRenewalDefault: All
- SearchTerm
- string Keyword to look for on the SSL list
- Page
- integer Page to return
- Default: 1
- PageSize
- integer Total number of SSL certificates to display in a page
- Minimum value is 10 and maximum value is 100 Default: 20
- SoryBy
- string Possible values are PURCHASEDATE,PURCHASEDATE_DESC,
- SSLTYPE,SSLTYPE_DESC, EXPIREDATETIME,EXPIREDATETIME_DESC, Host_Name,Host_Name_DESC
CLI Example:
salt 'my-minion' namecheap_ssl.get_list Processing
salt.modules.namecheap_ssl.
parse_csr
(csr_file, certificate_type, http_dc_validation=False)¶Parses the CSR
returns a dictionary of result values
Required parameters:
- csr_file
- string Certificate Signing Request File
- certificate_type
- string Type of SSL Certificate,
- Possible Values: QuickSSL Premium, RapidSSL, RapidSSL Wildcard,
- PremiumSSL, InstantSSL, PositiveSSL, PositiveSSL Wildcard, True BusinessID with EV, True BusinessID, True BusinessID Wildcard, True BusinessID Multi Domain, True BusinessID with EV Multi Domain, Secure Site, Secure Site Pro, Secure Site with EV, Secure Site Pro with EV, EssentialSSL, EssentialSSL Wildcard, InstantSSL Pro, PremiumSSL Wildcard, EV SSL, EV SSL SGC, SSL123, SSL Web Server, SGC Supercert, SSL Webserver EV, EV Multi Domain SSL, Multi Domain SSL, PositiveSSL Multi Domain, Unified Communications
Optional parameter:
- http_dc_validation
- bool True if a Comodo certificate and validation should be done with files
- instead of emails and to return the info to do so
CLI Example:
salt 'my-minion' namecheap_ssl.parse_csr my-csr-file PremiumSSL
salt.modules.namecheap_ssl.
reissue
(csr_file, certificate_id, web_server_type, approver_email=None, http_dc_validation=False, **kwargs)¶Reissues a purchased SSL certificate
returns a dictionary of result values
CLI Example:
salt 'my-minion' namecheap_ssl.reissue my-csr-file my-cert-id apachessl
salt.modules.namecheap_ssl.
renew
(years, certificate_id, certificate_type, promotion_code=None)¶Renews an SSL certificate if it is ACTIVE and Expires <= 30 days
CLI Example:
salt 'my-minion' namecheap_ssl.renew 1 my-cert-id RapidSSL