fetch_security_inputs.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. tags: init
  19. - name: Validate input parameters of base_vars are not empty
  20. fail:
  21. msg: "{{ input_security_failure_msg }}"
  22. register: input_base_check
  23. tags: [ validate, security ]
  24. when:
  25. - domain_name | length < 1 or
  26. realm_name | length < 1
  27. - name: Validate the domain name
  28. assert:
  29. that:
  30. - domain_name is regex("^(?!-)[A-Za-z0-9-]+([\\-\\.]{1}[a-z0-9]+)*\\.[A-Za-z]{2,}$")
  31. success_msg: "{{ dom_name_success_msg }}"
  32. fail_msg: "{{ dom_name_fail_msg }}"
  33. tags: [ validate, security ]
  34. - name: Validate the realm name
  35. assert:
  36. that:
  37. - realm_name is regex("^(?!-)[A-Z0-9-]+([\\-\\.]{1}[a-z0-9]+)*\\.[A-Z]{2,}$")
  38. - '"." in realm_name'
  39. success_msg: "{{ realm_success_msg }}"
  40. fail_msg: "{{ realm_fail_msg }}"
  41. tags: [ validate, security ]