Skip to content

Instantly share code, notes, and snippets.

@sbz
Created December 19, 2014 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbz/b0b74cabb953547b8633 to your computer and use it in GitHub Desktop.
Save sbz/b0b74cabb953547b8633 to your computer and use it in GitHub Desktop.
FreeBSD config file (base, localbase, kernel?, ...) backup as json in order to redeploy/backup config
{
"@base": {
"files": [
{
"make.conf": {
"filename": "make.conf",
"dirpath": "/etc/",
"@destination": "/etc/make.conf",
"@content": {
"svn_update": "yes",
"with_kms": "yes",
"with_new_xorg": "yes"
},
"@delimiter": "="
}
},
{
"src.conf": {
"filename": "src.conf",
"dirpath": "/etc/",
"@destination": "/etc/src.conf",
"@content": {
"without_telnet": "yes",
"without_kerberos": "yes"
},
"@delimiter": "="
}
},
{
"wpa_supplicant.conf": {
}
}
]
},
"@localbase": {
"files": [
{
"pkg.conf": {
"filename": "pkg.conf",
"dirpath": "/usr/local/etc/",
"@destination": "/usr/local/etc/pkg.conf",
"@content": {
"syslog": "yes"
},
"@delimiter": ":"
}
},
{
"tsocks.conf": {
"filename": "tsocks.conf",
"dirpath": "/usr/local/etc/",
"@destination": "/usr/local/etc/tsocks.conf",
"@content": {
"server": "127.0.0.1",
"server_port": "6666"
},
"@delimiter": "="
}
}
]
}
}
@sbz
Copy link
Author

sbz commented Dec 19, 2014

My ideas is:

  • cd ~/path/to/project
  • ./fdump --output /tmp/config.json or ./fdump --output --backup=.old /tmp/config.json
  • scp config.json cluster:/tmp/
  • ssh cluster-jail-x 'sudo ./fdump --input < /tmp/config.son'
  • LT: client/server ala zookeeper with push/pop ?
  • looks config file and profit :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment