Bug 1147687

Summary: move authconfig and firewalld to core group
Product: Red Hat Enterprise Linux 7 Reporter: Jeff Bastian <jbastian>
Component: anacondaAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 7.1CC: atodorov, bcl, blc, dmach, emcnabb, lsmid, mbanas, mvadkert, pnemade, pspacek, rcyriac, vpavlin
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-19.31.103-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 14:03:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1145454, 1145462    
Attachments:
Description Flags
rhel-7.1-20140925.n.0 kickstart file
none
proposed anaconda patch none

Description Jeff Bastian 2014-09-29 21:03:12 UTC
Description of problem:
RHEL 7.0 installed authconfig and firewalld by default because they were required to process the 'auth' and 'firewall' kickstart commands respectively.

Anaconda was recently updated and removed authconfig and firewalld from the default package selection with this commit:
https://git.fedorahosted.org/cgit/anaconda.git/commit/?id=5aa5ce677651

This was for Docker Enablement bug https://bugzilla.redhat.com/show_bug.cgi?id=1123479

However, removing the packages from the default set now causes kickstart to crash if you have either of the commands in your kickstart file.  See bug 1145454 and bug 1145462 for kickstart errors due to missing commands.

To fix this, I believe we must either (a) move authconfig and firewalld to the Core group the comps xml, or (b) revert the anaconda commit.  Reverting the anaconda commit would create problems for bug 1123479 and docker, thus, I think the best option is to make them part of the Core group.

Version-Release number of selected component (if applicable):
RHEL 7.1 nightly (tested with 20140925.n.0)

How reproducible:
every time

Steps to Reproduce:
1. install RHEL 7.1 20140925.n.0 with default Beaker kickstart file, e.g.
   https://beaker.engineering.redhat.com/jobs/761849
2. check the installed rpms
3. compare to a RHEL 7.0 GA installation, e.g.,
   https://beaker.engineering.redhat.com/jobs/761854

Actual results:
authconfig and firewalld are missing in RHEL 7.1 nightly

Expected results:
authconfig and firewalld are installed by default

Additional info:

Comment 1 Jeff Bastian 2014-09-29 21:12:47 UTC
Looking at ca6898ab93af9cbb4c1f0dc36d90420122ab03a8f441f481388d8f6ae0fcf34f-comps-Server.x86_64.xml from RHEL-7.1-20140925.n.0:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE comps
  PUBLIC '-//Red Hat, Inc.//DTD Comps info//EN'
  'comps.dtd'>
<comps>
  ...
  <group>
    <id>anaconda-tools</id>
    <name>Anaconda Tools</name>
    ...
    <packagelist>
      <packagereq type="mandatory">authconfig</packagereq>
      ...
    </packagelist>
  </group>
  ...
  <group>
    <id>base</id>
    <name>Base</name>
    ...
    <packagelist>
      <packagereq type="mandatory">authconfig</packagereq>
      ...
    </packagelist>
  </group>
  ...

Comment 2 Daniel Mach 2014-09-30 07:19:48 UTC
Couldn't authconfig be executed from installation image?
Then it wouldn't have to be part of installed system at all.

Not sure about firewalld. Why anaconda installs it by default?

Comment 3 Miroslav Vadkerti 2014-09-30 12:35:41 UTC
I also opt for this solution, AFAICT this is the same way as it is done in RHEL6.6 (authconfig still in Base group). We are trying to keep @core mininmal as possible.

(In reply to Daniel Mach from comment #2)
> Couldn't authconfig be executed from installation image?
> Then it wouldn't have to be part of installed system at all.
> 
> Not sure about firewalld. Why anaconda installs it by default?

Comment 4 Chris Lumens 2014-09-30 13:54:21 UTC
When last we checked, neither authconfig nor firewalld had a way to be told to run inside a different root, which means they have to be installed for anaconda to be able to run them.

And we install firewalld to enable/disable services if you use the right options in kickstart.

Comment 5 Jeff Bastian 2014-09-30 15:41:27 UTC
Created attachment 942782 [details]
rhel-7.1-20140925.n.0 kickstart file

Using the attached kickstart file which only installs @Core, I created a virtual machine and replicated the problem.

virt-install --name=rhel71n --ram=1024 --vcpus=1 \
  --os-type=linux --os-variant=rhel6 \
  --disk=path=/var/lib/libvirt/images/rhel71n.img,size=10,bus=virtio \
  --network=network=default,model=virtio \
  --graphics=none \
  --location=http://download.lab.eng.rdu2.redhat.com/nightly/RHEL-7.1-20140925.n.0/compose/Server/x86_64/os/ \
  --extra-args="console=tty0 console=ttyS0,9600n8 ks=http://termite.dfw.redhat.com/kickstart/rhel71n.ks"


After Anaconda finished the package installation, it failed like this:


An unknown error has occurred
===============================================================================
anaconda 19.31.92-1 exception report
Traceback (most recent call first):
  File "/usr/lib64/python2.7/site-packages/pyanaconda/kickstart.py", line 248, in execute
    raise KickstartError(msg)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/install.py", line 79, in doConfiguration
    ksdata.authconfig.execute(storage, ksdata, instClass)
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 211, in run
    threading.Thread.run(self, *args, **kwargs)
KickstartError: /usr/sbin/authconfig is missing. Cannot setup authentication.

What do you want to do now?
1) Report Bug
2) Debug
3) Quit

Please make your choice from above:

Comment 6 Václav Pavlín 2014-10-08 10:09:43 UTC
So if I understand that correctly firewalld and authconfig were installed by default to minimal install although they were not part of @core. That doesn't seem right. 

I understand we want to have @core as small as possible but if we install some packages by default anyway using non-comps methods it doesn't make sense and breaks the whole workflow.

As long as we consider firewalld and authconfig default packages, I'd like to see them in @core.

Are there other packages installed by Anaconda *always* which are not in @core?

Comment 7 Brian Lane 2014-10-13 21:35:00 UTC
Those were the only 2 that were always being installed.

Another alternative here is for anaconda to add the required package to the packagelist when the command is seen in the kickstart the same way we handle the realm command.

Comment 8 Brian Lane 2014-10-13 23:14:53 UTC
Created attachment 946625 [details]
proposed anaconda patch

Comment 9 Jon Disnard 2014-10-13 23:37:09 UTC
Question:
Would it be possible to do the same for initial-setup when the kickstart contains 'firstboot --enable'? That is another example of kickstart command that requires the package be installed. There might be others too.

It might be worth while to consider adding some kind of strict mode to anaconda to unconditionally obey %package section, and not install packages this way.

Comment 10 Brian Lane 2014-10-20 19:18:52 UTC
(In reply to Jon Disnard from comment #9)
> Question:
> Would it be possible to do the same for initial-setup when the kickstart
> contains 'firstboot --enable'? That is another example of kickstart command
> that requires the package be installed. There might be others too.
> 
> It might be worth while to consider adding some kind of strict mode to
> anaconda to unconditionally obey %package section, and not install packages
> this way.

Currently initial-setup is always needed, even to disable it (it runs systemctl disable) so we can't optionally install it.

The patch from comment 8 is now in upstream Anaconda so we can fix this in Anaconda with a cherry pick. I think that's better than loading up core with more required packages.

Comment 12 Alexander Todorov 2014-11-17 12:50:25 UTC
firstboot --disable
auth --useshadow --enablemd5 --enablecache
firewall --enabled --ssh
selinux --disabled

network --bootproto dhcp

# Partition and VG config
clearpart --all --initlabel
autopart

%packages --ignoremissing
@core
%end


with the above kickstart both autconfig and firewalld were installed and the respective commands in ks.cfg didn't crash during installation. Moving to VERIFIED.

Comment 13 David Cantrell 2014-12-12 20:18:37 UTC
*** Bug 1145462 has been marked as a duplicate of this bug. ***

Comment 18 errata-xmlrpc 2015-03-05 14:03:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0312.html