Bug 1364491
Summary: | [RFE] for extending safemode to include hostname resolution | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | ckyriaki |
Component: | Provisioning Templates | Assignee: | Lukas Zapletal <lzap> |
Status: | CLOSED ERRATA | QA Contact: | Jitendra Yejare <jyejare> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.1.9 | CC: | bbuckingham, bkearney, jcallaha, lzap, sghai, tbrisker |
Target Milestone: | Unspecified | Keywords: | FutureFeature, Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://projects.theforeman.org/issues/16057 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-02-21 16:54:17 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: |
Description
ckyriaki
2016-08-05 13:39:04 UTC
Hello, given that this is a sensible way that things would work with an external DNS and DHCP (non-integrated) installation, shouldn't this be considered as a bug and have the priority increased? Regards, Christina Kyriakidou Hi Christina, I'd like for the component owner to take a look at the bugzilla as it has not gone through devel triaging. During that phase an engineer more familiar with this area will be able to validate the request and can adjust priority accordingly. Thanks! This is an easy change, let's put it on product backlog and we can put it on our sprint for upstream work. Upstream bug component is Provisioning Templates Moving to POST since upstream bug http://projects.theforeman.org/issues/16057 has been closed Verified! @ Satellite 6.3 snap 32/33 Steps: As per discussion with Assignee on irc: ``` <lzap> jyejare: the purpose of this BZ is that there is now new helper function: dns_lookup <lzap> https://github.com/theforeman/foreman/pull/3758/files <lzap> jyejare: it resolves you IP address to name and vice versa (name to IP) <lzap> jyejare: test scenario - in safemode create a template that resolves www.google.com and an ip address back to name <lzap> that's all <lzap> jyejare: you dont need anything configured, it uses satellites /etc/resolv.conf jyejare> lzap, so even i need not to have discovery and host? <lzap> nope ``` So as per chat, 1. Created new / modified provisioning template with new dns_lookup function and provided www.google.com as a parameter. <%= dns_lookup('www.google.com') %> 2. Rendered the template in safe mode Observation: In safemode, The template rendered without any error and it resolved ip from host (and vice-versa). Logs: ``` 2018-02-07 05:16:16 9ea6ddf0 [app] [I] Started POST "/templates/provisioning_templates/136-Satellite%20Kickstart%20Default_test2/preview" for 10.65.223.209 at 2018-02-07 05:16:16 -0500 2018-02-07 05:16:16 9ea6ddf0 [app] [I] Processing by ProvisioningTemplatesController#preview as */* 2018-02-07 05:16:16 9ea6ddf0 [app] [I] Parameters: {"template"=>"<%#\nkind: provision\nname: Satellite Kickstart default\noses:\n- CentOS 5\n- CentOS 6\n- CentOS 7\n- RedHat 5\n- RedHat 6\n- RedHat 7\n- Fedora 19\n- Fedora 20\n%>\n<%= dns_lookup('www.google.com') %>\n<%\n rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'\n os_major = @host.operatingsystem.major.to_i\n # safemode renderer does not support unary negation\n pm_set = @host.puppetmaster.empty? ? false : true\n puppet_enabled = pm_set || @host.params['force-puppet']\n salt_enabled = @host.params['salt_master'] ? true : false\n chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy\n section_end = (rhel_compatible && os_major <= 5) ? '' : '%end'\n%>\ninstall\n<%= @mediapath %>\nlang en_US.UTF-8\nselinux --enforcing\nkeyboard us\nskipx\n\n<% subnet = @host.subnet -%>\n<% if subnet.respond_to?(:dhcp_boot_mode?) -%>\n<% dhcp = subnet.dhcp_boot_mode? && !@static -%>\n<% else -%>\n<% dhcp = !@static -%>\n<% end -%>\n\nnetwork --bootproto <%= dhcp ? 'dhcp' : \"static --ip=\#{@host.ip} --netmask=\#{subnet.mask} --gateway=\#{subnet.gateway} --nameserver=\#{[subnet.dns_primary, subnet.dns_secondary].select{ |item| item.present? }.join(',')}\" %> --hostname <%= @host %><%= os_major >= 6 ? \" --device=\#{@host.mac}\" : '' -%>\n\nrootpw --iscrypted <%= root_pass %>\nfirewall --<%= os_major >= 6 ? 'service=' : '' %>ssh\nauthconfig --useshadow --passalgo=<%= @host.operatingsystem.password_hash || 'sha256' %> --kickstart\ntimezone --utc <%= @host.params['time-zone'] || 'UTC' %>\n\n<% if @host.operatingsystem.name == 'Fedora' and os_major <= 16 -%>\n# Bootloader exception for Fedora 16:\nbootloader --append=\"nofb quiet splash=quiet <%=ks_console%>\" <%= grub_pass %>\npart biosboot --fstype=biosboot --size=1\n<% else -%>\nbootloader --location=mbr --append=\"nofb quiet splash=quiet\" <%= grub_pass %>\n<% end -%>\n\n<% if os_major == 5 -%>\nkey --skip\n<% end -%>\n\n<% if @dynamic -%>\n%include /tmp/diskpart.cfg\n<% else -%>\n<%= @host.diskLayout %>\n<% end -%>\n\ntext\nreboot\n\n%packages --ignoremissing\nyum\ndhclient\nntp\nwget\n@Core\n<%= section_end -%>\n\n<% if @dynamic -%>\n%pre\n<%= @host.diskLayout %>\n<%= section_end -%>\n<% end -%>\n\n%post --nochroot\nexec < /dev/tty3 > /dev/tty3\n#changing to VT 3 so that we can see whats going on....\n/usr/bin/chvt 3\n(\ncp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf\n/usr/bin/chvt 1\n) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log\n<%= section_end -%>\n\n\n%post\nlogger \"Starting anaconda <%= @host %> postinstall\"\nexec < /dev/tty3 > /dev/tty3\n#changing to VT 3 so that we can see whats going on....\n/usr/bin/chvt 3\n(\n<% if subnet.respond_to?(:dhcp_boot_mode?) -%>\n<%= snippet 'kickstart_networking_setup' %>\n<% end -%>\n\n#update local time\necho \"updating system time\"\n/usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] || '0.fedora.pool.ntp.org' %>\n/usr/sbin/hwclock --systohc\n\n<%= snippet \"subscription_manager_registration\" %>\n\n<% if @host.info['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'Red Hat Identity Management' -%>\n<%= snippet \"idm_register\" %>\n<% end -%>\n\n# update all the base packages from the updates repository\nyum -t -y -e 0 update\n\n<%= snippet('remote_execution_ssh_keys') %>\n\n<% if chef_enabled %>\n<%= snippet 'chef_client' %>\n<% end -%>\n\n<% if puppet_enabled %>\n<%= snippet 'puppet_setup' %>\n<% end -%>\n\n<% if salt_enabled %>\n<%= snippet 'saltstack_setup' %>\n<% end -%>\n\n<%= snippet('ansible_provisioning_callback') %>\n\nsync\n\n<% if @provisioning_type == nil || @provisioning_type == 'host' -%>\n# Inform the build system that we are done.\necho \"Informing Foreman that we are built\"\nwget -q -O /dev/null --no-check-certificate <%= foreman_url('built') %>\n<% end -%>\n) 2>&1 | tee /root/install.post.log\nexit 0\n\n<%= section_end -%>\n", "preview_host_id"=>"", "id"=>"136-Satellite Kickstart Default_test2"} 2018-02-07 05:16:16 9ea6ddf0 [app] [I] Current user: admin (administrator) 2018-02-07 05:16:16 9ea6ddf0 [app] [I] Expire fragment views/tabs_and_title_records-3 (0.1ms) 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'Kickstart default' 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'Satellite Kickstart Default_test2' 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'Kickstart default' 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'kickstart_networking_setup' 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'kickstart_ifcfg_get_identifier_names' 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'kickstart_ifcfg_generic_interface' 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'subscription_manager_registration' 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.info in a template, it will be removed in 1.17. Use host_enc instead. 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'remote_execution_ssh_keys' 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'puppet_setup' 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed in 1.17. Use host_param_true? instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed in 1.17. Use host_param_true? instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [templates] [I] Rendering template 'puppet.conf' 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed in 1.17. Use host_param_true? instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed in 1.17. Use host_param_true? instead. 2018-02-07 05:16:16 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:17 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.param_true? in a template, it will be removed in 1.17. Use host_param_true? instead. 2018-02-07 05:16:17 9ea6ddf0 [app] [W] DEPRECATION WARNING: you are using deprecated @host.params in a template, it will be removed in 1.17. Use host_param instead. 2018-02-07 05:16:17 9ea6ddf0 [templates] [I] Rendering template 'ansible_provisioning_callback' 2018-02-07 05:16:17 9ea6ddf0 [app] [I] Rendered text template (0.0ms) 2018-02-07 05:16:17 9ea6ddf0 [app] [I] Completed 200 OK in 1033ms (Views: 0.6ms | ActiveRecord: 59.8ms) ``` Hence changing the state to Verified. 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
|