c1c26e
From bfdc177f6127043eac555d356403d9e1d5c52243 Mon Sep 17 00:00:00 2001
c1c26e
From: Miroslav Rezanina <mrezanin@redhat.com>
c1c26e
Date: Thu, 31 May 2018 16:45:23 +0200
c1c26e
Subject: Add initial redhat setup
c1c26e
c1c26e
Rebase notes (18.5):
c1c26e
- added bash_completition file
c1c26e
- added cloud-id file
c1c26e
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
c1c26e
c1c26e
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
c1c26e
---
c1c26e
 cloudinit/config/cc_chef.py           |   6 +-
c1c26e
 cloudinit/settings.py                 |   7 +-
c1c26e
 redhat/.gitignore                     |   1 +
c1c26e
 redhat/Makefile                       |  71 ++++++
c1c26e
 redhat/Makefile.common                |  35 +++
c1c26e
 redhat/cloud-init-tmpfiles.conf       |   1 +
c1c26e
 redhat/cloud-init.spec.template       | 352 ++++++++++++++++++++++++++
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 +
c1c26e
 redhat/scripts/frh.py                 |  27 ++
c1c26e
 redhat/scripts/git-backport-diff      | 327 ++++++++++++++++++++++++
c1c26e
 redhat/scripts/git-compile-check      | 215 ++++++++++++++++
c1c26e
 redhat/scripts/process-patches.sh     |  73 ++++++
c1c26e
 redhat/scripts/tarball_checksum.sh    |   3 +
c1c26e
 rhel/README.rhel                      |   5 +
c1c26e
 rhel/cloud-init-tmpfiles.conf         |   1 +
c1c26e
 rhel/cloud.cfg                        |  69 +++++
c1c26e
 rhel/systemd/cloud-config.service     |  18 ++
c1c26e
 rhel/systemd/cloud-config.target      |  11 +
c1c26e
 rhel/systemd/cloud-final.service      |  19 ++
c1c26e
 rhel/systemd/cloud-init-local.service |  31 +++
c1c26e
 rhel/systemd/cloud-init.service       |  25 ++
c1c26e
 setup.py                              |  64 +----
c1c26e
 tools/read-version                    |  25 +-
c1c26e
 27 files changed, 1311 insertions(+), 90 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
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
c1c26e
c1c26e
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
c1c26e
index 46abedd1..fe7bda8c 100644
c1c26e
--- a/cloudinit/config/cc_chef.py
c1c26e
+++ b/cloudinit/config/cc_chef.py
c1c26e
@@ -33,7 +33,7 @@ file).
c1c26e
 
c1c26e
     chef:
c1c26e
        directories: (defaulting to /etc/chef, /var/log/chef, /var/lib/chef,
c1c26e
-                     /var/cache/chef, /var/backups/chef, /var/run/chef)
c1c26e
+                     /var/cache/chef, /var/backups/chef, /run/chef)
c1c26e
        validation_cert: (optional string to be written to file validation_key)
c1c26e
                         special value 'system' means set use existing file
