install_ipa_server.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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: Install ipa server in CentOS or Rocky
  16. command: >-
  17. ipa-server-install -n '{{ domain_name }}' --hostname='{{ server_hostname_ms }}' -a '{{ ms_ipa_admin_password }}'
  18. -p '{{ ms_directory_manager_password }}' -r '{{ realm_name }}' --setup-dns --no-forwarders --no-reverse --no-ntp -U
  19. changed_when: true
  20. no_log: true
  21. - name: Authenticate as admin
  22. shell: set -o pipefail && echo $'{{ ms_ipa_admin_password }}' | kinit {{ ms_ipa_admin_username }}
  23. no_log: true
  24. changed_when: false
  25. - name: Replace the /etc/resolv.conf file
  26. copy:
  27. src: "{{ temp_resolv_conf_path }}"
  28. dest: "{{ resolv_conf_path }}"
  29. mode: "{{ file_mode }}"
  30. remote_src: yes
  31. - name: Save the hostname
  32. copy:
  33. dest: "{{ server_file }}"
  34. content: |
  35. ipaddress: "{{ hpc_ip }}"
  36. server_hostname: "{{ server_hostname_ms }}"
  37. server_domain: "{{ domain_name }}"
  38. mode: "{{ file_mode }}"