Two files say one fact, the machine's name, and nothing owned /etc/hostname. The name written is the operator's hostname setting, with no default: three of four machines call themselves something other than their mesh name, and renaming one is the operator's call. It takes effect at the next boot.
49 lines
1.2 KiB
JSON
49 lines
1.2 KiB
JSON
{
|
|
"module": "hostname",
|
|
"version": "1",
|
|
"claims": [
|
|
{
|
|
"name": "node-hostname",
|
|
"scope": "node",
|
|
"serves": [
|
|
"entries",
|
|
"add",
|
|
"remove"
|
|
]
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "own",
|
|
"type": "file",
|
|
"path": "/etc/hosts",
|
|
"mode": "0644",
|
|
"into": "block",
|
|
"at": "start",
|
|
"content": "# The machine's own names (module hostname, novox/hq ADR 0199, ADR 0223). Every line outside this\n# block is the operator's: kept across every push, changed through the node-hostname verbs add and\n# remove, and given back when this module goes. The mesh's names are not here: the mesh's resolver\n# answers them.\n127.0.0.1\tlocalhost\n::1\tlocalhost\n127.0.1.1\t${machine:name}\n"
|
|
},
|
|
{
|
|
"id": "name",
|
|
"type": "file",
|
|
"path": "/etc/hostname",
|
|
"mode": "0644",
|
|
"content": "${setting:hostname}\n"
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "tools",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/hostname-tools",
|
|
"binary": "hostname-tools",
|
|
"loads": [
|
|
"hostname-tools"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|