I have uploaded a script [1] that does DNS re-creation for the host
and all interfaces as well as one for DHCP [2]. Unfortunately the DNS
A records never get created for interfaces because they lack a domain
when sent to the proxy.
When I run the script and create host records I see output like this…
vmstore1.domain.edu…vmstore1.domain.edu/192.168.202.245…VALID
vmstore1.domain.edu…192.168.202.245/vmstore1.domain.edu…VALID
When I remove line #41 and to create the interface DNS records, I see
output like this…
vmstore1-bmc…vmstore1-bmc/192.168.205.245…missing…recreating…DONE
vmstore1-bmc…192.168.205.245/vmstore1-bmc…VALID
Notice the domain does not exist in the output. I see the same in the
foreman-proxy.log files:
D, [2014-02-25T18:10:13.132870 #26653] DEBUG – : running
/usr/bin/nsupdate -k /etc/rndc.key
D, [2014-02-25T18:10:13.175770 #26653] DEBUG – : nsupdate: executed -
server 127.0.0.1
D, [2014-02-25T18:10:13.210169 #26653] DEBUG – : nsupdate: executed -
update add vmstore1-bmc. 86400 A 192.168.205.245
DNS A records that actually get created have the FQDN in the logs.
Using the rails console I find that the "vmstore1-bmc" interface does
have the correct domain associated to it in Rails.
interface = Nic::BMC.find_by_name('vmstore1-bmc')
Nic::BMC Load (0.3ms) SELECT nics
.* FROM nics
WHERE
nics
.type
IN ('Nic::BMC') AND nics
.name
= 'vmstore1-bmc' LIMIT
1
=> #<Nic::BMC id: 30, mac: "00:25:90:ce:4d:6c", ip: "192.168.205.245",
type: "Nic::BMC", name: "vmstore1-bmc", host_id: 47, subnet_id: 2,
domain_id: 1, attrs: {:username=>"<OMIT>", :password=>"<OMIT>",
:provider=>"IPMI"}, created_at: "2014-01-03 19:13:29", updated_at:
"2014-01-03 19:13:29">
interface.domain
Domain Load (0.3ms) SELECT domains
.* FROM domains
WHERE
domains
.id
= 1 ORDER BY domains.name LIMIT 1
=> #<Domain id: 1, name: "domain.edu", fullname: "domain.edu",
created_at: "2013-01-10 16:37:08", updated_at: "2014-01-15 20:32:32",
dns_id: 1>
I'm still on Foreman 1.3.2. Has this bug been resolved in 1.4.x, or
is this something that needs to be put into Redmine?
Thanks
[1] - https://gist.github.com/treydock/9220796
[2] - https://gist.github.com/treydock/9220870
···
On Fri, Feb 21, 2014 at 12:59 AM, Ohad Levy wrote:
>
>
> On Fri, Feb 21, 2014 at 2:21 AM, treydock wrote:
>>
>> I posted some time ago about the inability to see the posted code on a
>> blog article [1] that mentioned how to use a rails runner script to re-apply
>> DHCP leases to a foreman-proxy. I am now in the process of moving our
>> infrastructure into a more 'final' state and that includes putting the DNS
>> and DHCP services on their own VM (they are currently on the Puppetmaster).
>> I also still have an issue where a misconfigured domain in Foreman resulted
>> in many of my host's not having complete DNS records created. Is there any
>> way in Foreman 1.4 to write a script to run in Rails (or in Rails console)
>> to re-apply all host's DNS and DHCP records to a foreman-proxy. I've
>> tinkered some in the console and have found most of the obvious methods in
>> the various models are private and I don't know the "trick" to trick Foreman
>> via console into rerunning an orchestration.
>>
>> Thanks
>> - Trey
>>
>>
>> [1] -
>> http://blog.theforeman.org/2012/01/recovering-lost-dhcp-reservations.html
>
>
> the original gist can be found at https://gist.github.com/ohadlevy/1620981.
>
> I'll try to look at the blog issue again and see if we can fix it.
>
> thanks,
> ohad
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Foreman users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to foreman-users+unsubscribe@googlegroups.com.
>>
>> To post to this group, send email to foreman-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/foreman-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Foreman users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/foreman-users/86fEMd7sico/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> foreman-users+unsubscribe@googlegroups.com.
> To post to this group, send email to foreman-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/groups/opt_out.