summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Lefebvre <fredlef@amazon.com>2019-12-20 15:15:16 -0800
committerChad Smith <chad.smith@canonical.com>2019-12-20 16:15:16 -0700
commitcf2f7a9c4a584bd3cfb265013fbed95836341919 (patch)
tree059451a6b1e0dabf1e4a8546f38f663d4251760b
parent2c77a287a89e8356697fc2c03522e10aa523a512 (diff)
downloadcloud-init-git-cf2f7a9c4a584bd3cfb265013fbed95836341919.tar.gz
Add support for the amazon variant in cloud.cfg.tmpl (#119)
-rw-r--r--config/cloud.cfg.tmpl22
-rwxr-xr-xtools/render-cloudcfg4
2 files changed, 21 insertions, 5 deletions
diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl
index 18ab0ac5..99f96ea1 100644
--- a/config/cloud.cfg.tmpl
+++ b/config/cloud.cfg.tmpl
@@ -21,8 +21,11 @@ disable_root: false
disable_root: true
{% endif %}
-{% if variant in ["centos", "fedora", "rhel"] %}
+{% if variant in ["amazon", "centos", "fedora", "rhel"] %}
mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2']
+{% if variant == "amazon" %}
+resize_rootfs: noblock
+{% endif %}
resize_rootfs_tmp: /dev
ssh_pwauth: 0
@@ -42,6 +45,13 @@ datasource_list: ['NoCloud', 'ConfigDrive', 'Azure', 'OpenStack', 'Ec2']
# timeout: 5 # (defaults to 50 seconds)
# max_wait: 10 # (defaults to 120 seconds)
+
+{% if variant == "amazon" %}
+# Amazon Linux relies on ec2-net-utils for network configuration
+network:
+ config: disabled
+{% endif %}
+
# The modules that run in the 'init' stage
cloud_init_modules:
- migrator
@@ -133,7 +143,7 @@ cloud_final_modules:
# (not accessible to handlers/transforms)
system_info:
# This will affect which distro class gets used
-{% if variant in ["arch", "centos", "debian", "fedora", "freebsd", "rhel", "suse", "ubuntu"] %}
+{% if variant in ["amazon", "arch", "centos", "debian", "fedora", "freebsd", "rhel", "suse", "ubuntu"] %}
distro: {{ variant }}
{% else %}
# Unknown/fallback distro.
@@ -181,12 +191,18 @@ system_info:
primary: http://ports.ubuntu.com/ubuntu-ports
security: http://ports.ubuntu.com/ubuntu-ports
ssh_svcname: ssh
-{% elif variant in ["arch", "centos", "fedora", "rhel", "suse"] %}
+{% elif variant in ["amazon", "arch", "centos", "fedora", "rhel", "suse"] %}
# Default user name + that default users groups (if added/used)
default_user:
+{% if variant == "amazon" %}
+ name: ec2-user
+ lock_passwd: True
+ gecos: EC2 Default User
+{% else %}
name: {{ variant }}
lock_passwd: True
gecos: {{ variant }} Cloud User
+{% endif %}
{% if variant == "suse" %}
groups: [cdrom, users]
{% elif variant == "arch" %}
diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg
index a441f4ff..3d5fa725 100755
--- a/tools/render-cloudcfg
+++ b/tools/render-cloudcfg
@@ -4,8 +4,8 @@ import argparse
import os
import sys
-VARIANTS = ["arch", "centos", "debian", "fedora", "freebsd", "rhel", "suse",
- "ubuntu", "unknown"]
+VARIANTS = ["amazon", "arch", "centos", "debian", "fedora", "freebsd", "rhel",
+ "suse", "ubuntu", "unknown"]
if "avoid-pep8-E402-import-not-top-of-file":
_tdir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))