#cloud-config
debconf_selections:
maas: |
{{for line in str(curtin_preseed).splitlines()}}
{{line}}
{{endfor}}
{{if third_party_drivers and driver}}
early_commands:
{{py: key_string = ''.join(['\\x%x' % x for x in map(ord, driver['key_binary'])])}}
driver_00_get_key: /bin/echo -en '{{key_string}}' > /tmp/maas-{{driver['package']}}.gpg
driver_01_add_key: ["apt-key", "add", "/tmp/maas-{{driver['package']}}.gpg"]
driver_02_add: ["add-apt-repository", "-y", "deb {{driver['repository']}} {{node.get_distro_series()}} main"]
driver_03_update_install: ["sh", "-c", "apt-get update --quiet && apt-get --assume-yes install {{driver['package']}}"]
driver_04_load: ["sh", "-c", "depmod && modprobe {{driver['module']}}"]
{{endif}}
late_commands:
log_config_0: curtin in-target -- sh -c "/bin/echo -e '*.* @logs.papertrailapp.com:55187' >> /etc/rsyslog.conf"
{{if 'iface-eth1' in node.tag_names()}}
sys_net_config_1: curtin in-target -- sh -c "/bin/echo -e 'auto eth1' >> /etc/network/interfaces"
{{endif}}
{{if 'iface-eth2' in node.tag_names()}}
sys_net_config_2: curtin in-target -- sh -c "/bin/echo -e 'auto eth2' >> /etc/network/interfaces"
{{endif}}
{{if 'iface-eth3' in node.tag_names()}}
sys_net_config_3: curtin in-target -- sh -c "/bin/echo -e 'auto eth3' >> /etc/network/interfaces"
{{endif}}
{{if 'iface-eth4' in node.tag_names()}}
sys_net_config_4: curtin in-target -- sh -c "/bin/echo -e 'auto eth4' >> /etc/network/interfaces"
{{endif}}
maas: [wget, '--no-proxy', '{{node_disable_pxe_url|escape.shell}}', '--post-data', '{{node_disable_pxe_data|escape.shell}}', '-O', '/dev/null']
{{if third_party_drivers and driver}}
driver_00_key_get: curtin in-target -- sh -c "/bin/echo -en '{{key_string}}' > /tmp/maas-{{driver['package']}}.gpg"
driver_02_key_add: ["curtin", "in-target", "--", "apt-key", "add", "/tmp/maas-{{driver['package']}}.gpg"]
driver_03_add: ["curtin", "in-target", "--", "add-apt-repository", "-y", "deb {{driver['repository']}} {{node.get_distro_series()}} main"]
driver_04_update_install: ["curtin", "in-target", "--", "apt-get", "update", "--quiet"]
driver_05_install: ["curtin", "in-target", "--", "apt-get", "-y", "install", "{{driver['package']}}"]
driver_06_depmod: ["curtin", "in-target", "--", "depmod"]
driver_07_update_initramfs: ["curtin", "in-target", "--", "update-initramfs", "-u"]
{{endif}}
power_state:
mode: reboot
{{if node.split_arch()[0] in {'i386', 'amd64'} }}
apt_mirrors:
ubuntu_archive: http://{{main_archive_hostname}}/{{main_archive_directory}}
ubuntu_security: http://{{main_archive_hostname}}/{{main_archive_directory}}
{{else}}
apt_mirrors:
ubuntu_archive: http://{{ports_archive_hostname}}/{{ports_archive_directory}}
ubuntu_security: http://{{ports_archive_hostname}}/{{ports_archive_directory}}
{{endif}}
{{if http_proxy }}
apt_proxy: {{http_proxy}}
{{else}}
apt_proxy: http://{{server_host}}:8000/
{{endif}}
final_commands:
sys_net_config_tes_0: curtin in-target -- sh -c "/bin/echo -e '#FINAL COMMANDS' >> /etc/network/interfaces"
{{if 'iface-eth1' in node.tag_names()}}
iface_up_1: ifup eth1
{{endif}}
{{if 'iface-eth2' in node.tag_names()}}
iface_up_2: ifup eth2
{{endif}}
{{if 'iface-eth3' in node.tag_names()}}
iface_up_3: ifup eth3
{{endif}}
{{if 'iface-eth4' in node.tag_names()}}
iface_up_4: ifup eth4
{{endif}}