1992bd
From 5e1e568d7085fd4443b4e3ccc492f5e31747e270 Mon Sep 17 00:00:00 2001
1992bd
From: Amy Chen <xiachen@redhat.com>
1992bd
Date: Wed, 20 Apr 2022 10:59:48 +0800
18322d
Subject: Add initial redhat setup
18322d
1992bd
Merged patches (22.1)
1992bd
- d18029bf Add netifaces package as a Requires in cloud-init.spec.template
1992bd
- 31adf961 Add gdisk and openssl as deps to fix UEFI / Azure initialization
1992bd
- f4a2905d Add dhcp-client as a dependency
1992bd
- 290e14cc cloud-init.spec.template: update %systemd_postun parameter
1992bd
- 9be4ae9b (tag: cloud-init-21.1-1.el8) Update to cloud-init-21.1-1.el8
1992bd
1992bd
Conflicts:
1992bd
cloudinit/config/cc_chef.py  Using double quotes instead of single quotes
1992bd
1992bd
cloudinit/settings.py
1992bd
- Using rhel settings
1992bd
- Using double quotes instead of single quotes
1992bd
1992bd
setup.py
1992bd
- Following the changes of 21.1 rebase
1992bd
- Using double quotes instead of single quotes
1992bd
1992bd
redhat/cloud-init.spec.template
1992bd
- Add the drop-in to the right cloud-init.spec used by our package builder, which is downstream-only part of the bz 2002492 fix.
1992bd
1992bd
redhat/Makefile.common
1992bd
- Backport the build handling fixes from patch "Update to cloud-init-21.1-1.el8"
1992bd
1992bd
Signed-off-by: Amy Chen <xiachen@redhat.com>
1992bd
bb836b
Merged patches (21.1):
bb836b
- 915d30ad Change gating file to correct rhel version
bb836b
- 311f318d Removing net-tools dependency
bb836b
- 74731806 Adding man pages to Red Hat spec file
bb836b
- 758d333d Removing blocking test from yaml configuration file
bb836b
- c7e7c59c Changing permission of cloud-init-generator to 755
bb836b
- 8b85abbb Installing man pages in the correct place with correct permissions
bb836b
- c6808d8d Fix unit failure of cloud-final.service if NetworkManager was not present.
bb836b
- 11866ef6 Report full specific version with "cloud-init --version"
bb836b
18322d
Rebase notes (18.5):
18322d
- added bash_completition file
18322d
- added cloud-id file
18322d
2b0ae0
Merged patches (20.3):
2b0ae0
- 01900d0 changing ds-identify patch from /usr/lib to /usr/libexec
2b0ae0
- 7f47ca3 Render the generator from template instead of cp
2b0ae0
8a7340
Merged patches (19.4):
8a7340
- 4ab5a61 Fix for network configuration not persisting after reboot
8a7340
- 84cf125 Removing cloud-user from wheel
8a7340
- 31290ab Adding gating tests for Azure, ESXi and AWS
8a7340
18322d
Merged patches (18.5):
18322d
- 2d6b469 add power-state-change module to cloud_final_modules
18322d
- 764159f Adding systemd mount options to wait for cloud-init
18322d
- da4d99e Adding disk_setup to rhel/cloud.cfg
18322d
- f5c6832 Enable cloud-init by default on vmware
2b0ae0
2b0ae0
Conflicts:
2b0ae0
cloudinit/config/cc_chef.py:
2b0ae0
 - Updated header documentation text
2b0ae0
 - Replacing double quotes by simple quotes
2b0ae0
2b0ae0
setup.py:
2b0ae0
 - Adding missing cmdclass info
2b0ae0
2b0ae0
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
18322d
---
8a7340
 .gitignore                            |   1 +
1992bd
 cloudinit/config/cc_chef.py           |  65 ++-
18322d
 cloudinit/settings.py                 |   7 +-
18322d
 redhat/.gitignore                     |   1 +
1992bd
 redhat/Makefile                       |  71 +++
bb836b
 redhat/Makefile.common                |  37 ++
18322d
 redhat/cloud-init-tmpfiles.conf       |   1 +
1992bd
 redhat/cloud-init.spec.template       | 696 ++++++++++++++++++++++++++
