In the storage configuration that MAAS passes to curtin it includes stanzas like:
- id: sda-part5_mount
type: mount
path: /srv
options: rw,nosuid,nodev,noexec,relatime
#!/usr/bin/env python2.7 | |
# Copyright 2013 Canonical Ltd. This software is licensed under the | |
# GNU Affero General Public License version 3 (see the file LICENSE). | |
"""Upload files to MAAS. | |
Pipe or redirect the file to upload to stdin. | |
This is a workaround while file uploads don't work via maas-cli; see | |
https://bugs.launchpad.net/maas/+bug/1187826 for details. |
# Bash function to cd to a package on GOPATH (inspiration for that | |
# from... elsewhere; I can't remember now unfortunately), and bash | |
# completion for the aforementioned (my own work). Have at it. | |
# -- Gavin Panella, 2013 | |
gcd() { | |
local package="$1" | |
local pdir="$(go list -e -f '{{.Dir}}' "${package}")" | |
if [ -z "${pdir}" ] | |
then |
import aptdaemon.client | |
def printcall(*args, **kwargs): | |
print("call(*%r, **%r)" % (args, kwargs)) | |
client = aptdaemon.client.AptClient() | |
# I have make installed, but not abiword. | |
txn = client.install_packages(["make", "abiword"]) | |
txn.connect("dependencies-changed", printcall) | |
txn.simulate() |
echo 'Defaults !tty_tickets' | sudo tee -a /etc/sudoers.d/no_tty_tickets |
from contextlib import contextmanager | |
import time | |
import dns.resolver | |
from provisioningserver.utils.twisted import retries | |
def query_soa(zone): | |
for rdata in dns.resolver.query(zone, "SOA"): | |
return rdata # Return the first SOA found. |
Use the directory
output format because it works better with
incremental backups and is most flexible when restoring.
Do not compress because the overwhelming majority of the contents of the MAAS database is already compressed images. For a MAAS installation with one image the saving due to compression was only 1.7% but the dump took noticeably longer. With more images the ratio of already-compressed to not-compressed data goes up, and the savings will likely drop.
import string | |
import requests | |
maas_url = "http://maas.server:5240/MAAS/" | |
api_desc = requests.get(maas_url + "api/2.0/describe/").json() | |
uri_templates = {h["uri"] for h in api_desc["handlers"]} | |