c1c26e
        validation_key: (optional the path for validation_cert. default
c1c26e
@@ -88,7 +88,7 @@ CHEF_DIRS = tuple([
c1c26e
     '/var/lib/chef',
c1c26e
     '/var/cache/chef',
c1c26e
     '/var/backups/chef',
c1c26e
-    '/var/run/chef',
c1c26e
+    '/run/chef',
c1c26e
 ])
c1c26e
 REQUIRED_CHEF_DIRS = tuple([
c1c26e
     '/etc/chef',
c1c26e
@@ -112,7 +112,7 @@ CHEF_RB_TPL_DEFAULTS = {
c1c26e
     'json_attribs': CHEF_FB_PATH,
c1c26e
     'file_cache_path': "/var/cache/chef",
c1c26e
     'file_backup_path': "/var/backups/chef",
c1c26e
-    'pid_file': "/var/run/chef/client.pid",
c1c26e
+    'pid_file': "/run/chef/client.pid",
c1c26e
     'show_time': True,
c1c26e
 }
c1c26e
 CHEF_RB_TPL_BOOL_KEYS = frozenset(['show_time'])
c1c26e
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
c1c26e
index b1ebaade..c5367687 100644
c1c26e
--- a/cloudinit/settings.py
c1c26e
+++ b/cloudinit/settings.py
c1c26e
@@ -44,13 +44,16 @@ CFG_BUILTIN = {
c1c26e
     ],
c1c26e
     'def_log_file': '/var/log/cloud-init.log',
c1c26e
     'log_cfgs': [],
c1c26e
-    'syslog_fix_perms': ['syslog:adm', 'root:adm', 'root:wheel', 'root:root'],
c1c26e
+    'mount_default_fields': [None, None, 'auto', 'defaults,nofail', '0', '2'],
c1c26e
+    'ssh_deletekeys': False,
c1c26e
+    'ssh_genkeytypes': [],
c1c26e
+    'syslog_fix_perms': [],
c1c26e
     'system_info': {
c1c26e
         'paths': {
c1c26e
             'cloud_dir': '/var/lib/cloud',
c1c26e
             'templates_dir': '/etc/cloud/templates/',
c1c26e
         },
c1c26e
-        'distro': 'ubuntu',
c1c26e
+        'distro': 'rhel',
c1c26e
         'network': {'renderers': None},
c1c26e
     },
c1c26e
     'vendor_data': {'enabled': True, 'prefix': []},
c1c26e
diff --git a/rhel/README.rhel b/rhel/README.rhel
c1c26e
new file mode 100644
c1c26e
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
c1c26e
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
c1c26e
index 00000000..f0db3c12
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
c1c26e
+    groups: [wheel, 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
c1c26e
index 00000000..12ca9dfd
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]
c1c26e
+WantedBy=multi-user.target
c1c26e
diff --git a/rhel/systemd/cloud-config.target b/rhel/systemd/cloud-config.target
c1c26e
new file mode 100644
c1c26e
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
c1c26e
index 00000000..32a83d85
c1c26e
--- /dev/null
c1c26e
+++ b/rhel/systemd/cloud-final.service
c1c26e
@@ -0,0 +1,19 @@
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
c1c26e
+
c1c26e
+# Output needs to appear in instance console output
c1c26e
+StandardOutput=journal+console
c1c26e
+
c1c26e
+[Install]
c1c26e
+WantedBy=multi-user.target
c1c26e
diff --git a/rhel/systemd/cloud-init-local.service b/rhel/systemd/cloud-init-local.service
c1c26e
new file mode 100644
c1c26e
index 00000000..656eddb9
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]
c1c26e
+WantedBy=multi-user.target
c1c26e
diff --git a/rhel/systemd/cloud-init.service b/rhel/systemd/cloud-init.service
c1c26e
new file mode 100644
c1c26e
index 00000000..68fc5f19
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]
c1c26e
+WantedBy=multi-user.target
c1c26e
diff --git a/setup.py b/setup.py
c1c26e
index ea37efc3..06ae48a6 100755
c1c26e
--- a/setup.py
c1c26e
+++ b/setup.py
c1c26e
@@ -135,11 +135,6 @@ INITSYS_FILES = {
c1c26e
     'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)],
c1c26e
     'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)],
c1c26e
     'sysvinit_suse': [f for f in glob('sysvinit/suse/*') if is_f(f)],
c1c26e
-    'systemd': [render_tmpl(f)
c1c26e
-                for f in (glob('systemd/*.tmpl') +
c1c26e
-                          glob('systemd/*.service') +
c1c26e
-                          glob('systemd/*.target')) if is_f(f)],
c1c26e
-    'systemd.generators': [f for f in glob('systemd/*-generator') if is_f(f)],
c1c26e
     'upstart': [f for f in glob('upstart/*') if is_f(f)],
c1c26e
 }
c1c26e
 INITSYS_ROOTS = {
c1c26e
@@ -148,9 +143,6 @@ INITSYS_ROOTS = {
c1c26e
     'sysvinit_deb': 'etc/init.d',
c1c26e
     'sysvinit_openrc': 'etc/init.d',
c1c26e
     'sysvinit_suse': 'etc/init.d',
c1c26e
-    'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'),
c1c26e
-    'systemd.generators': pkg_config_read('systemd',
c1c26e
-                                          'systemdsystemgeneratordir'),
c1c26e
     'upstart': 'etc/init/',
c1c26e
 }
c1c26e
 INITSYS_TYPES = sorted([f.partition(".")[0] for f in INITSYS_ROOTS.keys()])
c1c26e
@@ -188,47 +180,6 @@ class MyEggInfo(egg_info):
c1c26e
         return ret
c1c26e
 
c1c26e
 
c1c26e
-# TODO: Is there a better way to do this??
c1c26e
-class InitsysInstallData(install):
c1c26e
-    init_system = None
c1c26e
-    user_options = install.user_options + [
c1c26e
-        # This will magically show up in member variable 'init_sys'
c1c26e
-        ('init-system=', None,
c1c26e
-         ('init system(s) to configure (%s) [default: None]' %
c1c26e
-          (", ".join(INITSYS_TYPES)))),
c1c26e
-    ]
c1c26e
-
c1c26e
-    def initialize_options(self):
c1c26e
-        install.initialize_options(self)
c1c26e
-        self.init_system = ""
c1c26e
-
c1c26e
-    def finalize_options(self):
c1c26e
-        install.finalize_options(self)
c1c26e
-
c1c26e
-        if self.init_system and isinstance(self.init_system, str):
c1c26e
-            self.init_system = self.init_system.split(",")
c1c26e
-
c1c26e
-        if len(self.init_system) == 0:
c1c26e
-            self.init_system = ['systemd']
c1c26e
-
c1c26e
-        bad = [f for f in self.init_system if f not in INITSYS_TYPES]
c1c26e
-        if len(bad) != 0:
c1c26e
-            raise DistutilsArgError(
c1c26e
-                "Invalid --init-system: %s" % (','.join(bad)))
c1c26e
-
c1c26e
-        for system in self.init_system:
c1c26e
-            # add data files for anything that starts with '<system>.'
c1c26e
-            datakeys = [k for k in INITSYS_ROOTS
c1c26e
-                        if k.partition(".")[0] == system]
c1c26e
-            for k in datakeys:
c1c26e
-                if not INITSYS_FILES[k]:
c1c26e
-                    continue
c1c26e
-                self.distribution.data_files.append(
c1c26e
-                    (INITSYS_ROOTS[k], INITSYS_FILES[k]))
c1c26e
-        # Force that command to reinitalize (with new file list)
c1c26e
-        self.distribution.reinitialize_command('install_data', True)
c1c26e
-
c1c26e
-
c1c26e
 if not in_virtualenv():
c1c26e
     USR = "/" + USR
c1c26e
     ETC = "/" + ETC
c1c26e
@@ -239,11 +190,9 @@ if not in_virtualenv():
c1c26e
 
c1c26e
 data_files = [
c1c26e
     (ETC + '/bash_completion.d', ['bash_completion/cloud-init']),
c1c26e
-    (ETC + '/cloud', [render_tmpl("config/cloud.cfg.tmpl")]),
c1c26e
     (ETC + '/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
c1c26e
     (ETC + '/cloud/templates', glob('templates/*')),
c1c26e
-    (USR_LIB_EXEC + '/cloud-init', ['tools/ds-identify',
c1c26e
-                                    'tools/uncloud-init',
c1c26e
+    (USR_LIB_EXEC + '/cloud-init', ['tools/uncloud-init',
c1c26e
                                     'tools/write-ssh-key-fingerprints']),
c1c26e
     (USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]),
c1c26e
     (USR + '/share/doc/cloud-init/examples',
c1c26e
@@ -255,15 +204,8 @@ if os.uname()[0] != 'FreeBSD':
c1c26e
     data_files.extend([
c1c26e
         (ETC + '/NetworkManager/dispatcher.d/',
c1c26e
          ['tools/hook-network-manager']),
c1c26e
-        (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']),
c1c26e
-        (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')])
c1c26e
+        ('/usr/lib/udev/rules.d', [f for f in glob('udev/*.rules')])
c1c26e
     ])
c1c26e
-# Use a subclass for install that handles
c1c26e
-# adding on the right init system configuration files
c1c26e
-cmdclass = {
c1c26e
-    'install': InitsysInstallData,
c1c26e
-    'egg_info': MyEggInfo,
c1c26e
-}
c1c26e
 
c1c26e
 requirements = read_requires()
c1c26e
 
c1c26e
@@ -278,8 +220,6 @@ setuptools.setup(
c1c26e
     scripts=['tools/cloud-init-per'],
c1c26e
     license='Dual-licensed under GPLv3 or Apache 2.0',
c1c26e
     data_files=data_files,
c1c26e
-    install_requires=requirements,
c1c26e
-    cmdclass=cmdclass,
c1c26e
     entry_points={
c1c26e
         'console_scripts': [
c1c26e
             'cloud-init = cloudinit.cmd.main:main',
c1c26e
diff --git a/tools/read-version b/tools/read-version
c1c26e
index e69c2ce0..d43cc8f0 100755
c1c26e
--- a/tools/read-version
c1c26e
+++ b/tools/read-version
c1c26e
@@ -65,29 +65,8 @@ output_json = '--json' in sys.argv
c1c26e
 src_version = ci_version.version_string()
c1c26e
 version_long = None
c1c26e
 
c1c26e
-if is_gitdir(_tdir) and which("git"):
c1c26e
-    flags = []
c1c26e
-    if use_tags:
c1c26e
-        flags = ['--tags']
c1c26e
-    cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags
c1c26e
-
c1c26e
-    version = tiny_p(cmd).strip()
c1c26e
-
c1c26e
-    if 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
-- 
c1c26e
2.20.1
c1c26e