Bug 1402061

Summary: Installer script's "--help" output use of "default" is misleading
Product: Red Hat Satellite Reporter: Peter Tselios <tselios.petros>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Ales Dujicek <adujicek>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.4CC: adujicek, bbuckingham, dlobatog, jcallaha, mhulan, rjerrido, stbenjam, swadeley
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: http://projects.theforeman.org/issues/15903
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:10:57 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:
Attachments:
Description Flags
Features of the Satellite 6 capsule none

Description Peter Tselios 2016-12-06 17:02:37 UTC
Created attachment 1228628 [details]
Features of the Satellite 6 capsule

Description of problem:
Satellite installer by default (according to the --help) uses libvirt as a DNS/DHCP provider. 
However, if you use the libvirt, the capsules are not configured correctly. 



Version-Release number of selected component (if applicable):
6.2.3 and 6.2.4 (it's the same with both versions, probably earlier versions as well).

How reproducible:
Always.


Steps to Reproduce:
1. Install Satellite in as a KVM Virtual Machine using the following command:

satellite-installer -S satellite  \
  --foreman-proxy-dhcp-provider libvirt \
  --foreman-proxy-dhcp-server 192.168.122.1 \
  --foreman-proxy-dns-server 192.168.122.1 \
  --foreman-proxy-dns-provider libvirt \
  --foreman-proxy-dns true \
  --foreman-proxy-dhcp true 
  --foreman-proxy-dhcp-interface eth0

2. When the installation is finished, under the capsules the configured services.
According to Satellite, DHCP and DHS are not configured.
(see attached picture)

In my test Satellite, I only have those features:
Pulp, TFTP, Puppet, Puppet CA, Dynflow, Discovery, Openscap, and SSH 

Actual results:

cd /etc/foreman-proxy/settings.d
cat ./dns.yml 
---
# DNS management
:enabled: https
# valid providers:
#   dns_dnscmd (Microsoft Windows native implementation)
#   dns_nsupdate
#   dns_nsupdate_gss (for GSS-TSIG support)
#   dns_virsh (simple implementation for libvirt)
:use_provider: dns_libvirt
# use this setting if you want to override default TTL setting (86400)
:dns_ttl: 86400

As you see, the provider is set to dns_libvirt. Only that foreman, expects dns_virsh.

cat ./dhcp.yml 
---
# Enable DHCP management
# Can be true, false, or http/https to enable just one of the protocols
:enabled: https

# valid providers:
#   - dhcp_isc (ISC dhcp server)
#   - dhcp_native_ms (Microsoft native implementation)
#   - dhcp_virsh (simple implementation for libvirt)
:use_provider: dhcp_libvirt
:server: 192.168.122.1
# subnets restricts the subnets queried to a subset, to reduce the query time.
#:subnets: [192.168.205.0/255.255.255.128, 192.168.205.128/255.255.255.128]

Again the same. foreman expects dhcp_virsh, but dhcp_libvirt is configured.

Expected results:


Additional info:
I just followed the instructions of the satellite-installer --help
So, either the help page is wrong, in which case I should have an error for unsupported provider, or the installer, literally, writes the values we enter in the configuration file, which is even worse. 

satellite-installer --help 
...
    --foreman-proxy-dhcp          Enable DHCP feature (default: true)
    --foreman-proxy-dhcp-config   DHCP config file path (default: "/etc/dhcp/dhcpd.conf")
    --foreman-proxy-dhcp-gateway  DHCP pool gateway (default: "eth0")
    --foreman-proxy-dhcp-interface  DHCP listen interface (default: "eth0")
    --foreman-proxy-dhcp-key-name  DHCP key name (default: nil)
    --foreman-proxy-dhcp-key-secret  DHCP password (default: nil)
    --foreman-proxy-dhcp-leases   DHCP leases file (default: "/var/lib/dhcpd/dhcpd.leases")
    --foreman-proxy-dhcp-listen-on  DHCP proxy to listen on https, http, or both (default: "https")
    --foreman-proxy-dhcp-managed  DHCP is managed by Foreman proxy (default: true)
    --foreman-proxy-dhcp-nameservers  DHCP nameservers (default: "default")
    --foreman-proxy-dhcp-omapi-port  DHCP server OMAPI port (default: 7911)
    --foreman-proxy-dhcp-option-domain  DHCP use the dhcpd config option domain-name (default: ["testenv"])
    --foreman-proxy-dhcp-provider  DHCP provider (default: "libvirt")

...
    --foreman-proxy-dns           Enable DNS feature (default: true)
    --foreman-proxy-dns-forwarders  DNS forwarders (default: [])
    --foreman-proxy-dns-interface  DNS interface (default: "eth0")
    --foreman-proxy-dns-listen-on  DNS proxy to listen on https, http, or both (default: "https")
    --foreman-proxy-dns-managed   DNS is managed by Foreman proxy (default: true)
    --foreman-proxy-dns-provider  DNS provider (default: "libvirt")
...



Manually changing the entries to *_virsh and restarting the foreman-proxy server seems to resolve the issue.

Comment 1 Peter Tselios 2016-12-06 17:12:18 UTC
I tried with a completely wrong value. Installer accepted the value without complaining. So, this bug is about the --help. 

See Bug 1402062

Comment 2 Daniel Lobato Garcia 2016-12-06 20:17:55 UTC
Connecting redmine issue http://projects.theforeman.org/issues/15903 from this bug

Comment 3 Daniel Lobato Garcia 2016-12-06 20:24:11 UTC
This is fixed upstream already - the reason you're seeing the 'default: libvirt' there is just because you've ran the installer with that option. After you've ran the installer with that setting, it'll show up as "default".. even if it's wrong. 

The linked redmine issue fixes that behavior as you can see. I proposed it for 6 .4, as the installer is already done for 6.3, and 6.2 might be difficult to cherry-pick to.

Marek - if you can try to cp this to 6.2 or know if it'll work, that'd allow us to propose this for a zstream.
 

Thanks for proposing "Bug 1402062" which is definitely helpful and something to fix.

Comment 5 Marek Hulan 2017-01-06 09:30:33 UTC
I tried to do the cherry-pick but it has conflicts in 6 files. It seems that it could be resolved, the PR does not seem to depend on other changes but I'd say it's too big risk. It's been three releases of kafo already. I'd prefer to wait until next rebase, the impact is not too big I think.

Comment 6 Marek Hulan 2017-01-06 09:39:09 UTC
*** Bug 1124327 has been marked as a duplicate of this bug. ***

Comment 7 Stephen Benjamin 2017-04-20 13:44:46 UTC
Fixed title to be more clear

Comment 8 Stephen Benjamin 2017-04-20 13:45:11 UTC
*** Bug 1441285 has been marked as a duplicate of this bug. ***

Comment 10 Bryan Kearney 2018-02-21 16:44:44 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://access.redhat.com/errata/RHSA-2018:0336

Comment 11 Bryan Kearney 2018-02-21 17:10:57 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://access.redhat.com/errata/RHSA-2018:0336