sailesh1993 / rpms / cloud-init

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