bb836b
 redhat/gating.yaml                    |   8 +
18322d
 redhat/rpmbuild/BUILD/.gitignore      |   3 +
18322d
 redhat/rpmbuild/RPMS/.gitignore       |   3 +
18322d
 redhat/rpmbuild/SOURCES/.gitignore    |   3 +
18322d
 redhat/rpmbuild/SPECS/.gitignore      |   3 +
18322d
 redhat/rpmbuild/SRPMS/.gitignore      |   3 +
1992bd
 redhat/scripts/frh.py                 |  25 +
1992bd
 redhat/scripts/git-backport-diff      | 327 ++++++++++++
1992bd
 redhat/scripts/git-compile-check      | 215 ++++++++
1992bd
 redhat/scripts/process-patches.sh     |  92 ++++
18322d
 redhat/scripts/tarball_checksum.sh    |   3 +
18322d
 rhel/README.rhel                      |   5 +
18322d
 rhel/cloud-init-tmpfiles.conf         |   1 +
1992bd
 rhel/cloud.cfg                        |  69 +++
bb836b
 rhel/systemd/cloud-config.service     |  18 +
18322d
 rhel/systemd/cloud-config.target      |  11 +
1992bd
 rhel/systemd/cloud-final.service      |  24 +
2b0ae0
 rhel/systemd/cloud-init-local.service |  31 ++
1992bd
 rhel/systemd/cloud-init.service       |  25 +
8a7340
 rhel/systemd/cloud-init.target        |   7 +
1992bd
 setup.py                              |  28 +-
2b0ae0
 tools/read-version                    |  28 +-
1992bd
 30 files changed, 1756 insertions(+), 55 deletions(-)
18322d
 create mode 100644 redhat/.gitignore
18322d
 create mode 100644 redhat/Makefile
18322d
 create mode 100644 redhat/Makefile.common
18322d
 create mode 100644 redhat/cloud-init-tmpfiles.conf
18322d
 create mode 100644 redhat/cloud-init.spec.template
8a7340
 create mode 100644 redhat/gating.yaml
18322d
 create mode 100644 redhat/rpmbuild/BUILD/.gitignore
18322d
 create mode 100644 redhat/rpmbuild/RPMS/.gitignore
18322d
 create mode 100644 redhat/rpmbuild/SOURCES/.gitignore
18322d
 create mode 100644 redhat/rpmbuild/SPECS/.gitignore
18322d
 create mode 100644 redhat/rpmbuild/SRPMS/.gitignore
18322d
 create mode 100755 redhat/scripts/frh.py
18322d
 create mode 100755 redhat/scripts/git-backport-diff
18322d
 create mode 100755 redhat/scripts/git-compile-check
18322d
 create mode 100755 redhat/scripts/process-patches.sh
18322d
 create mode 100755 redhat/scripts/tarball_checksum.sh
18322d
 create mode 100644 rhel/README.rhel
18322d
 create mode 100644 rhel/cloud-init-tmpfiles.conf
18322d
 create mode 100644 rhel/cloud.cfg
18322d
 create mode 100644 rhel/systemd/cloud-config.service
18322d
 create mode 100644 rhel/systemd/cloud-config.target
18322d
 create mode 100644 rhel/systemd/cloud-final.service
18322d
 create mode 100644 rhel/systemd/cloud-init-local.service
18322d
 create mode 100644 rhel/systemd/cloud-init.service
8a7340
 create mode 100644 rhel/systemd/cloud-init.target
18322d
18322d
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
1992bd
index fdb3a6e3..d028c548 100644
18322d
--- a/cloudinit/config/cc_chef.py
18322d
+++ b/cloudinit/config/cc_chef.py
2b0ae0
@@ -6,7 +6,70 @@
2b0ae0
 #
2b0ae0
 # This file is part of cloud-init. See LICENSE file for license information.
18322d
 
