1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- ---
- - name: Include ipa server variables
- include_vars: ../../login_common/vars/main.yml
- - name: Fetch hostname
- command: hostname
- register: loginnode_hostname
- changed_when: false
- - name: Install freeipa client package
- package:
- name: "{{ ipa_client_package }}"
- state: present
- tags: install
- - name: Set hostname of ipa server when MS has ipa server installed
- set_fact:
- required_ipa_admin_pwd: "{{ hostvars['127.0.0.1']['ipa_admin_password'] }}"
- required_server_hostname: "{{ hostvars[groups['manager'][0]]['server_hostname'] }}"
- required_domain_name: "{{ hostvars['127.0.0.1']['domain_name'] }}"
- when: not hostvars['127.0.0.1']['ipa_server_ms']
- - name: Set hostname of ipa server when manager node has ipa server installed
- set_fact:
- required_ipa_admin_pwd: "{{ hostvars['127.0.0.1']['ms_ipa_admin_password'] }}"
- required_server_hostname: "{{ hostvars['127.0.0.1']['server_hostname'] }}"
- required_domain_name: "{{ hostvars['127.0.0.1']['server_domain'] }}"
- when: hostvars['127.0.0.1']['ipa_server_ms']
- - name: Uninstall client if already installed
- command: ipa-client-install --uninstall -U
- changed_when: false
- failed_when: false
- - name: Install ipa client in CentOS 7.9
- command: >-
- ipa-client-install --domain '{{ required_domain_name }}' --server '{{ required_server_hostname }}'
- --principal admin --password '{{ required_ipa_admin_pwd }}' --force-join --enable-dns-updates --force-ntpd -U
- changed_when: true
- no_log: true
- when:
- - ( ansible_distribution | lower == os_centos )
- - ( ansible_distribution_version < os_version )
- - name: Install ipa client in Rocky 8.4
- command: >-
- ipa-client-install --domain '{{ required_domain_name }}' --server '{{ required_server_hostname }}'
- --principal admin --password '{{ required_ipa_admin_pwd }}' --force-join --enable-dns-updates --no-ntp -U
- changed_when: true
- no_log: true
- when:
- - ( ansible_distribution | lower == os_centos ) or
- ( ansible_distribution | lower == os_rocky )
- - ( ansible_distribution_version >= os_version )
|