Re: [Freeipa-users] Importing Host Entries from /etc/hosts using sample nis-hosts.sh: Zone name error

2016-12-06 Thread List dedicated to discussions about use, configuration and deployment of the IPA server.



On 05.12.2016 17:42, Robert Kudyba wrote:


./nis-hosts.sh nisnamesubdomain.ourdomain.edu 



Zone name:
ipa: ERROR: 'name' is required
awk: cmd. line:1: {print $3 "."subdomain.ourdomain.edu 

 
"." nisname ".in-addr.arpa."}

awk: cmd. line:1:  ^ syntax error

Zone name: subdomain
ipa: ERROR: DNS is not configured


Looks to me like the DNS component was not configured in IPA so all the
dns-* commands will fail.


Well I mentioned that we are using the university’s DNS rather than a 
dedicated DNS server on the FreeIPA Fedora server. Where do I 
configure that in the GUI? Since our department does not have 
authority over the ouruniversity.edu  domain 
I figured it was best to use their’s red resolving DNS.





Hello,
you cannot use ipa dns* commands without integrated IPA DNS installed

to add DNS records you have to use the standard way your university 
system provides.


Martin
-- 
Manage your subscription for the Freeipa-users mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-users
Go to http://freeipa.org for more info on the project

Re: [Freeipa-users] Importing Host Entries from /etc/hosts using sample nis-hosts.sh: Zone name error

2016-12-05 Thread Robert Kudyba

>> ./nis-hosts.sh nisname subdomain.ourdomain.edu 
>> 
>> >  
>> 
>>  >
>> Zone name: 
>> ipa: ERROR: 'name' is required
>> awk: cmd. line:1: {print $3 "." subdomain.ourdomain.edu 
>> 
>> >  
>> 
>>  > "." nisname ".in-addr.arpa."}
>> awk: cmd. line:1:  ^ syntax error
>> 
>> Zone name: subdomain
>> ipa: ERROR: DNS is not configured
> 
> Looks to me like the DNS component was not configured in IPA so all the
> dns-* commands will fail.

Well I mentioned that we are using the university’s DNS rather than a dedicated 
DNS server on the FreeIPA Fedora server. Where do I configure that in the GUI? 
Since our department does not have authority over the ouruniversity.edu domain 
I figured it was best to use their’s red resolving DNS.

-- 
Manage your subscription for the Freeipa-users mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-users
Go to http://freeipa.org for more info on the project

Re: [Freeipa-users] Importing Host Entries from /etc/hosts using sample nis-hosts.sh: Zone name error

2016-12-05 Thread Rob Crittenden
Robert Kudyba wrote:
> Using the sample script
> 
>  I’m
> trying to use hosts that are in various states meaning they could be
> powered off or disconnected, in our 2 campuses. We maintain a “master”
> /etc/hosts file just to document how are static IP’s are assigned. When
> I try to use the script I get asked for the zone name for each host. We
> use the DNS of the university rather than running one on the FreeIPA
> Fedora 25 server. This is a new install so I can redo this as needed.
> Here’s what I get:
> 
> ./nis-hosts.sh nisname subdomain.ourdomain.edu
> 
> Zone name: 
> ipa: ERROR: 'name' is required
> awk: cmd. line:1: {print $3 "." subdomain.ourdomain.edu
>  "." nisname ".in-addr.arpa."}
> awk: cmd. line:1:  ^ syntax error
> 
> Zone name: subdomain
> ipa: ERROR: DNS is not configured

Looks to me like the DNS component was not configured in IPA so all the
dns-* commands will fail.

> Note I’m using our real domain and subdomain from above. The script is
> below. Can I hard code our domain and/or sub-domain some where in the
> script to get around the Zone name being prompted for each host?
> 
> #!/bin/sh
> # 1 is the nis domain, 2 is the nis master server
> ypcat -d $1-h $2hosts | egrep -v "localhost|127.0.0.1">
> /dev/shm/nis-map.hosts 2>&1 
> 
>  
> 
> IFS=$'\n' 
> forline in$(cat /dev/shm/nis-map.hosts); do 
> IFS=' ' 
> ipaddress=$(echo $line|awk '{print $1}') 
> hostname=$(echo $line|awk '{print $2}') 
> master=$(ipa env xmlrpc_uri |tr -d '[:space:]'|cut -f3 -d:|cut
> -f3 -d/) 
> domain=$(ipa env domain|tr -d '[:space:]'|cut -f2 -d:) 

I'd move these two ipa env commands out of the loop. These values won't
change and will just work to slow down the import.

rob

> if[ $(echo $hostname|grep "\."|wc -l) -eq 0 ]; then 
> hostname=$(echo $hostname.$domain) 
> fi 
> zone=$(echo $hostname|cut -f2- -d.) 
> if[ $(ipa dnszone-show $zone2>/dev/null | wc -l) -eq 0 ]; then 
> ipa dnszone-add
> --name-server=$master--admin-email=root.$master 
> fi 
> ptrzone=$(echo $ipaddress|awk -F. '{print $3 "." $2 "." $1
> ".in-addr.arpa."}')  
> if[ $(ipa dnszone-show $ptrzone2>/dev/null|wc -l) -eq 0 ]; then   
> ipa dnszone-add 
> $ptrzone--name-server=$master--admin-email=root.$master 
> fi 
> # Now create this entry  
> ipa host-add $hostname--ip-address=$ipaddress 
> ipa host-show $hostname 
> done
> 
> 
> 

-- 
Manage your subscription for the Freeipa-users mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-users
Go to http://freeipa.org for more info on the project