aboutsummaryrefslogblamecommitdiffstats
path: root/testing/cloud-init/03-add-to-cloud-cfg-template.patch
blob: 536050bcc41a30779f1eb0460c7410ec0632d311 (plain) (tree)

























































































                                                                                                                                         
--- a/config/cloud.cfg.tmpl
+++ b/config/cloud.cfg.tmpl
@@ -21,7 +21,7 @@
 disable_root: true
 {% endif %}
 
-{% if variant in ["amazon", "centos", "fedora", "rhel"] %}
+{% if variant in ["alpine", "amazon", "centos", "fedora", "rhel"] %}
 mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2']
 {% if variant == "amazon" %}
 resize_rootfs: noblock
@@ -72,6 +72,9 @@
  - update_hostname
 {% if variant not in ["freebsd", "netbsd"] %}
  - update_etc_hosts
+{% if variant in ["alpine"] %}
+ - resolv_conf
+{% endif %}
  - ca-certs
  - rsyslog
 {% endif %}
@@ -104,6 +107,9 @@
 {% if variant in ["suse"] %}
  - zypper-add-repo
 {% endif %}
+{% if variant in ["alpine"] %}
+ - apk-configure
+{% endif %}
 {% if variant not in ["freebsd", "netbsd"] %}
  - ntp
 {% endif %}
@@ -147,7 +153,7 @@
 # (not accessible to handlers/transforms)
 system_info:
    # This will affect which distro class gets used
-{% if variant in ["amazon", "arch", "centos", "debian", "fedora", "freebsd", "netbsd", "openbsd", "rhel", "suse", "ubuntu"] %}
+{% if variant in ["alpine", "amazon", "arch", "centos", "debian", "fedora", "freebsd", "netbsd", "openbsd", "rhel", "suse", "ubuntu"] %}
    distro: {{ variant }}
 {% else %}
    # Unknown/fallback distro.
@@ -169,9 +175,9 @@
    ntp_client: auto
    # Other config here will be given to the distro class and/or path classes
    paths:
-      cloud_dir: /var/lib/cloud/
-      templates_dir: /etc/cloud/templates/
-      upstart_dir: /etc/init/
+     cloud_dir: /var/lib/cloud/
+     templates_dir: /etc/cloud/templates/
+     upstart_dir: /etc/init/
    package_mirrors:
      - arches: [i386, amd64]
        failsafe:
@@ -198,8 +204,8 @@
          primary: http://ports.ubuntu.com/ubuntu-ports
          security: http://ports.ubuntu.com/ubuntu-ports
    ssh_svcname: ssh
-{% elif variant in ["amazon", "arch", "centos", "fedora", "rhel", "suse"] %}
-   # Default user name + that default users groups (if added/used)
+{% elif variant in ["alpine", "amazon", "arch", "centos", "fedora", "rhel", "suse"] %}
+   # Default user name + that default user's groups (if added/used)
    default_user:
 {% if variant == "amazon" %}
      name: ec2-user
@@ -212,17 +218,23 @@
 {% endif %}
 {% if variant == "suse" %}
      groups: [cdrom, users]
+{% elif variant == "alpine" %}
+     groups: [adm, sudo]
 {% elif variant == "arch" %}
      groups: [wheel, users]
 {% else %}
      groups: [wheel, adm, systemd-journal]
 {% endif %}
      sudo: ["ALL=(ALL) NOPASSWD:ALL"]
+{% if variant == "alpine" %}
+     shell: /bin/ash
+{% else %}
      shell: /bin/bash
+{% endif %}
    # Other config here will be given to the distro class and/or path classes
    paths:
-      cloud_dir: /var/lib/cloud/
-      templates_dir: /etc/cloud/templates/
+     cloud_dir: /var/lib/cloud/
+     templates_dir: /etc/cloud/templates/
    ssh_svcname: sshd
 {% elif variant in ["freebsd"] %}
    # Default user name + that default users groups (if added/used)