Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 955701

Summary: Inform user about --force-join flag when client already enrolled
Product: Red Hat Enterprise Linux 7 Reporter: Dmitri Pal <dpal>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED CURRENTRELEASE QA Contact: Namita Soman <nsoman>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.0CC: ksiddiqu, mkosek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-3.2.1-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 09:27:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dmitri Pal 2013-04-23 14:49:23 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/freeipa/ticket/3572

When client is already joined, `ipa-client-install` fails:

{{{
# ipa-client-install --domain f19.ad.test --hostname client.f19.ad.test -p admin -w kokos123
Discovery was successful!
Hostname: client.f19.ad.test
Realm: F19.AD.TEST
DNS Domain: f19.ad.test
IPA Server: ipa.f19.ad.test
BaseDN: dc=f19,dc=ad,dc=test

Continue to configure the system with these values? [no]: y
Synchronizing time with KDC...
Successfully retrieved CA cert
    Subject:     CN=Certificate Authority,O=F19.AD.TEST
    Issuer:      CN=Certificate Authority,O=F19.AD.TEST
    Valid From:  Thu Apr 18 08:09:16 2013 UTC
    Valid Until: Mon Apr 18 08:09:16 2033 UTC

Joining realm failed: Host is already joined.

Installation failed. Rolling back changes.
Disabling client Kerberos and LDAP configurations
Redundant SSSD configuration file /etc/sssd/sssd.conf was moved to /etc/sssd/sssd.conf.deleted
Restoring client configuration files
nscd daemon is not installed, skip configuration
nslcd daemon is not installed, skip configuration
/etc/ipa/default.conf could not be removed: [Errno 2] No such file or directory: '/etc/ipa/default.conf'
Please remove /etc/ipa/default.conf manually, as it can cause subsequent installation to fail.
Client uninstall complete.
}}}

We should advertise that `--force-join` flag can be used to re-enroll, otherwise use may not even know its there.

Thus something like:
{{{
ipa-client-install
...
    Valid From:  Thu Apr 18 08:09:16 2013 UTC
    Valid Until: Mon Apr 18 08:09:16 2033 UTC

Joining realm failed: Host is already joined.
Use --force-join to forcefully join the server (overwrites client data on server)

...

Comment 1 Rob Crittenden 2013-04-23 20:13:14 UTC
Fixed upstream.

master: 6e8d311dac90c52074cfcc07b45a97326e8b7e19

Comment 4 Kaleem 2014-01-14 12:34:41 UTC
Verified.

IPA client version:
===================
[root@rhel70-client ~]# rpm -q ipa-client
ipa-client-3.3.3-11.el7.x86_64
[root@rhel70-client ~]#

Following steps followed for verification:
==========================================

[root@rhel70-client ~]# iptables -A INPUT -j REJECT -p all --source 10.65.207.198
[root@rhel70-client ~]# ipa-client-install --uninstall -U
Unenrolling client from IPA server
Unenrolling host failed: Error obtaining initial credentials: Cannot contact any KDC for requested realm.

Removing Kerberos service principals from /etc/krb5.keytab
Disabling client Kerberos and LDAP configurations
Redundant SSSD configuration file /etc/sssd/sssd.conf was moved to /etc/sssd/sssd.conf.deleted
Restoring client configuration files
Client uninstall complete.
[root@rhel70-client ~]# iptables -F
[root@rhel70-client ~]# ipa-client-install -U --domain=testrelm.com --realm=TESTRELM.COM -p admin -w xxxxxxxx --server=rhel70-master.testrelm.com
Hostname: rhel70-client.testrelm.com
Realm: TESTRELM.COM
DNS Domain: testrelm.com
IPA Server: rhel70-master.testrelm.com
BaseDN: dc=testrelm,dc=com

Synchronizing time with KDC...
Successfully retrieved CA cert
    Subject:     CN=Certificate Authority,O=TESTRELM.COM
    Issuer:      CN=Certificate Authority,O=TESTRELM.COM
    Valid From:  Tue Jan 14 12:06:58 2014 UTC
    Valid Until: Sat Jan 14 12:06:58 2034 UTC

Joining realm failed: Host is already joined.

Use --force-join option to override the host entry on the server and force client enrollment.
Installation failed. Rolling back changes.
IPA client is not configured on this system.
[root@rhel70-client ~]#

Comment 5 Ludek Smid 2014-06-13 09:27:55 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.