Add ubuntu18

  * Info about Ubiquity https://wiki.ubuntu.com/UbiquityAutomation
    - we do exactly partitioning=> no possibility for now, to use
    new installer type.
  * Move growlvm.py to commons

Change-Id: Iabda3770b368a48919fef89d3a78cae388f60168
Prod-related: PROD-28155 (PROD:28155)
diff --git a/ubuntu-16.04/files/scripts/growlvm.py b/common/files/scripts/growlvm.py
similarity index 100%
rename from ubuntu-16.04/files/scripts/growlvm.py
rename to common/files/scripts/growlvm.py
diff --git a/common/ubuntu_bionic_base.sh b/common/ubuntu_bionic_base.sh
new file mode 100644
index 0000000..4aa98c6
--- /dev/null
+++ b/common/ubuntu_bionic_base.sh
@@ -0,0 +1,73 @@
+#!/bin/bash -xe
+
+# Don't use /tmp/ - some templates do node reboot
+if [ -f /done_ubuntu_base ] ; then
+  echo "INFO: ubuntu_base already finished.Skipping.."
+  exit 0
+fi
+#
+UBUNTU_BASEURL="${UBUNTU_BASEURL:-mirror://mirrors.ubuntu.com/mirrors.txt}"
+## Base packages and setup
+export DEBIAN_FRONTEND=noninteractive
+echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
+chmod +x /usr/sbin/policy-rc.d
+# Configure apt. Please refer to
+# https://github.com/Mirantis/reclass-system-salt-model/blob/master/linux/system/single/debian.yml
+# and keep those structures with same naming convention - to prevent
+# misconfiguration between base system and salt state.
+echo "Acquire::CompressionTypes::Order gz;" >/etc/apt/apt.conf.d/99compression-workaround-salt
+echo "Acquire::EnableSrvRecords false;" >/etc/apt/apt.conf.d/99enablesrvrecords-false
+echo "Acquire::http::Pipeline-Depth 0;" > /etc/apt/apt.conf.d/99aws-s3-mirrors-workaround-salt
+echo "APT::Install-Recommends false;" > /etc/apt/apt.conf.d/99dont_install_recommends-salt
+echo "APT::Install-Suggests false;" > /etc/apt/apt.conf.d/99dont_install_suggests-salt
+echo "Acquire::Languages none;" > /etc/apt/apt.conf.d/99dont_acquire_all_languages-salt
+echo "APT::Periodic::Update-Package-Lists 0;" > /etc/apt/apt.conf.d/99dont_update_package_list-salt
+echo "APT::Periodic::Download-Upgradeable-Packages 0;" > /etc/apt/apt.conf.d/99dont_update_download_upg_packages-salt
+echo "APT::Periodic::Unattended-Upgrade 0;" > /etc/apt/apt.conf.d/99disable_unattended_upgrade-salt
+
+sysctl -w fs.file-max=100000
+# Overwrite default mirrors
+echo "deb [arch=amd64] ${UBUNTU_BASEURL} bionic main restricted universe" > /etc/apt/sources.list
+echo "deb [arch=amd64] ${UBUNTU_BASEURL} bionic-updates main restricted universe" >> /etc/apt/sources.list
+echo "deb [arch=amd64] ${UBUNTU_BASEURL} bionic-security main restricted universe" >> /etc/apt/sources.list
+#echo "deb [arch=amd64] ${UBUNTU_BASEURL} bionic-backports main restricted universe" >> /etc/apt/sources.list
+
+apt-get clean
+apt-get update
+
+# Useful tools
+EXTRA_PKGS="byobu curl ethtool iputils-ping lsof strace tcpdump traceroute wget iptables"
+# Pretty tools
+EXTRA_PKGS="${EXTRA_PKGS} byobu htop tmux tree vim-nox mc eatmydata"
+# Common prerequisites
+# growlvm.py dependencies
+GROWLVM_PKGS="python3-jsonschema python3-yaml"
+EXTRA_PKGS="$EXTRA_PKGS $GROWLVM_PKGS gnupg2 apt-transport-https libmnl0 python3-apt python3-psutil acpid virt-what dbus bridge-utils vlan ifenslave"
+apt-get -y install ${EXTRA_PKGS}
+
+# Cleanup old kernels, ensure latest is installed via metapackage package
+if [ ! -f /tmp/no_install_kernel ]; then
+    apt-get purge -y linux-image-* linux-headers-* | grep -v 'is not installed, so not removed'
+    #apt-get install -y linux-image-virtual-hwe-18.04 linux-image-extra-virtual-hwe-18.04 linux-headers-generic-hwe-18.04
+    apt-get install -y linux-image-virtual  linux-image-extra-virtual linux-headers-generic
+    # Update grub cmdline
+    sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
+    sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
+    update-grub
+fi
+
+apt-get -y upgrade
+apt-get -y dist-upgrade
+
+# Setup cloud-init
+apt-get -y install cloud-init
+
+# FIXME: move to cluster model
+# Disable services
+disable_services="apt-daily.timer apt-daily-upgrade.timer lxc.service snapd.service snapd.socket open-iscsi.service tgt.service iscsid.service"
+for s in ${disable_services}; do
+  systemctl disable ${s} || true
+  systemctl stop ${s} || true
+done
+
+touch /done_ubuntu_base
diff --git a/common/ubuntu_bionic_cleanup.sh b/common/ubuntu_bionic_cleanup.sh
new file mode 100644
index 0000000..e5db691
--- /dev/null
+++ b/common/ubuntu_bionic_cleanup.sh
@@ -0,0 +1,49 @@
+#!/bin/bash -xe
+
+apt-get -y remove --purge unattended-upgrades || true
+apt-get -y autoremove --purge
+apt-get -y clean
+
+rm -rf /var/lib/apt/lists/* || true
+rm -rv /etc/apt/sources.list.d/* || true
+rm -rv /etc/apt/preferences.d/* || true
+echo > /etc/apt/sources.list  || true
+rm -vf /usr/sbin/policy-rc.d || true
+
+echo "cleaning up hostname"
+sed -i "/.*ubuntu.*/d" /etc/hosts
+sed -i "/.*salt.*/d" /etc/hosts
+
+echo "cleaning up dhcp leases"
+rm -rf /var/lib/dhcp/* || true
+rm -rfv /var/lib/ntp/ntp.conf.dhcp || true
+
+echo "cleaning up udev rules"
+rm -fv /etc/udev/rules.d/70-persistent-net.rules || true
+rm -rf /dev/.udev/ || true
+rm -fv /lib/udev/rules.d/75-persistent-net-generator.rules || true
+
+echo "cleaning up minion_id for salt"
+rm -vf /etc/salt/minion_id || true
+
+echo "cleaning up /var/cache/{apt,salt}/*"
+rm -rf /var/cache/{apt,salt}/* || true
+
+rm -rf /root/.cache || true
+rm -rf /root/.ssh/known_hosts || true
+
+# Remove flags
+rm -v /done_ubuntu_base || true
+rm -v /done_ubuntu_salt_bootstrap || true
+
+# Force cleanup cloud-init data, if it was
+if [[ -d '/var/lib/cloud/' ]] ; then
+  rm -rf /var/lib/cloud/* || true
+  cloud-init clean || true
+  echo > /var/log/cloud-init-output.log || true
+  echo > /var/log/cloud-init.log || true
+fi
+
+# Clear\drop cache's
+sync
+echo 3 > /proc/sys/vm/drop_caches
diff --git a/ubuntu-16.04/template.json b/ubuntu-16.04/template.json
index 6ffd6dd..076fdec 100644
--- a/ubuntu-16.04/template.json
+++ b/ubuntu-16.04/template.json
@@ -20,6 +20,10 @@
   },
   "provisioners": [
     {
+      "type": "shell-local",
+      "command": "cp -av ../common/files/scripts/growlvm.py files/scripts/growlvm.py"
+    },
+    {
       "type": "shell",
       "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
       "expect_disconnect": "true",
diff --git a/ubuntu-18.04/config-drive/meta-data b/ubuntu-18.04/config-drive/meta-data
new file mode 100644
index 0000000..c7ba190
--- /dev/null
+++ b/ubuntu-18.04/config-drive/meta-data
@@ -0,0 +1 @@
+hostname: ubuntu
diff --git a/ubuntu-18.04/config-drive/user-data b/ubuntu-18.04/config-drive/user-data
new file mode 100644
index 0000000..2e536cc
--- /dev/null
+++ b/ubuntu-18.04/config-drive/user-data
@@ -0,0 +1,18 @@
+#cloud-config
+debug: True
+ssh_pwauth: True
+disable_root: false
+chpasswd:
+  list: |
+    root:r00tme
+#    cloud-user:r00tme
+  expire: False
+output: {all: '| tee -a /var/log/cloud-init-output.log'}
+runcmd:
+  - sed -i'.orig' -e's/PermitRootLogin.*/PermitRootLogin yes/g' -e's/PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
+  - service sshd restart
+# speed up resolving, and not stuck on timeouts. One-shot changes
+  - echo '127.0.0.1 ubuntu' >> /etc/hosts
+  - echo 'options timeout:1 attempts:4' >> /etc/resolv.conf
+  - echo 'nameserver 172.18.208.44' >> /etc/resolvconf/resolv.conf.d/base
+  - resolvconf -u
diff --git a/ubuntu-18.04/files/etc/cloud/cloud.cfg.d/99_mcp.cfg b/ubuntu-18.04/files/etc/cloud/cloud.cfg.d/99_mcp.cfg
new file mode 100644
index 0000000..0ff3b57
--- /dev/null
+++ b/ubuntu-18.04/files/etc/cloud/cloud.cfg.d/99_mcp.cfg
@@ -0,0 +1,24 @@
+datasource_list: [ NoCloud, ConfigDrive, Ec2, OpenStack, OVF, MAAS, None ]
+datasource:
+    Ec2:
+      timeout: 5 # (defaults to 50 seconds)
+      max_wait: 10 # (defaults to 120 seconds)
+      strict_id: false
+    OpenStack:
+      timeout: 5 # (defaults to 50 seconds)
+      max_wait: 10 # (defaults to 120 seconds)
+    MAAS:
+      timeout: 5 # (defaults to 50 seconds)
+      max_wait: 10 # (defaults to 120 seconds)
+
+warnings:
+   dsid_missing_source: off
+
+system_info:
+   # This will affect which distro class gets used
+   distro: ubuntu
+   ssh_svcname: ssh
+
+growpart:
+   mode: auto
+   devices: ['/']
diff --git a/ubuntu-18.04/files/etc/iscsi/initiatorname.iscsi b/ubuntu-18.04/files/etc/iscsi/initiatorname.iscsi
new file mode 100644
index 0000000..bc15b98
--- /dev/null
+++ b/ubuntu-18.04/files/etc/iscsi/initiatorname.iscsi
@@ -0,0 +1,6 @@
+## DO NOT EDIT OR REMOVE THIS FILE!
+## If you remove this file, the iSCSI daemon will not start.
+## If you change the InitiatorName, existing access control lists
+## may reject this initiator.  The InitiatorName must be unique
+## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames.
+GenerateName=yes
\ No newline at end of file
diff --git a/ubuntu-18.04/http/preseed.cfg b/ubuntu-18.04/http/preseed.cfg
new file mode 100644
index 0000000..9dd5ebe
--- /dev/null
+++ b/ubuntu-18.04/http/preseed.cfg
@@ -0,0 +1,181 @@
+# Mirror settings
+
+# Configure part of mirroring via passed bootcmdline
+d-i mirror/protocol string http
+#d-i mirror/http/hostname string mirror.mirantis.com
+#d-i mirror/http/directory string testing/ubuntu
+
+d-i mirror/country string manual
+d-i apt-setup/use_mirror boolean true
+d-i mirror/http/proxy string
+
+d-i apt-setup/backports boolean false
+d-i base-installer/install-recommends boolean false
+d-i console-setup/ask_detect boolean false
+d-i console-setup/console-setup/layoutcode string us
+d-i console-setup/modelcode string pc105
+d-i keyboard-configuration/layout string USA
+d-i keyboard-configuration/variant string USA
+
+d-i debian-installer/locale string en_US
+d-i debian-installer/language string en
+d-i debian-installer/country EN
+
+d-i pkgsel/install-language-support boolean false
+
+d-i debian-installer/framebuffer boolean false
+d-i debconf/frontend select noninteractive
+#d-i base-installer/kernel/image string linux-hwe
+d-i base-installer/kernel/override-image string linux-server
+d-i clock-setup/utc boolean true
+d-i clock-setup/utc-auto boolean true
+d-i finish-install/reboot_in_progress note
+d-i grub-installer/only_debian boolean true
+d-i grub-installer/with_other_os boolean true
+d-i netcfg/get_domain string local
+d-i netcfg/get_hostname string ubuntu
+d-i netcfg/enable boolean true
+d-i netcfg/choose_interface select auto
+d-i hw-detect/load_firmware boolean true
+
+d-i partman-auto/disk string /dev/sda /dev/vda
+# Use LVM for partitioning
+d-i partman-auto/method string lvm
+
+# GPT
+
+d-i partman-basicfilesystems/choose_label string gpt
+d-i partman-basicfilesystems/default_label string gpt
+d-i partman-partitioning/choose_label string gpt
+d-i partman-partitioning/default_label string gpt
+d-i partman/choose_label string gpt
+d-i partman/default_label string gpt
+
+# GPT
+
+d-i partman-auto-lvm/guided_size string max
+
+# If one of the disks that are going to be automatically partitioned
+# contains an old LVM configuration, the user will normally receive a
+# warning. Preseed this away
+d-i partman-lvm/device_remove_lvm boolean true
+
+# And the same goes for the confirmation to write the lvm partitions.
+d-i partman-lvm/confirm boolean true
+
+# Really, please don't prompt me!
+d-i partman-lvm/confirm_nooverwrite boolean true
+
+d-i partman-auto/expert_recipe string                         \
+          vcp_lvm ::                                          \
+              1 1 1 free                                      \
+                      $gptonly{ }                             \
+                      $primary{ }                             \
+                      $bios_boot{ }                           \
+                      method{ biosgrub }                      \
+              .                                               \
+              1051 2 1051 ext3                                \
+                      $gptonly{ }                             \
+                      $primary{ }                             \
+                      method{ format } format{ }              \
+                      use_filesystem{ } filesystem{ ext3 }    \
+                      lable{ lable-boot }                     \
+                      mountpoint{ /boot }                     \
+              .                                               \
+              10 10 10 ext4                                   \
+                      $defaultignore{ }                       \
+                      $gptonly{ }                             \
+                      $primary{ }                             \
+                      method{ lvm }                           \
+                      vg_name{ vg0 }                          \
+              .                                               \
+              105 2 105 ext4                                \
+                      $lvmok{ }                               \
+                      in_vg{ vg0 }                            \
+                      lv_name{ home }                         \
+                      method{ lvm } format{ }                 \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ /home }                     \
+                      options/nodev{ nodev }                  \
+              .                                               \
+              105 2 105 ext4 ext4                            \
+                      $lvmok{ }                               \
+                      in_vg{ vg0 }                            \
+                      lv_name{ tmp }                          \
+                      method{ lvm } format{ }                 \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ /tmp }                      \
+                      options/nodev{ nodev }                  \
+                      options/nosuid{ nosuid }                \
+                      options/noexec{ noexec }                \
+              .                                               \
+              105 2 105 ext4                            \
+                      $lvmok{ }                               \
+                      in_vg{ vg0 }                            \
+                      lv_name{ var_log }                      \
+                      method{ format } format{ }              \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ /var/log }                  \
+                      options/noexec{ noexec }                \
+              .                                               \
+              315 2 315 ext4 ext4                            \
+                      $lvmok{ }                               \
+                      in_vg{ vg0 }                            \
+                      lv_name{ var_tmp }                      \
+                      method{ format } format{ }              \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ /var/tmp }                  \
+                      options/nodev{ nodev }                  \
+                      options/nosuid{ nosuid }                \
+                      options/noexec{ noexec }                \
+              .                                               \
+              105 2 105 ext4 ext4                                \
+                      $lvmok{ }                               \
+                      in_vg{ vg0 }                            \
+                      lv_name{ var_log_audit }                \
+                      method{ format } format{ }              \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ /var/log/audit }            \
+                      options/noexec{ noexec }                \
+              .                                               \
+              2154 2 65536 ext4                          \
+                      $lvmok{ }                               \
+                      method{ format } format{ }              \
+                      use_filesystem{ } filesystem{ ext4 }    \
+                      mountpoint{ / }                         \
+                      in_vg{ vg0 }                            \
+                      lv_name{ root }                         \
+              .
+
+d-i partman-auto/choose_recipe select vcp_lvm
+
+partman-basicfilesystems partman-basicfilesystems/no_swap boolean false
+
+# This makes partman automatically partition without confirmation, provided
+# that you told it what to do using one of the methods above.
+d-i     partman-partitioning/confirm_write_new_label boolean true
+d-i     partman/choose_partition select finish
+d-i     partman/confirm boolean true
+d-i     partman/confirm_nooverwrite boolean true
+
+d-i pkgsel/include string openssh-server
+d-i pkgsel/update-policy select none
+popularity-contest popularity-contest/participate boolean false
+
+d-i pkgsel/upgrade select safe-upgrade
+
+d-i time/zone string UTC
+d-i passwd/root-password password r00tme
+d-i passwd/root-password-again password r00tme
+d-i passwd/root-login boolean true
+d-i passwd/make-user boolean false
+d-i openssh-server/permit-root-login boolean true
+d-i user-setup/allow-password-weak boolean true
+d-i user-setup/encrypt-home boolean false
+tasksel tasksel/first multiselect minimal, ssh-server, openssh-server
+
+# in ubuntu18.04.2 netplan detect interface like enp0s3, but in reboot-ed system,
+# due init, its renames to ens3
+d-i preseed/late_command string \
+in-target sed -i 's/.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; \
+in-target sed -i 's/enp0s3/ens3/g' /etc/netplan/01-netcfg.yaml;
diff --git a/ubuntu-18.04/run.example.sh b/ubuntu-18.04/run.example.sh
new file mode 100755
index 0000000..4694f39
--- /dev/null
+++ b/ubuntu-18.04/run.example.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# pre-requirments:
+# apt-get install cloud-localds
+# Cloudimg: wget https://cloud-images.ubuntu.com/xenial/XXXX/xenial-server-cloudimg-amd64-disk1.img
+# Packer: https://releases.hashicorp.com/packer/1.1.3/packer_1.1.3_linux_amd64.zip
+
+# Those script - only example for variables, which should be passed to packer and
+# overwrite variables under /scripts/ directory
+
+# External script sources:
+# http/bootstrap.saltstack.com.sh https://github.com/saltstack/salt-bootstrap
+#
+export IMAGE_NAME="ubuntu-18-04-x64"
+export MIRROR_HOSTNAME="mirror.mirantis.com"
+export MIRROR_DIRECTORY="/testing/ubuntu/"
+
+#export SALTSTACK_REPO="deb [arch=amd64] http://mirror.mirantis.com/proposed/saltstack-2017.7/xenial xenial main"
+#export SALTSTACK_GPG="https://mirror.mirantis.com/proposed/saltstack-2017.7/trusty/SALTSTACK-GPG-KEY.pub"
+export SALTSTACK_REPO="deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7/ bionic main"
+export SALTSTACK_GPG="http://repo.saltstack.com/apt/ubuntu/18.04/amd64/2017.7/SALTSTACK-GPG-KEY.pub"
+###
+# Hard-coded folder in template
+export PACKER_IMAGES_CACHE="${HOME}/packer_images_cache/"
+mkdir -p "${PACKER_IMAGES_CACHE}"
+
+export PACKER_KEY_INTERVAL='10ms'
+export PACKER_LOG=1
+# For qemu test-build:
+[ -f config-drive/cloudata.iso ] && rm -v config-drive/cloudata.iso
+mkisofs -o config-drive/cloudata.iso -V cidata -r -J --quiet config-drive
+# For qemu test-build:
+/home/alexz/bin/packer build -machine-readable -only=qemu -parallel=false -on-error=ask template.json
+#rm -rf ~/.packer.d/
+
diff --git a/ubuntu-18.04/scripts/base.sh b/ubuntu-18.04/scripts/base.sh
new file mode 120000
index 0000000..167534c
--- /dev/null
+++ b/ubuntu-18.04/scripts/base.sh
@@ -0,0 +1 @@
+../../common/ubuntu_bionic_base.sh
\ No newline at end of file
diff --git a/ubuntu-18.04/scripts/cleanup.sh b/ubuntu-18.04/scripts/cleanup.sh
new file mode 120000
index 0000000..a8f0f4f
--- /dev/null
+++ b/ubuntu-18.04/scripts/cleanup.sh
@@ -0,0 +1 @@
+../../common/ubuntu_bionic_cleanup.sh
\ No newline at end of file
diff --git a/ubuntu-18.04/scripts/info.sh b/ubuntu-18.04/scripts/info.sh
new file mode 120000
index 0000000..772d054
--- /dev/null
+++ b/ubuntu-18.04/scripts/info.sh
@@ -0,0 +1 @@
+../../common/ubuntu_info.sh
\ No newline at end of file
diff --git a/ubuntu-18.04/scripts/motd.sh b/ubuntu-18.04/scripts/motd.sh
new file mode 100644
index 0000000..08fb622
--- /dev/null
+++ b/ubuntu-18.04/scripts/motd.sh
@@ -0,0 +1,17 @@
+#!/bin/bash -xe
+# Motd
+apt-get -y install update-motd
+rm -vf /etc/update-motd.d/*
+echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%d-%H-%M-%S' -u)" > /etc/image_version
+echo "BUILD_TIMESTAMP_RFC=\"$(date -u -R)\"" >> /etc/image_version
+cat << 'EOF' >> /etc/update-motd.d/00-header-mirantis
+#!/bin/sh
+#
+#    00-header - create the header of the MOTD
+#
+[ -r /etc/image_version ] && . /etc/image_version
+echo "Ubuntu 18.04 \"Bionic\" Mirantis cloud image"
+echo "Build date: ${BUILD_TIMESTAMP_RFC}"
+EOF
+chmod +x /etc/update-motd.d/00-header-mirantis
+
diff --git a/ubuntu-18.04/scripts/network.sh b/ubuntu-18.04/scripts/network.sh
new file mode 120000
index 0000000..ab1de37
--- /dev/null
+++ b/ubuntu-18.04/scripts/network.sh
@@ -0,0 +1 @@
+../../common/ubuntu_network.sh
\ No newline at end of file
diff --git a/ubuntu-18.04/scripts/salt.sh b/ubuntu-18.04/scripts/salt.sh
new file mode 100644
index 0000000..37a8700
--- /dev/null
+++ b/ubuntu-18.04/scripts/salt.sh
@@ -0,0 +1,34 @@
+#!/bin/bash -xe
+
+SALTSTACK_REPO=${SALTSTACK_REPO:-"deb [arch=amd64] https://mirror.mirantis.com/proposed/saltstack-2017.7/bionic/ bionic main"}
+SALTSTACK_GPG=${SALTSTACK_GPG:-"https://mirror.mirantis.com/proposed/saltstack-2017.7/bionic/SALTSTACK-GPG-KEY.pub"}
+
+wget -O - ${SALTSTACK_GPG} | sudo apt-key add -
+echo "${SALTSTACK_REPO}" > /etc/apt/sources.list.d/mcp_saltstack.list
+
+# This Pin-Priority fil should be always aligned with
+# https://github.com/Mirantis/reclass-system-salt-model/blob/master/linux/system/repo/mcp/apt_mirantis/saltstack.yml
+cat <<EOF >> /etc/apt/preferences.d/mcp_saltstack
+Package: *
+Pin: release o=SaltStack
+Pin-Priority: 1100
+EOF
+
+apt-get update
+apt-get -y install salt-minion
+mkdir -m700 -p /etc/salt/pki/minion
+
+cat <<EOF >> /etc/salt/minion.d/minion.conf
+max_event_size: 100000000
+acceptance_wait_time_max: 60
+acceptance_wait_time: 10
+random_reauth_delay: 270
+recon_default: 1000
+recon_max: 60000
+recon_randomize: True
+auth_timeout: 60
+EOF
+
+rm -vf /etc/apt/apt.conf.d/99allow_unauthenticated
+rm -vf /etc/apt/sources.list.d/mcp_saltstack.list
+rm -vf /etc/apt/preferences.d/mcp_saltstack
diff --git a/ubuntu-18.04/scripts/security.sh b/ubuntu-18.04/scripts/security.sh
new file mode 120000
index 0000000..3bd840a
--- /dev/null
+++ b/ubuntu-18.04/scripts/security.sh
@@ -0,0 +1 @@
+../../common/ubuntu_security.sh
\ No newline at end of file
diff --git a/ubuntu-18.04/scripts/zerodisk.sh b/ubuntu-18.04/scripts/zerodisk.sh
new file mode 120000
index 0000000..7a54d04
--- /dev/null
+++ b/ubuntu-18.04/scripts/zerodisk.sh
@@ -0,0 +1 @@
+../../common/zerodisk.sh
\ No newline at end of file
diff --git a/ubuntu-18.04/template.json b/ubuntu-18.04/template.json
new file mode 100644
index 0000000..b3a97e6
--- /dev/null
+++ b/ubuntu-18.04/template.json
@@ -0,0 +1,111 @@
+{
+  "variables": {
+    "user": "root",
+    "password": "r00tme",
+    "disk_size": "10000",
+    "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
+    "mirror_hostname": "{{ env `MIRROR_HOSTNAME` }}",
+    "mirror_directory": "{{ env `MIRROR_DIRECTORY` }}",
+    "ubuntu_baseurl": "http://{{ env `MIRROR_HOSTNAME`}}/{{ env `MIRROR_DIRECTORY` }}/",
+    "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
+    "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
+    "do_api_token": "{{ env `DO_API_TOKEN` }}",
+    "image_name": "{{ env `IMAGE_NAME` }}"
+  },
+  "provisioners": [
+    {
+      "type": "shell-local",
+      "command": "cp -av ../common/files/scripts/growlvm.py files/scripts/growlvm.py"
+    },
+    {
+      "type": "shell",
+      "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }};",
+      "expect_disconnect": "true",
+      "environment_vars": [
+        "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
+        "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
+        "SALTSTACK_REPO={{ user `saltstack_repo` }}"
+      ],
+      "override": {
+        "qemu": {
+          "scripts": [
+            "scripts/base.sh",
+            "scripts/motd.sh",
+            "scripts/salt.sh",
+            "scripts/network.sh",
+            "scripts/security.sh",
+            "scripts/cleanup.sh",
+            "scripts/info.sh",
+            "scripts/zerodisk.sh"
+          ]
+        }
+      }
+    },
+    {
+      "type": "file",
+      "source": "files/etc/",
+      "destination": "/etc"
+    },
+    {
+      "type": "file",
+      "source": "files/scripts/",
+      "destination": "/usr/bin"
+    }
+  ],
+  "builders": [
+    {
+      "type": "qemu",
+      "qemuargs": [
+        ["-m", "2048M"]
+      ],
+      "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\"  }}.qcow2",
+      "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\"  }}",
+      "disk_compression": true,
+      "disk_size": "{{ user `disk_size`}}",
+      "accelerator": "kvm",
+      "iso_checksum": "34416ff83179728d54583bf3f18d42d2",
+      "iso_checksum_type": "md5",
+      "iso_url": "http://cdimage.ubuntu.com/ubuntu/releases/bionic/release/ubuntu-18.04.2-server-amd64.iso",
+      "iso_target_path": "{{ user `images_cache` }}/ubuntu-18.04.2-server-amd64.iso",
+      "http_directory": "http",
+      "headless": true,
+      "ssh_username": "{{user `user`}}",
+      "ssh_password": "{{user `password`}}",
+      "shutdown_command": "sync; sudo /sbin/shutdown -hP now",
+      "boot_wait": "2s",
+      "ssh_timeout": "20m",
+      "ssh_host_port_min": 7050,
+      "ssh_host_port_max": 7060,
+      "vnc_port_min": 5930,
+      "vnc_port_max": 5930,
+      "boot_command": [
+        "<esc><down><wait><f6><esc><wait>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
+        " initrd=/install/hwe-initrd.gz",
+        " edd=on nodmraid nomodeset acpi=off",
+        " console-setup/ask_detect=false",
+        " console-setup/layoutcode=us",
+        " console-setup/modelcode=pc105",
+        " debconf/frontend=noninteractive",
+        " debian-installer=en_US",
+        " fb=false",
+        " kbd-chooser/method=us",
+        " keyboard-configuration/layout=USA",
+        " keyboard-configuration/variant=USA",
+        " netcfg/get_hostname=ubuntu netcfg/get_domain=local",
+        " locale=en_US",
+        " mirror/http/hostname={{ user `mirror_hostname` }} mirror/http/directory={{ user `mirror_directory` }}",
+        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg --- ",
+        "<enter><wait>"
+      ]
+    }
+  ]
+}