2b0ae0
-"""Chef: module that configures, starts and installs chef."""
2b0ae0
+"""
2b0ae0
+Chef
2b0ae0
+----
2b0ae0
+**Summary:** module that configures, starts and installs chef.
2b0ae0
+
2b0ae0
+This module enables chef to be installed (from packages or
2b0ae0
+from gems, or from omnibus). Before this occurs chef configurations are
2b0ae0
+written to disk (validation.pem, client.pem, firstboot.json, client.rb),
2b0ae0
+and needed chef folders/directories are created (/etc/chef and /var/log/chef
2b0ae0
+and so-on). Then once installing proceeds correctly if configured chef will
2b0ae0
+be started (in daemon mode or in non-daemon mode) and then once that has
2b0ae0
+finished (if ran in non-daemon mode this will be when chef finishes
2b0ae0
+converging, if ran in daemon mode then no further actions are possible since
2b0ae0
+chef will have forked into its own process) then a post run function can
2b0ae0
+run that can do finishing activities (such as removing the validation pem
2b0ae0
+file).
2b0ae0
+
2b0ae0
+**Internal name:** ``cc_chef``
2b0ae0
+
2b0ae0
+**Module frequency:** per always
2b0ae0
+
2b0ae0
+**Supported distros:** all
2b0ae0
+
2b0ae0
+**Config keys**::
2b0ae0
+
2b0ae0
+    chef:
2b0ae0
+       directories: (defaulting to /etc/chef, /var/log/chef, /var/lib/chef,
18322d
+                     /var/cache/chef, /var/backups/chef, /run/chef)
2b0ae0
+       validation_cert: (optional string to be written to file validation_key)
2b0ae0
+                        special value 'system' means set use existing file
2b0ae0
+       validation_key: (optional the path for validation_cert. default
2b0ae0
+                        /etc/chef/validation.pem)
2b0ae0
+       firstboot_path: (path to write run_list and initial_attributes keys that
2b0ae0
+                        should also be present in this configuration, defaults
2b0ae0
+                        to /etc/chef/firstboot.json)
2b0ae0
+       exec: boolean to run or not run chef (defaults to false, unless
2b0ae0
+                                             a gem installed is requested
2b0ae0
+                                             where this will then default
2b0ae0
+                                             to true)
2b0ae0
+
2b0ae0
+    chef.rb template keys (if falsey, then will be skipped and not
2b0ae0
+                           written to /etc/chef/client.rb)
2b0ae0
+
2b0ae0
+    chef:
2b0ae0
+      client_key:
2b0ae0
+      encrypted_data_bag_secret:
2b0ae0
+      environment:
2b0ae0
+      file_backup_path:
2b0ae0
+      file_cache_path:
2b0ae0
+      json_attribs:
2b0ae0
+      log_level:
2b0ae0
+      log_location:
2b0ae0
+      node_name:
2b0ae0
+      omnibus_url:
2b0ae0
+      omnibus_url_retries:
2b0ae0
+      omnibus_version:
2b0ae0
+      pid_file:
2b0ae0
+      server_url:
2b0ae0
+      show_time:
2b0ae0
+      ssl_verify_mode:
2b0ae0
+      validation_cert:
2b0ae0
+      validation_key:
2b0ae0
+      validation_name:
2b0ae0
+"""
2b0ae0
 
2b0ae0
 import itertools
2b0ae0
 import json
18322d
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
1992bd
index ecc1403b..39650a5b 100644
18322d
--- a/cloudinit/settings.py
18322d
+++ b/cloudinit/settings.py
1992bd
@@ -50,13 +50,16 @@ CFG_BUILTIN = {
18322d
     ],
1992bd
     "def_log_file": "/var/log/cloud-init.log",
1992bd
     "log_cfgs": [],
1992bd
-    "syslog_fix_perms": ["syslog:adm", "root:adm", "root:wheel", "root:root"],
1992bd
+    "mount_default_fields": [None, None, "auto", "defaults,nofail", "0", "2"],
1992bd
+    "ssh_deletekeys": False,
1992bd
+    "ssh_genkeytypes": [],
1992bd
+    "syslog_fix_perms": [],
1992bd
     "system_info": {
1992bd
         "paths": {
1992bd
             "cloud_dir": "/var/lib/cloud",
1992bd
             "templates_dir": "/etc/cloud/templates/",
18322d
         },
1992bd
-        "distro": "ubuntu",
1992bd
+        "distro": "rhel",
1992bd
         "network": {"renderers": None},
18322d
     },
