[INSTRM-71] organization of dnsmasq configuration files - both DHCP and DNS Created: 11/Jan/17 Updated: 22/Feb/18 Resolved: 22/Feb/18 |
|
Status: | Done |
Project: | Instrument control development |
Component/s: | ics_doc |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Task | Priority: | Major |
Reporter: | shimono | Assignee: | shimono |
Resolution: | Done | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
||||||||||||||||
Epic Link: | dnsmasq-production | ||||||||||||||||
Sprint: | 2017-10A |
Description |
Define organization of dnsmasq configuration files and put documents in ics_doc. ics_dnsmasq repo is designed to be mapped to /etc/dnsmasq.d/ directory, and all of non configuration lines shall start with '#', which breaks rst (or markdown).
Operational procedures (e.g. to register new hardware, to exchange hardware for maintenance) is planned to be developed in separated ticket (ref. Based on current working configuration used in labs at JHU and LAM (#19c9f47):
from [1], points 1,2 of 1st section, 1,2,4 of 2nd section. (5,6 of 1st section and 3 of 2nd section need to be defined in global configuration; 3,4 of 1st section is specific to JHU/LAM branch) Also following restrictions/ways have confirmed, which need to be cared in configurations:
*1 https://github.com/Subaru-PFS/ics_dnsmasq/blob/947663ffc3c63d4a9d9392cdc279627bffab6f95/PFS.README |
Comments |
Comment by shimono [ 07/Feb/17 ] |
addn-hosts and dhcp-hostsfile could have directory as its value. addn-hosts=/etc/dnsmasq.d/hosts/ dhcp-hostsfile=/etc/dnsmasq.d/dhcp/ Feb 7 09:14:31 disk-01 dnsmasq[5074]: read /etc/dnsmasq.d/hosts//hostname - 0 addresses Feb 7 09:14:31 disk-01 dnsmasq-dhcp[5074]: read /etc/dnsmasq.d/dhcp//infra Feb 7 09:14:31 disk-01 systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server. |
Comment by shimono [ 07/Feb/17 ] |
as similar to conf-dir, any files whose names end in ~, start with . or start and end with # are (seems to be) always skipped. /etc/dnsmasq.d# ls -al dhcp hosts dhcp: total 0 drwxr-xr-x 2 root root 33 Feb 7 13:46 . drwxr-xr-x 4 root root 78 Feb 7 09:14 .. -rw-r--r-- 1 root root 0 Feb 7 13:46 .dotfile -rw-r--r-- 1 root root 0 Feb 7 09:14 infra hosts: total 0 drwxr-xr-x 2 root root 53 Feb 7 13:45 . drwxr-xr-x 4 root root 78 Feb 7 09:14 .. -rw-r--r-- 1 root root 0 Feb 7 13:45 .dotfile -rw-r--r-- 1 root root 0 Feb 7 08:53 hostname -rw-r--r-- 1 root root 0 Feb 7 13:45 no-dotfile Feb 7 13:46:05 disk-01 dnsmasq[5227]: reading /etc/resolv.conf Feb 7 13:46:05 disk-01 dnsmasq[5227]: using nameserver 10.100.200.1#53 Feb 7 13:46:05 disk-01 dnsmasq[5227]: read /etc/hosts - 5 addresses Feb 7 13:46:05 disk-01 dnsmasq[5227]: read /etc/dnsmasq.d/hosts//no-dotfile - 0 addresses Feb 7 13:46:05 disk-01 dnsmasq[5227]: read /etc/dnsmasq.d/hosts//hostname - 0 addresses Feb 7 13:46:05 disk-01 dnsmasq-dhcp[5227]: read /etc/dnsmasq.d/dhcp//infra Feb 7 13:46:05 disk-01 systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server. so, we may be possible to host some readme or tips file with .xxxx filename. |
Comment by shimono [ 07/Feb/17 ] |
options we may need or may be better to have are:
options we may be better to have, but better to think seriously on environment:
|
Comment by shimono [ 07/Feb/17 ] |
basic idea
For dhcp/dns conf files,
This will make:
So, inter-branch management will be
also,
fmadec, arnaud.lefur, cloomis, jeg, sywang, chihyi, naoyuki.tamura, philip |
Comment by shimono [ 07/Feb/17 ] |
Additions for system-wide items
If host is configured as bonding (either by LACP or rr), DHCP request will be from one of bonded interfaces, so this configuration shall be fine. |
Comment by shimono [ 14/Apr/17 ] |
Draft of 1st version added as PR at github. |
Comment by yuki.moritani [ 17/Apr/17 ] |
Hi Atushi, Regarding the hostname, product-tree base name should be fine, but I feel that it would be better to describe guideline "hostname" more specifically, to avoid confusion and/or duplication. |
Comment by shimono [ 18/Apr/17 ] |
In the current proposal, following line is included. Isn't it enough? One point I may need to update is to define more solid way to perform merge (or copy and add) from branch to master (or even to some branch for AIT). We may need to have some review and filtering on such event to be more secure... |
Comment by naoyuki.tamura [ 18/Apr/17 ] |
Only a few comments: General:
|
Comment by shimono [ 18/Apr/17 ] |
|
Comment by shimono [ 28/Apr/17 ] |
Getting no comment from others, I'll merge this shortly, with reminding following points (mostly) to me.
|
Comment by cloomis [ 28/Jun/17 ] |
Atsushi, Arnaud, and I talked a bit more, and are now proposing the following. I will convert the JHU system under this ticket as a proof-of-concept. Basically,
A few more details: Configuration which will be valid only at one site goes into /etc/dnsmasq.d/site/, Configuration which will be valid in all locations goes in /etc/dnsmasq/PFS/ For now, we will leave hostnames and MAC addresses in separate files. This may popup in a separate ticket. Note that the standard Debian /etc/default/dnsmasq does not support two configure directories. But you can add arbitrary args to DNSMASQ_OPT |
Comment by shimono [ 28/Jun/17 ] |
I don't understand this, and I think we haven't talked as so. |
Comment by shimono [ 28/Jun/17 ] |
> dnsmasq configuration location argument becomes something like -7 /etc/dnsmasq.d/site,.conf -7 /etc/dnsmasq.d/PFS,.conf. As much as possible should be put here. I suppose -7 with following "," sections are for rejecting specific extensions. READ MAN BEFORE PROPOSING SOMETHING! |
Comment by rhl [ 29/Jun/17 ] |
Sounds good. Please ensure that a missing symbolic link generates useful and early error messages (and that no-one commits a link to git – so it needs to go in .gitignore) |
Comment by cloomis [ 29/Jun/17 ] |
dnsmasq has countless too-cute features. This is one.
If you have a better scheme than symbolic links we should use it. I can certainly see moving all the -7 args into an internal /etc/dnsmasq.d/dirs.conf file, but am stuck at that point. |
Comment by shimono [ 29/Jun/17 ] |
I had tried that (,*.conf) at some point, but it did not work, actually. Could be some issue in configuration loading process, but not sure why. Configuration at the dhcp/dns server will be one time, and for normal operation we will just pull from git and update configurations (w/ reloading them), so both way (symlink or in upper configuration) seems fine for me as operation point of view. |
Comment by arnaud.lefur [ 29/Jun/17 ] |
FYI, (,*.conf) is what we use at LAM. |
Comment by shimono [ 26/Jul/17 ] |
Hi cloomis, I'm quite sorry but it worked now. Also it worked with
in /etc/default/dnsmasq file, and could be easier to config by script??? (sorry not sure nor tried by Ansible). |
Comment by shimono [ 08/Aug/17 ] |
Updated proposal (from cloomis and me):
|
Comment by cloomis [ 31/Aug/17 ] |
We must be getting close. I just pushed the configuration which is running at IDG, and suggest that it can be merged and run at LAM. In short:
The dnsmasq-site.$site file contains all the configuration which is not common to all. In particular, it gives the directories for site-specific MAC and IP binding files. For LAM, say: # hostname - MAC dhcp-hostsfile=/etc/dnsmasq.d/macs-lam # hostname - IP addn-hosts=/etc/dnsmasq.d/hosts-10.1 addn-hosts=/etc/dnsmasq.d/hosts-lam declares that there are additional LAM device files in macs-lam/ and hosts-lam/, and that all the common PFS hosts are in the existing 10.1 network. I suspect that JHU and LAM (and ASIAA?) will switch to using the final observatory address range, as defined in hosts-subaru. But for this ticket we are just re-organizing. One LAM-specific note. I merged in the entries in pfs-ait-server:/etc/hosts into hosts-lam/. You can (and should!) put nameserver 127.0.0.1 as the first nameserver in /etc./resolv.conf to have that host also use dnsmasq to resolve names. If this is acceptable, ics_doc's SSN-00028 will need to be updated. |
Comment by arnaud.lefur [ 01/Sep/17 ] |
Thanks, that's very clear and I'm willing to test it as soon as possible.
I'm not against it, but I'm not sure to clearly understand the benefits, can you be a bit more specific just for my own curiosity ? |
Comment by shimono [ 05/Sep/17 ] |
It's to enable DNS name resolution on the dnsmasq host itself. If you don't run anything except dnsmasq, it is not required. But it might be useful if you are running some service on the same host. |
Comment by shimono [ 05/Sep/17 ] |
tftp-root configuration need to be an option, or we need to add a remark to have directory specified in tftp-root. Without directory, dnsmasq service does not start with error of missing directory. |
Comment by shimono [ 20/Sep/17 ] |
cloomis please check updated document at |
Comment by shimono [ 22/Sep/17 ] |
let's merge ics_dnsmasq side to production from migration trial branch. |
Comment by shimono [ 22/Feb/18 ] |
merged |