mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-13 21:12:02 +00:00
Compare commits
1 Commits
v1.14.5
...
validate_e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22700620c6 |
@@ -33,7 +33,7 @@ __all__ = ["DEBUG_COMMAND_ALL", "DEBUG_COMMAND_LIST",
|
|||||||
"paths", "tasks", "get_credentials_if_valid", "Encoding",
|
"paths", "tasks", "get_credentials_if_valid", "Encoding",
|
||||||
"DNSName", "getargspec", "certificate_loader",
|
"DNSName", "getargspec", "certificate_loader",
|
||||||
"write_certificate_list", "boolean", "template_str",
|
"write_certificate_list", "boolean", "template_str",
|
||||||
"urlparse", "normalize_sshpubkey"]
|
"urlparse", "normalize_sshpubkey", "Email"]
|
||||||
|
|
||||||
DEBUG_COMMAND_ALL = 0b1111
|
DEBUG_COMMAND_ALL = 0b1111
|
||||||
# Print the while command list:
|
# Print the while command list:
|
||||||
@@ -116,6 +116,7 @@ try:
|
|||||||
from ipalib.krb_utils import get_credentials_if_valid
|
from ipalib.krb_utils import get_credentials_if_valid
|
||||||
from ipapython.dnsutil import DNSName
|
from ipapython.dnsutil import DNSName
|
||||||
from ipapython import kerberos
|
from ipapython import kerberos
|
||||||
|
from ipapython.ipavalidate import Email
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from ipalib.x509 import Encoding
|
from ipalib.x509 import Encoding
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ config:
|
|||||||
|
|
||||||
|
|
||||||
from ansible.module_utils.ansible_freeipa_module import \
|
from ansible.module_utils.ansible_freeipa_module import \
|
||||||
IPAAnsibleModule, compare_args_ipa, ipalib_errors
|
IPAAnsibleModule, compare_args_ipa, ipalib_errors, Email
|
||||||
|
|
||||||
|
|
||||||
def config_show(module):
|
def config_show(module):
|
||||||
@@ -515,6 +515,13 @@ def main():
|
|||||||
msg="Argument '%s' must be between %d and %d."
|
msg="Argument '%s' must be between %d and %d."
|
||||||
% (arg, minimum, maximum))
|
% (arg, minimum, maximum))
|
||||||
|
|
||||||
|
# verify email domain
|
||||||
|
emaildomain = params.get("ipadefaultemaildomain", None)
|
||||||
|
if emaildomain:
|
||||||
|
if not Email("test@{0}".format(emaildomain)):
|
||||||
|
ansible_module.fail_json(
|
||||||
|
msg="Invalid 'emaildomain' value: %s" % emaildomain)
|
||||||
|
|
||||||
changed = False
|
changed = False
|
||||||
exit_args = {}
|
exit_args = {}
|
||||||
|
|
||||||
|
|||||||
@@ -279,7 +279,6 @@ def main():
|
|||||||
options.no_sssd = False
|
options.no_sssd = False
|
||||||
options.sssd = not options.no_sssd
|
options.sssd = not options.no_sssd
|
||||||
options.no_ac = False
|
options.no_ac = False
|
||||||
options.dns_over_tls = False
|
|
||||||
nosssd_files = module.params.get('nosssd_files')
|
nosssd_files = module.params.get('nosssd_files')
|
||||||
selinux_works = module.params.get('selinux_works')
|
selinux_works = module.params.get('selinux_works')
|
||||||
krb_name = module.params.get('krb_name')
|
krb_name = module.params.get('krb_name')
|
||||||
@@ -377,12 +376,7 @@ def main():
|
|||||||
ssh_config_dir = paths.SSH_CONFIG_DIR
|
ssh_config_dir = paths.SSH_CONFIG_DIR
|
||||||
else:
|
else:
|
||||||
ssh_config_dir = services.knownservices.sshd.get_config_dir()
|
ssh_config_dir = services.knownservices.sshd.get_config_dir()
|
||||||
argspec_update_ssh_keys = getargspec(update_ssh_keys)
|
update_ssh_keys(hostname, ssh_config_dir, options.create_sshfp)
|
||||||
# Hotfix for https://github.com/freeipa/freeipa/pull/7343
|
|
||||||
if "options" in argspec_update_ssh_keys.args:
|
|
||||||
update_ssh_keys(hostname, ssh_config_dir, options, cli_server[0])
|
|
||||||
else:
|
|
||||||
update_ssh_keys(hostname, ssh_config_dir, options.create_sshfp)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.remove(CCACHE_FILE)
|
os.remove(CCACHE_FILE)
|
||||||
|
|||||||
@@ -331,13 +331,6 @@ options.add_agents = False
|
|||||||
# ServerReplicaInstall
|
# ServerReplicaInstall
|
||||||
options.subject_base = None
|
options.subject_base = None
|
||||||
options.ca_subject = None
|
options.ca_subject = None
|
||||||
|
|
||||||
# Hotfix for https://github.com/freeipa/freeipa/pull/7343
|
|
||||||
options.dns_over_tls = False
|
|
||||||
options.dns_over_tls_key = None
|
|
||||||
options.dns_over_tls_cert = None
|
|
||||||
options.dot_forwarders = None
|
|
||||||
options.dns_policy = None
|
|
||||||
# pylint: enable=attribute-defined-outside-init
|
# pylint: enable=attribute-defined-outside-init
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -354,13 +354,6 @@ options.add_agents = False
|
|||||||
# no_msdcs is deprecated
|
# no_msdcs is deprecated
|
||||||
options.no_msdcs = False
|
options.no_msdcs = False
|
||||||
|
|
||||||
# Hotfix for https://github.com/freeipa/freeipa/pull/7343
|
|
||||||
options.dns_over_tls = False
|
|
||||||
options.dns_over_tls_key = None
|
|
||||||
options.dns_over_tls_cert = None
|
|
||||||
options.dot_forwarders = None
|
|
||||||
options.dns_policy = None
|
|
||||||
|
|
||||||
# For pylint
|
# For pylint
|
||||||
options.external_cert_files = None
|
options.external_cert_files = None
|
||||||
options.dirsrv_cert_files = None
|
options.dirsrv_cert_files = None
|
||||||
|
|||||||
@@ -34,6 +34,16 @@
|
|||||||
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
emaildomain: ipa.test
|
emaildomain: ipa.test
|
||||||
|
|
||||||
|
- name: Ensure the default e-mail domain cannot be set to an invalid email domain.
|
||||||
|
ipaconfig:
|
||||||
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||||
|
emaildomain: invalid@emaildomain
|
||||||
|
register: invalid_emaildomain
|
||||||
|
failed_when:
|
||||||
|
invalid_emaildomain.changed
|
||||||
|
or not (invalid_emaildomain.failed and "Invalid 'emaildomain' value:" in invalid_emaildomain.msg)
|
||||||
|
|
||||||
- name: Set default shell to '/bin/sh'
|
- name: Set default shell to '/bin/sh'
|
||||||
ipaconfig:
|
ipaconfig:
|
||||||
ipaadmin_password: SomeADMINpassword
|
ipaadmin_password: SomeADMINpassword
|
||||||
|
|||||||
Reference in New Issue
Block a user