cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #06720
[Merge] ~bitfehler/cloud-init:bitfehler/cfg-arch into cloud-init:master
Conrad Hoffmann has proposed merging ~bitfehler/cloud-init:bitfehler/cfg-arch into cloud-init:master.
Commit message:
Add support for Arch Linux in render-cloudcfg
- Detect Arch Linux and set variant accordingly in `system_info()`
- Allow setting render-cloudcfg variant parameter to 'arch'
- Adjust some basic settings for Arch Linux in the cloud.cfg.tmpl
The template might need some additional Arch-specific tweaks in the
future, but at least for now the generated config works and contains the
most relevant modules.
Requested reviews:
cloud-init Commiters (cloud-init-dev)
For more details, see:
https://code.launchpad.net/~bitfehler/cloud-init/+git/cloud-init/+merge/372953
--
Your team cloud-init Commiters is requested to review the proposed merge of ~bitfehler/cloud-init:bitfehler/cfg-arch into cloud-init:master.
diff --git a/cloudinit/util.py b/cloudinit/util.py
index aa23b3f..dc7d9ef 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -656,7 +656,8 @@ def system_info():
var = 'unknown'
if system == "linux":
linux_dist = info['dist'][0].lower()
- if linux_dist in ('centos', 'debian', 'fedora', 'rhel', 'suse'):
+ if linux_dist in (
+ 'centos', 'debian', 'fedora', 'rhel', 'suse', 'arch'):
var = linux_dist
elif linux_dist in ('ubuntu', 'linuxmint', 'mint'):
var = 'ubuntu'
diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl
index 684c747..c196486 100644
--- a/config/cloud.cfg.tmpl
+++ b/config/cloud.cfg.tmpl
@@ -137,7 +137,7 @@ cloud_final_modules:
# (not accessible to handlers/transforms)
system_info:
# This will affect which distro class gets used
-{% if variant in ["centos", "debian", "fedora", "rhel", "suse", "ubuntu", "freebsd"] %}
+{% if variant in ["centos", "debian", "fedora", "rhel", "suse", "ubuntu", "freebsd", "arch"] %}
distro: {{ variant }}
{% else %}
# Unknown/fallback distro.
@@ -185,7 +185,7 @@ 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", "suse"] %}
+{% elif variant in ["centos", "rhel", "fedora", "suse", "arch"] %}
# Default user name + that default users groups (if added/used)
default_user:
name: {{ variant }}
@@ -193,6 +193,8 @@ system_info:
gecos: {{ variant }} Cloud User
{% if variant == "suse" %}
groups: [cdrom, users]
+{% elif variant == "arch" %}
+ groups: [wheel, users]
{% else %}
groups: [wheel, adm, systemd-journal]
{% endif %}
diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg
index 0957c32..0ebbc45 100755
--- a/tools/render-cloudcfg
+++ b/tools/render-cloudcfg
@@ -4,7 +4,8 @@ import argparse
import os
import sys
-VARIANTS = ["freebsd", "centos", "fedora", "rhel", "suse", "ubuntu", "unknown"]
+VARIANTS = ["freebsd", "centos", "fedora", "rhel", "suse", "ubuntu", "arch",
+ "unknown"]
if "avoid-pep8-E402-import-not-top-of-file":
_tdir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))