fetch_security_inputs.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Include security variable file security_vars.yml
  16. include_vars: "{{ security_vars_filename }}"
  17. no_log: true
  18. - name: Validate input parameters of base_vars are not empty
  19. fail:
  20. msg: "{{ input_security_failure_msg }}"
  21. register: input_base_check
  22. when:
  23. - domain_name | length < 1 or
  24. realm_name | length < 1
  25. - name: Validate the domain name
  26. assert:
  27. that:
  28. - domain_name is regex("^(?!-)[A-Za-z0-9-]+([\\-\\.]{1}[a-z0-9]+)*\\.[A-Za-z]{2,}$")
  29. success_msg: "{{ dom_name_success_msg }}"
  30. fail_msg: "{{ dom_name_fail_msg }}"
  31. - name: Validate the realm name
  32. assert:
  33. that:
  34. - realm_name is regex("^(?!-)[A-Z0-9-]+([\\-\\.]{1}[a-z0-9]+)*\\.[A-Z]{2,}$")
  35. - '"." in realm_name'
  36. success_msg: "{{ realm_success_msg }}"
  37. fail_msg: "{{ realm_fail_msg }}"