1992bd
     "vendor_data": {"enabled": True, "prefix": []},
18322d
diff --git a/rhel/README.rhel b/rhel/README.rhel
18322d
new file mode 100644
bb836b
index 00000000..aa29630d
18322d
--- /dev/null
18322d
+++ b/rhel/README.rhel
18322d
@@ -0,0 +1,5 @@
18322d
+The following cloud-init modules are currently unsupported on this OS:
18322d
+ - apt_update_upgrade ('apt_update', 'apt_upgrade', 'apt_mirror', 'apt_preserve_sources_list', 'apt_old_mirror', 'apt_sources', 'debconf_selections', 'packages' options)
18322d
+ - byobu ('byobu_by_default' option)
18322d
+ - chef
18322d
+ - grub_dpkg
18322d
diff --git a/rhel/cloud-init-tmpfiles.conf b/rhel/cloud-init-tmpfiles.conf
18322d
new file mode 100644
bb836b
index 00000000..0c6d2a3b
18322d
--- /dev/null
18322d
+++ b/rhel/cloud-init-tmpfiles.conf
18322d
@@ -0,0 +1 @@
18322d
+d /run/cloud-init 0700 root root - -
18322d
diff --git a/rhel/cloud.cfg b/rhel/cloud.cfg
18322d
new file mode 100644
bb836b
index 00000000..82e8bf62
18322d
--- /dev/null
18322d
+++ b/rhel/cloud.cfg
18322d
@@ -0,0 +1,69 @@
18322d
+users:
18322d
+ - default
18322d
+
18322d
+disable_root: 1
18322d
+ssh_pwauth:   0
18322d
+
18322d
+mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service', '0', '2']
18322d
+resize_rootfs_tmp: /dev
18322d
+ssh_deletekeys:   0
18322d
+ssh_genkeytypes:  ~
18322d
+syslog_fix_perms: ~
18322d
+disable_vmware_customization: false
18322d
+
18322d
+cloud_init_modules:
18322d
+ - disk_setup
18322d
+ - migrator
18322d
+ - bootcmd
18322d
+ - write-files
18322d
+ - growpart
18322d
+ - resizefs
18322d
+ - set_hostname
18322d
+ - update_hostname
18322d
+ - update_etc_hosts
18322d
+ - rsyslog
18322d
+ - users-groups
18322d
+ - ssh
18322d
+
18322d
+cloud_config_modules:
18322d
+ - mounts
18322d
+ - locale
18322d
+ - set-passwords
18322d
+ - rh_subscription
18322d
+ - yum-add-repo
18322d
+ - package-update-upgrade-install
18322d
+ - timezone
18322d
+ - puppet
18322d
+ - chef
18322d
+ - salt-minion
18322d
+ - mcollective
18322d
+ - disable-ec2-metadata
18322d
+ - runcmd
18322d
+
18322d
+cloud_final_modules:
18322d
+ - rightscale_userdata
18322d
+ - scripts-per-once
18322d
+ - scripts-per-boot
18322d
+ - scripts-per-instance
18322d
+ - scripts-user
18322d
+ - ssh-authkey-fingerprints
18322d
+ - keys-to-console
18322d
+ - phone-home
18322d
+ - final-message
18322d
+ - power-state-change
18322d
+
18322d
+system_info:
18322d
+  default_user:
18322d
+    name: cloud-user
18322d
+    lock_passwd: true
18322d
+    gecos: Cloud User
8a7340
+    groups: [adm, systemd-journal]
18322d
+    sudo: ["ALL=(ALL) NOPASSWD:ALL"]
18322d
+    shell: /bin/bash
18322d
+  distro: rhel
18322d
+  paths:
18322d
+    cloud_dir: /var/lib/cloud
18322d
+    templates_dir: /etc/cloud/templates
18322d
+  ssh_svcname: sshd
18322d
+
18322d
+# vim:syntax=yaml
18322d
diff --git a/rhel/systemd/cloud-config.service b/rhel/systemd/cloud-config.service
18322d
new file mode 100644
bb836b
index 00000000..f3dcd4be
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-config.service
18322d
@@ -0,0 +1,18 @@
18322d
+[Unit]
18322d
+Description=Apply the settings specified in cloud-config
18322d
+After=network-online.target cloud-config.target
18322d
+Wants=network-online.target cloud-config.target
18322d
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
18322d
+ConditionKernelCommandLine=!cloud-init=disabled
18322d
+
18322d
+[Service]
18322d
+Type=oneshot
18322d
+ExecStart=/usr/bin/cloud-init modules --mode=config
18322d
+RemainAfterExit=yes
18322d
+TimeoutSec=0
18322d
+
18322d
+# Output needs to appear in instance console output
18322d
+StandardOutput=journal+console
18322d
+
18322d
+[Install]
8a7340
+WantedBy=cloud-init.target
18322d
diff --git a/rhel/systemd/cloud-config.target b/rhel/systemd/cloud-config.target
18322d
new file mode 100644
bb836b
index 00000000..ae9b7d02
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-config.target
18322d
@@ -0,0 +1,11 @@
18322d
+# cloud-init normally emits a "cloud-config" upstart event to inform third
18322d
+# parties that cloud-config is available, which does us no good when we're
18322d
+# using systemd.  cloud-config.target serves as this synchronization point
18322d
+# instead.  Services that would "start on cloud-config" with upstart can
18322d
+# instead use "After=cloud-config.target" and "Wants=cloud-config.target"
18322d
+# as appropriate.
18322d
+
18322d
+[Unit]
18322d
+Description=Cloud-config availability
18322d
+Wants=cloud-init-local.service cloud-init.service
18322d
+After=cloud-init-local.service cloud-init.service
18322d
diff --git a/rhel/systemd/cloud-final.service b/rhel/systemd/cloud-final.service
18322d
new file mode 100644
bb836b
index 00000000..e281c0cf
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-final.service
bb836b
@@ -0,0 +1,24 @@
18322d
+[Unit]
18322d
+Description=Execute cloud user/final scripts
18322d
+After=network-online.target cloud-config.service rc-local.service
18322d
+Wants=network-online.target cloud-config.service
18322d
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
18322d
+ConditionKernelCommandLine=!cloud-init=disabled
18322d
+
18322d
+[Service]
18322d
+Type=oneshot
18322d
+ExecStart=/usr/bin/cloud-init modules --mode=final
18322d
+RemainAfterExit=yes
18322d
+TimeoutSec=0
18322d
+KillMode=process
bb836b
+# Restart NetworkManager if it is present and running.
bb836b
+ExecStartPost=/bin/sh -c 'u=NetworkManager.service; \
bb836b
+ out=$(systemctl show --property=SubState $u) || exit; \
bb836b
+ [ "$out" = "SubState=running" ] || exit 0; \
bb836b
+ systemctl reload-or-try-restart $u'
18322d
+
18322d
+# Output needs to appear in instance console output
18322d
+StandardOutput=journal+console
18322d
+
18322d
+[Install]
8a7340
+WantedBy=cloud-init.target
18322d
diff --git a/rhel/systemd/cloud-init-local.service b/rhel/systemd/cloud-init-local.service
18322d
new file mode 100644
bb836b
index 00000000..8f9f6c9f
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-init-local.service
18322d
@@ -0,0 +1,31 @@
18322d
+[Unit]
18322d
+Description=Initial cloud-init job (pre-networking)
18322d
+DefaultDependencies=no
18322d
+Wants=network-pre.target
18322d
+After=systemd-remount-fs.service
18322d
+Requires=dbus.socket
18322d
+After=dbus.socket
18322d
+Before=NetworkManager.service network.service
18322d
+Before=network-pre.target
18322d
+Before=shutdown.target
18322d
+Before=firewalld.target
18322d
+Conflicts=shutdown.target
18322d
+RequiresMountsFor=/var/lib/cloud
18322d
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
18322d
+ConditionKernelCommandLine=!cloud-init=disabled
18322d
+
18322d
+[Service]
18322d
+Type=oneshot
18322d
+ExecStartPre=/bin/mkdir -p /run/cloud-init
18322d
+ExecStartPre=/sbin/restorecon /run/cloud-init
18322d
+ExecStartPre=/usr/bin/touch /run/cloud-init/enabled
18322d
+ExecStart=/usr/bin/cloud-init init --local
18322d
+ExecStart=/bin/touch /run/cloud-init/network-config-ready
18322d
+RemainAfterExit=yes
18322d
+TimeoutSec=0
18322d
+
18322d
+# Output needs to appear in instance console output
18322d
+StandardOutput=journal+console
18322d
+
18322d
+[Install]
8a7340
+WantedBy=cloud-init.target
18322d
diff --git a/rhel/systemd/cloud-init.service b/rhel/systemd/cloud-init.service
18322d
new file mode 100644
bb836b
index 00000000..d0023a05
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-init.service
18322d
@@ -0,0 +1,25 @@
18322d
+[Unit]
18322d
+Description=Initial cloud-init job (metadata service crawler)
18322d
+Wants=cloud-init-local.service
18322d
+Wants=sshd-keygen.service
18322d
+Wants=sshd.service
18322d
+After=cloud-init-local.service
18322d
+After=NetworkManager.service network.service
18322d
+Before=network-online.target
18322d
+Before=sshd-keygen.service
18322d
+Before=sshd.service
18322d
+Before=systemd-user-sessions.service
18322d
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
18322d
+ConditionKernelCommandLine=!cloud-init=disabled
18322d
+
18322d
+[Service]
18322d
+Type=oneshot
18322d
+ExecStart=/usr/bin/cloud-init init
18322d
+RemainAfterExit=yes
18322d
+TimeoutSec=0
18322d
+
18322d
+# Output needs to appear in instance console output
18322d
+StandardOutput=journal+console
18322d
+
18322d
+[Install]
8a7340
+WantedBy=cloud-init.target
8a7340
diff --git a/rhel/systemd/cloud-init.target b/rhel/systemd/cloud-init.target
8a7340
new file mode 100644
bb836b
index 00000000..083c3b6f
8a7340
--- /dev/null
8a7340
+++ b/rhel/systemd/cloud-init.target
8a7340
@@ -0,0 +1,7 @@
8a7340
+# cloud-init target is enabled by cloud-init-generator
8a7340
+# To disable it you can either:
8a7340
+#  a.) boot with kernel cmdline of 'cloud-init=disabled'
8a7340
+#  b.) touch a file /etc/cloud/cloud-init.disabled
8a7340
+[Unit]
8a7340
+Description=Cloud-init target
8a7340
+After=multi-user.target
18322d
diff --git a/setup.py b/setup.py
1992bd
index a9132d2c..3c377eaa 100755
18322d
--- a/setup.py
18322d
+++ b/setup.py
1992bd
@@ -139,21 +139,6 @@ INITSYS_FILES = {
1992bd
     "sysvinit_deb": [f for f in glob("sysvinit/debian/*") if is_f(f)],
1992bd
     "sysvinit_openrc": [f for f in glob("sysvinit/gentoo/*") if is_f(f)],
1992bd
     "sysvinit_suse": [f for f in glob("sysvinit/suse/*") if is_f(f)],
1992bd
-    "systemd": [
1992bd
-        render_tmpl(f)
1992bd
-        for f in (
1992bd
-            glob("systemd/*.tmpl")
1992bd
-            + glob("systemd/*.service")
1992bd
-            + glob("systemd/*.socket")
1992bd
-            + glob("systemd/*.target")
1992bd
-        )
1992bd
-        if (is_f(f) and not is_generator(f))
1992bd
-    ],
1992bd
-    "systemd.generators": [
8a7340
-        render_tmpl(f, mode=0o755)
1992bd
-        for f in glob("systemd/*")
1992bd
-        if is_f(f) and is_generator(f)
1992bd
-    ],
1992bd
     "upstart": [f for f in glob("upstart/*") if is_f(f)],
18322d
 }
