Red Hat Bugzilla – Bug 1160847
hammer import config-file doesn't handle rhn.system.net_interface.* macros correctly
Last modified: 2017-02-23 15:49:54 EST
Description of problem: When converting Sat5 config-files to puppet, the 'hammer import config-file' command is supposed to be able to translate between rhn.system.net_interface.* config-macros and several puppet @ipaddress/netmask_{NETWORK_INTERFACE} facts. This does not, alas, happen. How reproducible: Have a Sat5 with config files that include macros like rhn.system.net_interface.ip_address(eth0) and a Sat6 that you want to import those files into as puppet-modules. Steps to Reproduce: Sat5: satellite-export Sat5: scp export to Sat6 Sat6: hammer import config-file --csv-file /somewhere/config-files-latest.csv --generate-only Examine generated puppet files Actual results: <% rhn.system.net_interface.ip_address(eth0) %> Expected results: <% @ipaddress_eth0 %> Additional info: configfile.rb needs to have a much less brain-dead map_macros function.
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
katello/hammer-cli-import commit 528e6c5fc265aac38faf85abb03b3b12a713cdef
VERIFIED tested on: Satellite-6.1.0-RHEL-7-20150513.0 # cat config-files-latest.csv org_id,channel_id,channel,channel_type,path,file_type,file_id,revision,is_binary,contents,delim_start,delim_end,username,groupname,filemode,symbolic_link,selinux_ctx 1,3,config-1,normal,/etc/sysconfig/rhn/systemid,file,8,1,N," sid={| rhn.system.sid |} profile_name={| rhn.system.profile_name |} description={| rhn.system.description |} hostname={| rhn.system.hostname |} sys_ip_address={| rhn.system.ip_address |} cust_info={| rhn.system.custom_info(asset) |} ip_address={| rhn.system.net_interface.ip_address(eth0) |} netmask={| rhn.system.net_interface.netmask(eth0) |} broadcast={| rhn.system.net_interface.broadcast(eth0) |} mac_address={| rhn.system.net_interface.hardware_address(eth0) |} driver_module={| rhn.system.net_interface.driver_module(eth0) |} ",{|,|},root,root,600,, # hammer import config-file --generate-only --csv-file config-files-latest.csv Writing converted files Summary Wrote 1 puppet module. Wrote 1 puppet file. # cat ../puppet_work_dir/redhatsatteamqa-config_1/templates/_etc_sysconfig_rhn_systemid.erb sid=<%= %> profile_name=<%= %> description=<%= %> hostname=<%= @fqdn %> sys_ip_address=<%= @ipaddress %> cust_info=<%= rhn.system.custom_info(asset) %> ip_address=<%= @ipaddress_eth0 %> netmask=<%= @netmask_eth0 %> broadcast=<%= %> mac_address=<%= @macaddress_eth0 %> driver_module=<%= %>
This bug is slated to be released with Satellite 6.1.
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-2015:1592