install_ipa_client.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright 2021 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 ipa server variables
  16. include_vars: ../../login_common/vars/main.yml
  17. - name: Fetch hostname
  18. command: hostname
  19. register: loginnode_hostname
  20. changed_when: false
  21. - name: Install freeipa client package
  22. package:
  23. name: "{{ ipa_client_package }}"
  24. state: present
  25. tags: install
  26. - name: Uninstall client if already installed
  27. command: ipa-client-install --uninstall -U
  28. changed_when: false
  29. failed_when: false
  30. - name: Install ipa client
  31. command: >-
  32. ipa-client-install --domain '{{ hostvars['127.0.0.1']['domain_name'] }}' --server '{{ hostvars[groups['manager'][0]]['server_hostname'] }}'
  33. --principal admin --password '{{ hostvars['127.0.0.1']['ipa_admin_password'] }}' --force-join --enable-dns-updates --force-ntpd -U
  34. changed_when: true
  35. no_log: true