#8458 auto-upgrade will never happen for existing installations
Closed: fixed by abbra. Opened by slev.

With the current scheme which checks if IPA is configured on a system by playing around installation state, the auto-upgrade will never happen.

1) Install FreeIPA rpms from Fedora.
2) Set up freeipa server
3) update to FreeIPA from dev branch
4) check the status

# ipactl status
IPA is not configured (see man pages of ipa-server-install for help)

rpm spec will not trigger upgrade because:

# python3 -c "import sys; from ipalib import facts; sys.exit(0 if facts.is_ipa_configured() else 1);"
# echo $?
1

ipactl restart will not trigger upgrade because:

# ipactl restart
(Pdb) w
  /usr/sbin/ipactl(25)<module>()
-> installutils.run_script(main, operation_name='ipactl')
  /usr/lib/python3.8/site-packages/ipaserver/install/installutils.py(731)run_script()
-> return_value = main_function()
  /usr/lib/python3.8/site-packages/ipaserver/install/ipactl.py(679)main()
-> check_IPA_configuration()
  /usr/lib/python3.8/site-packages/ipaserver/install/ipactl.py(55)check_IPA_configuration()
-> if not is_ipa_configured():
> /usr/lib/python3.8/site-packages/ipalib/facts.py(19)is_ipa_configured()
-> return sstore.get_state('installation', 'complete')
(Pdb) p sstore.get_state('installation', 'complete')
None

ipa-server-upgrade will not trigger upgrade because:

ipa-server-upgrade
(Pdb) w
  /usr/sbin/ipa-server-upgrade(12)<module>()
-> ServerUpgrade.run_cli()
  /usr/lib/python3.8/site-packages/ipapython/admintool.py(132)run_cli()
-> sys.exit(cls.main(sys.argv))
  /usr/lib/python3.8/site-packages/ipapython/admintool.py(156)main()
-> return command.execute()
  /usr/lib/python3.8/site-packages/ipapython/admintool.py(177)execute()
-> self.validate_options()
  /usr/lib/python3.8/site-packages/ipaserver/install/ipa_server_upgrade.py(38)validate_options()
-> installutils.check_server_configuration()
  /usr/lib/python3.8/site-packages/ipaserver/install/installutils.py(672)check_server_configuration()
-> if not is_ipa_configured():
  /usr/lib/python3.8/site-packages/ipaserver/install/installutils.py(710)is_ipa_configured()
-> return facts.is_ipa_configured()
> /usr/lib/python3.8/site-packages/ipalib/facts.py(19)is_ipa_configured()
-> return sstore.get_state('installation', 'complete')
(Pdb) p sstore.get_state('installation', 'complete')
None

Metadata Update from @rcritten:
- Issue assigned to rcritten

Metadata Update from @rcritten:
- Issue priority set to: important

In addition, there are several DeprecationWarning related to is_ipa_configured:

ipa-dns-install --disable-dnssec-master                  
The log file for this installation can be found in /var/log/ipaserver-install.log
/usr/lib/python3.8/site-packages/ipaserver/install/installutils.py:672: DeprecationWarning: Use 'ipalib.facts.is_ipa_configured'
  if not is_ipa_configured():                                                   
==============================================================================  
This program will setup DNS for the FreeIPA Server. 
ipaserver/install/ipa_acme_manage.py:from ipaserver.install.installutils import is_ipa_configured

PR https://github.com/freeipa/freeipa/pull/5027

master:

  • a8d5e6bbfe03070925c85793ac898299d543a3d4 Fall back to old server installation detection when needed
  • 2bdb18d56fd65e0058ee302502f68a37decc55e8 Use is_ipa_configured from ipalib.facts
  • 25e042d3d1e04972d4536b1fa793811e6b047559 ipatests: Add test for is_ipa_configured

We need to backport this to 4.8 or otherwise upgrade from older versions fails:
https://bodhi.fedoraproject.org/updates/FEDORA-2020-dc32a8de93#comment-1582454
https://openqa.fedoraproject.org/tests/644895#step/role_deploy_domain_controller_check/5

ipa-4-8:

  • fe783b632a0649f1894416dbd74a2a074c64b5ba Fall back to old server installation detection when needed
  • 774bbb1703cb37b5b0623a987738efd5207d65d6 Use is_ipa_configured from ipalib.facts
  • 2057b330f8c3d89078ce2008660a799721ab3c57 ipatests: Add test for is_ipa_configured

Metadata Update from @abbra:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata