Ubuntu Pastebin

Paste from smoser at Thu, 21 Sep 2017 18:12:15 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl
index e6b20ef7..50e3bd86 100644
--- a/config/cloud.cfg.tmpl
+++ b/config/cloud.cfg.tmpl
@@ -163,13 +163,17 @@ system_info:
          primary: http://ports.ubuntu.com/ubuntu-ports
          security: http://ports.ubuntu.com/ubuntu-ports
    ssh_svcname: ssh
-{% elif variant in ["centos", "rhel", "fedora"] %}
+{% elif variant in ["centos", "rhel", "fedora", "suse"] %}
    # Default user name + that default users groups (if added/used)
    default_user:
      name: {{ variant }}
      lock_passwd: True
      gecos: {{ variant }} Cloud User
+{% if variant == "suse" %}
+     groups: [cdrom, users]
+{% else %}
      groups: [wheel, adm, systemd-journal]
+{% endif %}
      sudo: ["ALL=(ALL) NOPASSWD:ALL"]
      shell: /bin/bash
    # Other config here will be given to the distro class and/or path classes
@@ -186,18 +190,4 @@ system_info:
      groups: [wheel]
      sudo: ["ALL=(ALL) NOPASSWD:ALL"]
      shell: /bin/tcsh
-{% elif variant in ["suse"] %}
-   # Default user name + that default users groups (if added/used)
-   default_user:
-     name: {{ variant }}
-     lock_passwd: True
-     gecos: {{ variant }} Cloud User
-     groups: [cdrom, users]
-     sudo: ["ALL=(ALL) NOPASSWD:ALL"]
-     shell: /bin/bash
-   # 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/
-   ssh_svcname: sshd
 {% endif %}
diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl
index 870ccf1a..2cf7d2c4 100644
--- a/systemd/cloud-init-local.service.tmpl
+++ b/systemd/cloud-init-local.service.tmpl
@@ -14,6 +14,8 @@ Before=sysinit.target
 Conflicts=shutdown.target
 {% endif %}
 {% if variant in ["suse"] %}
+# Other distros use Before=sysinit.target. Currently clearly identified reason
+# for this delta.
 Before=basic.target
 Conflicts=shutdown.target
 {% endif %}
diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
index 0dd45e58..b92e8abc 100644
--- a/systemd/cloud-init.service.tmpl
+++ b/systemd/cloud-init.service.tmpl
@@ -16,6 +16,8 @@ After=network.service
 {% if variant in ["suse"] %}
 Requires=wicked.service
 After=wicked.service
+# setting hostname via hostnamectl depends on dbus, which otherwise
+# would not be guaranteed at this point.
 After=dbus.service
 {% endif %}
 Before=network-online.target
diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg
index e624541a..8b7cb875 100755
--- a/tools/render-cloudcfg
+++ b/tools/render-cloudcfg
@@ -4,6 +4,8 @@ import argparse
 import os
 import sys
 
+VARIANTS = ["bsd", "centos", "fedora", "rhel", "suse", "ubuntu", "unknown"]
+
 if "avoid-pep8-E402-import-not-top-of-file":
     _tdir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
     sys.path.insert(0, _tdir)
@@ -14,11 +16,10 @@ if "avoid-pep8-E402-import-not-top-of-file":
 
 def main():
     parser = argparse.ArgumentParser()
-    variants = ["bsd", "centos", "fedora", "rhel", "ubuntu", "unknown"]
     platform = util.system_info()
     parser.add_argument(
         "--variant", default=platform['variant'], action="store",
-        help="define the variant.", choices=variants)
+        help="define the variant.", choices=VARIANTS)
     parser.add_argument(
         "template", nargs="?", action="store",
         default='./config/cloud.cfg.tmpl',
Download as text