18322d
 INITSYS_ROOTS = {
1992bd
@@ -163,10 +148,6 @@ INITSYS_ROOTS = {
1992bd
     "sysvinit_deb": "etc/init.d",
1992bd
     "sysvinit_openrc": "etc/init.d",
1992bd
     "sysvinit_suse": "etc/init.d",
1992bd
-    "systemd": pkg_config_read("systemd", "systemdsystemunitdir"),
1992bd
-    "systemd.generators": pkg_config_read(
1992bd
-        "systemd", "systemdsystemgeneratordir"
1992bd
-    ),
1992bd
     "upstart": "etc/init/",
18322d
 }
18322d
 INITSYS_TYPES = sorted([f.partition(".")[0] for f in INITSYS_ROOTS.keys()])
1992bd
@@ -281,15 +262,13 @@ data_files = [
1992bd
     (
1992bd
         USR_LIB_EXEC + "/cloud-init",
1992bd
         [
1992bd
-            "tools/ds-identify",
1992bd
             "tools/hook-hotplug",
1992bd
             "tools/uncloud-init",
1992bd
             "tools/write-ssh-key-fingerprints",
1992bd
         ],
1992bd
     ),
1992bd
     (
1992bd
-        USR + "/share/bash-completion/completions",
1992bd
-        ["bash_completion/cloud-init"],
1992bd
+        ETC + "/bash_completion.d", ["bash_completion/cloud-init"],
1992bd
     ),
1992bd
     (USR + "/share/doc/cloud-init", [f for f in glob("doc/*") if is_f(f)]),
1992bd
     (
1992bd
@@ -308,8 +287,7 @@ if not platform.system().endswith("BSD"):
1992bd
                 ETC + "/NetworkManager/dispatcher.d/",
1992bd
                 ["tools/hook-network-manager"],
1992bd
             ),
1992bd
-            (ETC + "/dhcp/dhclient-exit-hooks.d/", ["tools/hook-dhclient"]),
1992bd
-            (LIB + "/udev/rules.d", [f for f in glob("udev/*.rules")]),
1992bd
+            ("/usr/lib/udev/rules.d", [f for f in glob("udev/*.rules")]),
1992bd
             (
1992bd
                 ETC + "/systemd/system/sshd-keygen@.service.d/",
1992bd
                 ["systemd/disable-sshd-keygen-if-cloud-init-active.conf"],
1992bd
@@ -339,8 +317,6 @@ setuptools.setup(
1992bd
     scripts=["tools/cloud-init-per"],
1992bd
     license="Dual-licensed under GPLv3 or Apache 2.0",
18322d
     data_files=data_files,
18322d
-    install_requires=requirements,
18322d
-    cmdclass=cmdclass,
18322d
     entry_points={
1992bd
         "console_scripts": [
1992bd
             "cloud-init = cloudinit.cmd.main:main",
18322d
diff --git a/tools/read-version b/tools/read-version
bb836b
index 02c90643..79755f78 100755
18322d
--- a/tools/read-version
18322d
+++ b/tools/read-version
2b0ae0
@@ -71,32 +71,8 @@ version_long = None
2b0ae0
 is_release_branch_ci = (
2b0ae0
     os.environ.get("TRAVIS_PULL_REQUEST_BRANCH", "").startswith("upstream/")
2b0ae0
 )
2b0ae0
-if is_gitdir(_tdir) and which("git") and not is_release_branch_ci:
18322d
-    flags = []
18322d
-    if use_tags:
18322d
-        flags = ['--tags']
18322d
-    cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags
18322d
-
8a7340
-    try:
8a7340
-        version = tiny_p(cmd).strip()
8a7340
-    except RuntimeError:
8a7340
-        version = None
18322d
-
8a7340
-    if version is None or not version.startswith(src_version):
18322d
-        sys.stderr.write("git describe version (%s) differs from "
18322d
-                         "cloudinit.version (%s)\n" % (version, src_version))
18322d
-        sys.stderr.write(
18322d
-            "Please get the latest upstream tags.\n"
18322d
-            "As an example, this can be done with the following:\n"
18322d
-            "$ git remote add upstream https://git.launchpad.net/cloud-init\n"
18322d
-            "$ git fetch upstream --tags\n"
18322d
-        )
18322d
-        sys.exit(1)
18322d
-
18322d
-    version_long = tiny_p(cmd + ["--long"]).strip()
18322d
-else:
18322d
-    version = src_version
18322d
-    version_long = None
18322d
+version = src_version
18322d
+version_long = None
18322d
 
18322d
 # version is X.Y.Z[+xxx.gHASH]
18322d
 # version_long is None or X.Y.Z-xxx-gHASH
18322d
-- 
1992bd
2.31.1
18322d