9dab26
From 4114343d0cd2fc3e5566eed27272480e003c89cc Mon Sep 17 00:00:00 2001
222d62
From: Miroslav Rezanina <mrezanin@redhat.com>
222d62
Date: Thu, 31 May 2018 16:45:23 +0200
222d62
Subject: Add initial redhat setup
222d62
0a07cd
Rebase notes (18.5):
0a07cd
- added bash_completition file
0a07cd
- added cloud-id file
0a07cd
9dab26
Merged patches (19.4):
9dab26
- 4ab5a61 Fix for network configuration not persisting after reboot
9dab26
- 84cf125 Removing cloud-user from wheel
9dab26
- 31290ab Adding gating tests for Azure, ESXi and AWS
9dab26
0a07cd
Merged patches (18.5):
0a07cd
- 2d6b469 add power-state-change module to cloud_final_modules
0a07cd
- 764159f Adding systemd mount options to wait for cloud-init
0a07cd
- da4d99e Adding disk_setup to rhel/cloud.cfg
0a07cd
- f5c6832 Enable cloud-init by default on vmware
222d62
---
9dab26
 .gitignore                            |   1 +
222d62
 cloudinit/config/cc_chef.py           |   6 +-
222d62
 cloudinit/settings.py                 |   7 +-
222d62
 redhat/.gitignore                     |   1 +
0a07cd
 redhat/Makefile                       |  71 ++++++
9dab26
 redhat/Makefile.common                |  37 +++
222d62
 redhat/cloud-init-tmpfiles.conf       |   1 +
9dab26
 redhat/cloud-init.spec.template       | 438 ++++++++++++++++++++++++++++++++++
9dab26
 redhat/gating.yaml                    |   9 +
222d62
 redhat/rpmbuild/BUILD/.gitignore      |   3 +
222d62
 redhat/rpmbuild/RPMS/.gitignore       |   3 +
222d62
 redhat/rpmbuild/SOURCES/.gitignore    |   3 +
222d62
 redhat/rpmbuild/SPECS/.gitignore      |   3 +
222d62
 redhat/rpmbuild/SRPMS/.gitignore      |   3 +
9dab26
 redhat/scripts/frh.py                 |  27 +++
9dab26
 redhat/scripts/git-backport-diff      | 327 +++++++++++++++++++++++++
9dab26
 redhat/scripts/git-compile-check      | 215 +++++++++++++++++
0a07cd
 redhat/scripts/process-patches.sh     |  73 ++++++
222d62
 redhat/scripts/tarball_checksum.sh    |   3 +
222d62
 rhel/README.rhel                      |   5 +
222d62
 rhel/cloud-init-tmpfiles.conf         |   1 +
9dab26
 rhel/cloud.cfg                        |  69 ++++++
222d62
 rhel/systemd/cloud-config.service     |  18 ++
0a07cd
 rhel/systemd/cloud-config.target      |  11 +
222d62
 rhel/systemd/cloud-final.service      |  19 ++
0a07cd
 rhel/systemd/cloud-init-local.service |  31 +++
0a07cd
 rhel/systemd/cloud-init.service       |  25 ++
9dab26
 rhel/systemd/cloud-init.target        |   7 +
9dab26
 setup.py                              |  70 +-----
9dab26
 tools/read-version                    |  28 +--
9dab26
 30 files changed, 1417 insertions(+), 98 deletions(-)
222d62
 create mode 100644 redhat/.gitignore
222d62
 create mode 100644 redhat/Makefile
222d62
 create mode 100644 redhat/Makefile.common
222d62
 create mode 100644 redhat/cloud-init-tmpfiles.conf
222d62
 create mode 100644 redhat/cloud-init.spec.template
9dab26
 create mode 100644 redhat/gating.yaml
222d62
 create mode 100644 redhat/rpmbuild/BUILD/.gitignore
222d62
 create mode 100644 redhat/rpmbuild/RPMS/.gitignore
222d62
 create mode 100644 redhat/rpmbuild/SOURCES/.gitignore
222d62
 create mode 100644 redhat/rpmbuild/SPECS/.gitignore
222d62
 create mode 100644 redhat/rpmbuild/SRPMS/.gitignore
222d62
 create mode 100755 redhat/scripts/frh.py
222d62
 create mode 100755 redhat/scripts/git-backport-diff
222d62
 create mode 100755 redhat/scripts/git-compile-check
222d62
 create mode 100755 redhat/scripts/process-patches.sh
222d62
 create mode 100755 redhat/scripts/tarball_checksum.sh
222d62
 create mode 100644 rhel/README.rhel
222d62
 create mode 100644 rhel/cloud-init-tmpfiles.conf
222d62
 create mode 100644 rhel/cloud.cfg
222d62
 create mode 100644 rhel/systemd/cloud-config.service
222d62
 create mode 100644 rhel/systemd/cloud-config.target
222d62
 create mode 100644 rhel/systemd/cloud-final.service
222d62
 create mode 100644 rhel/systemd/cloud-init-local.service
222d62
 create mode 100644 rhel/systemd/cloud-init.service
9dab26
 create mode 100644 rhel/systemd/cloud-init.target
222d62
222d62
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
9dab26
index 0ad6b7f..e4408a4 100644
222d62
--- a/cloudinit/config/cc_chef.py
222d62
+++ b/cloudinit/config/cc_chef.py
222d62
@@ -33,7 +33,7 @@ file).
222d62
 
222d62
     chef:
222d62
        directories: (defaulting to /etc/chef, /var/log/chef, /var/lib/chef,
222d62
-                     /var/cache/chef, /var/backups/chef, /var/run/chef)
222d62
+                     /var/cache/chef, /var/backups/chef, /run/chef)
222d62
        validation_cert: (optional string to be written to file validation_key)
222d62
                         special value 'system' means set use existing file
222d62
        validation_key: (optional the path for validation_cert. default
9dab26
@@ -89,7 +89,7 @@ CHEF_DIRS = tuple([
222d62
     '/var/lib/chef',
222d62
     '/var/cache/chef',
222d62
     '/var/backups/chef',
222d62
-    '/var/run/chef',
222d62
+    '/run/chef',
222d62
 ])
222d62
 REQUIRED_CHEF_DIRS = tuple([
222d62
     '/etc/chef',
9dab26
@@ -113,7 +113,7 @@ CHEF_RB_TPL_DEFAULTS = {
222d62
     'json_attribs': CHEF_FB_PATH,
222d62
     'file_cache_path': "/var/cache/chef",
222d62
     'file_backup_path': "/var/backups/chef",
222d62
-    'pid_file': "/var/run/chef/client.pid",
222d62
+    'pid_file': "/run/chef/client.pid",
222d62
     'show_time': True,
9dab26
     'encrypted_data_bag_secret': None,
222d62
 }
222d62
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
9dab26
index ca4ffa8..3a04a58 100644
222d62
--- a/cloudinit/settings.py
222d62
+++ b/cloudinit/settings.py
9dab26
@@ -46,13 +46,16 @@ CFG_BUILTIN = {
222d62
     ],
222d62
     'def_log_file': '/var/log/cloud-init.log',
222d62
     'log_cfgs': [],
0a07cd
-    'syslog_fix_perms': ['syslog:adm', 'root:adm', 'root:wheel', 'root:root'],
222d62
+    'mount_default_fields': [None, None, 'auto', 'defaults,nofail', '0', '2'],
222d62
+    'ssh_deletekeys': False,
222d62
+    'ssh_genkeytypes': [],
222d62
+    'syslog_fix_perms': [],
222d62
     'system_info': {
222d62
         'paths': {
222d62
             'cloud_dir': '/var/lib/cloud',
222d62
             'templates_dir': '/etc/cloud/templates/',
222d62
         },
222d62
-        'distro': 'ubuntu',
222d62
+        'distro': 'rhel',
222d62
         'network': {'renderers': None},
222d62
     },
222d62
     'vendor_data': {'enabled': True, 'prefix': []},
222d62
diff --git a/rhel/README.rhel b/rhel/README.rhel
222d62
new file mode 100644
9dab26
index 0000000..aa29630
222d62
--- /dev/null
222d62
+++ b/rhel/README.rhel
222d62
@@ -0,0 +1,5 @@
222d62
+The following cloud-init modules are currently unsupported on this OS:
222d62
+ - apt_update_upgrade ('apt_update', 'apt_upgrade', 'apt_mirror', 'apt_preserve_sources_list', 'apt_old_mirror', 'apt_sources', 'debconf_selections', 'packages' options)
222d62
+ - byobu ('byobu_by_default' option)
222d62
+ - chef
222d62
+ - grub_dpkg
222d62
diff --git a/rhel/cloud-init-tmpfiles.conf b/rhel/cloud-init-tmpfiles.conf
222d62
new file mode 100644
9dab26
index 0000000..0c6d2a3
222d62
--- /dev/null
222d62
+++ b/rhel/cloud-init-tmpfiles.conf
222d62
@@ -0,0 +1 @@
222d62
+d /run/cloud-init 0700 root root - -
222d62
diff --git a/rhel/cloud.cfg b/rhel/cloud.cfg
222d62
new file mode 100644
9dab26
index 0000000..82e8bf6
222d62
--- /dev/null
222d62
+++ b/rhel/cloud.cfg
0a07cd
@@ -0,0 +1,69 @@
222d62
+users:
222d62
+ - default
222d62
+
222d62
+disable_root: 1
222d62
+ssh_pwauth:   0
222d62
+
0a07cd
+mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service', '0', '2']
222d62
+resize_rootfs_tmp: /dev
222d62
+ssh_deletekeys:   0
222d62
+ssh_genkeytypes:  ~
222d62
+syslog_fix_perms: ~
0a07cd
+disable_vmware_customization: false
222d62
+
222d62
+cloud_init_modules:
0a07cd
+ - disk_setup
222d62
+ - migrator
222d62
+ - bootcmd
222d62
+ - write-files
222d62
+ - growpart
222d62
+ - resizefs
222d62
+ - set_hostname
222d62
+ - update_hostname
222d62
+ - update_etc_hosts
222d62
+ - rsyslog
222d62
+ - users-groups
222d62
+ - ssh
222d62
+
222d62
+cloud_config_modules:
222d62
+ - mounts
222d62
+ - locale
222d62
+ - set-passwords
222d62
+ - rh_subscription
222d62
+ - yum-add-repo
222d62
+ - package-update-upgrade-install
222d62
+ - timezone
222d62
+ - puppet
222d62
+ - chef
222d62
+ - salt-minion
222d62
+ - mcollective
222d62
+ - disable-ec2-metadata
222d62
+ - runcmd
222d62
+
222d62
+cloud_final_modules:
222d62
+ - rightscale_userdata
222d62
+ - scripts-per-once
222d62
+ - scripts-per-boot
222d62
+ - scripts-per-instance
222d62
+ - scripts-user
222d62
+ - ssh-authkey-fingerprints
222d62
+ - keys-to-console
222d62
+ - phone-home
222d62
+ - final-message
0a07cd
+ - power-state-change
222d62
+
222d62
+system_info:
222d62
+  default_user:
222d62
+    name: cloud-user
222d62
+    lock_passwd: true
222d62
+    gecos: Cloud User
9dab26
+    groups: [adm, systemd-journal]
222d62
+    sudo: ["ALL=(ALL) NOPASSWD:ALL"]
222d62
+    shell: /bin/bash
222d62
+  distro: rhel
222d62
+  paths:
222d62
+    cloud_dir: /var/lib/cloud
222d62
+    templates_dir: /etc/cloud/templates
222d62
+  ssh_svcname: sshd
222d62
+
222d62
+# vim:syntax=yaml
222d62
diff --git a/rhel/systemd/cloud-config.service b/rhel/systemd/cloud-config.service
222d62
new file mode 100644
9dab26
index 0000000..f3dcd4b
222d62
--- /dev/null
222d62
+++ b/rhel/systemd/cloud-config.service
222d62
@@ -0,0 +1,18 @@
222d62
+[Unit]
222d62
+Description=Apply the settings specified in cloud-config
222d62
+After=network-online.target cloud-config.target
222d62
+Wants=network-online.target cloud-config.target
222d62
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
222d62
+ConditionKernelCommandLine=!cloud-init=disabled
222d62
+
222d62
+[Service]
222d62
+Type=oneshot
222d62
+ExecStart=/usr/bin/cloud-init modules --mode=config
222d62
+RemainAfterExit=yes
222d62
+TimeoutSec=0
222d62
+
222d62
+# Output needs to appear in instance console output
222d62
+StandardOutput=journal+console
222d62
+
222d62
+[Install]
9dab26
+WantedBy=cloud-init.target
222d62
diff --git a/rhel/systemd/cloud-config.target b/rhel/systemd/cloud-config.target
222d62
new file mode 100644
9dab26
index 0000000..ae9b7d0
222d62
--- /dev/null
222d62
+++ b/rhel/systemd/cloud-config.target
222d62
@@ -0,0 +1,11 @@
222d62
+# cloud-init normally emits a "cloud-config" upstart event to inform third
222d62
+# parties that cloud-config is available, which does us no good when we're
222d62
+# using systemd.  cloud-config.target serves as this synchronization point
222d62
+# instead.  Services that would "start on cloud-config" with upstart can
222d62
+# instead use "After=cloud-config.target" and "Wants=cloud-config.target"
222d62
+# as appropriate.
222d62
+
222d62
+[Unit]
222d62
+Description=Cloud-config availability
222d62
+Wants=cloud-init-local.service cloud-init.service
222d62
+After=cloud-init-local.service cloud-init.service
222d62
diff --git a/rhel/systemd/cloud-final.service b/rhel/systemd/cloud-final.service
222d62
new file mode 100644
9dab26
index 0000000..739b7e3
222d62
--- /dev/null
222d62
+++ b/rhel/systemd/cloud-final.service
222d62
@@ -0,0 +1,19 @@
222d62
+[Unit]
222d62
+Description=Execute cloud user/final scripts
222d62
+After=network-online.target cloud-config.service rc-local.service
222d62
+Wants=network-online.target cloud-config.service
222d62
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
222d62
+ConditionKernelCommandLine=!cloud-init=disabled
222d62
+
222d62
+[Service]
222d62
+Type=oneshot
222d62
+ExecStart=/usr/bin/cloud-init modules --mode=final
222d62
+RemainAfterExit=yes
222d62
+TimeoutSec=0
222d62
+KillMode=process
222d62
+
222d62
+# Output needs to appear in instance console output
222d62
+StandardOutput=journal+console
222d62
+
222d62
+[Install]
9dab26
+WantedBy=cloud-init.target
222d62
diff --git a/rhel/systemd/cloud-init-local.service b/rhel/systemd/cloud-init-local.service
222d62
new file mode 100644
9dab26
index 0000000..8f9f6c9
222d62
--- /dev/null
222d62
+++ b/rhel/systemd/cloud-init-local.service
222d62
@@ -0,0 +1,31 @@
222d62
+[Unit]
222d62
+Description=Initial cloud-init job (pre-networking)
222d62
+DefaultDependencies=no
222d62
+Wants=network-pre.target
222d62
+After=systemd-remount-fs.service
222d62
+Requires=dbus.socket
222d62
+After=dbus.socket
222d62
+Before=NetworkManager.service network.service
222d62
+Before=network-pre.target
222d62
+Before=shutdown.target
222d62
+Before=firewalld.target
222d62
+Conflicts=shutdown.target
222d62
+RequiresMountsFor=/var/lib/cloud
222d62
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
222d62
+ConditionKernelCommandLine=!cloud-init=disabled
222d62
+
222d62
+[Service]
222d62
+Type=oneshot
222d62
+ExecStartPre=/bin/mkdir -p /run/cloud-init
222d62
+ExecStartPre=/sbin/restorecon /run/cloud-init
222d62
+ExecStartPre=/usr/bin/touch /run/cloud-init/enabled
222d62
+ExecStart=/usr/bin/cloud-init init --local
222d62
+ExecStart=/bin/touch /run/cloud-init/network-config-ready
222d62
+RemainAfterExit=yes
222d62
+TimeoutSec=0
222d62
+
222d62
+# Output needs to appear in instance console output
222d62
+StandardOutput=journal+console
222d62
+
222d62
+[Install]
9dab26
+WantedBy=cloud-init.target
222d62
diff --git a/rhel/systemd/cloud-init.service b/rhel/systemd/cloud-init.service
222d62
new file mode 100644
9dab26
index 0000000..d0023a0
222d62
--- /dev/null
222d62
+++ b/rhel/systemd/cloud-init.service
222d62
@@ -0,0 +1,25 @@
222d62
+[Unit]
222d62
+Description=Initial cloud-init job (metadata service crawler)
222d62
+Wants=cloud-init-local.service
222d62
+Wants=sshd-keygen.service
222d62
+Wants=sshd.service
222d62
+After=cloud-init-local.service
222d62
+After=NetworkManager.service network.service
222d62
+Before=network-online.target
222d62
+Before=sshd-keygen.service
222d62
+Before=sshd.service
222d62
+Before=systemd-user-sessions.service
222d62
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
222d62
+ConditionKernelCommandLine=!cloud-init=disabled
222d62
+
222d62
+[Service]
222d62
+Type=oneshot
222d62
+ExecStart=/usr/bin/cloud-init init
222d62
+RemainAfterExit=yes
222d62
+TimeoutSec=0
222d62
+
222d62
+# Output needs to appear in instance console output
222d62
+StandardOutput=journal+console
222d62
+
222d62
+[Install]
9dab26
+WantedBy=cloud-init.target
9dab26
diff --git a/rhel/systemd/cloud-init.target b/rhel/systemd/cloud-init.target
9dab26
new file mode 100644
9dab26
index 0000000..083c3b6
9dab26
--- /dev/null
9dab26
+++ b/rhel/systemd/cloud-init.target
9dab26
@@ -0,0 +1,7 @@
9dab26
+# cloud-init target is enabled by cloud-init-generator
9dab26
+# To disable it you can either:
9dab26
+#  a.) boot with kernel cmdline of 'cloud-init=disabled'
9dab26
+#  b.) touch a file /etc/cloud/cloud-init.disabled
9dab26
+[Unit]
9dab26
+Description=Cloud-init target
9dab26
+After=multi-user.target
222d62
diff --git a/setup.py b/setup.py
9dab26
index 01a67b9..b2ac9bb 100755
222d62
--- a/setup.py
222d62
+++ b/setup.py
9dab26
@@ -139,14 +139,6 @@ INITSYS_FILES = {
222d62
     'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)],
222d62
     'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)],
222d62
     'sysvinit_suse': [f for f in glob('sysvinit/suse/*') if is_f(f)],
222d62
-    'systemd': [render_tmpl(f)
222d62
-                for f in (glob('systemd/*.tmpl') +
222d62
-                          glob('systemd/*.service') +
9dab26
-                          glob('systemd/*.target'))
9dab26
-                if (is_f(f) and not is_generator(f))],
9dab26
-    'systemd.generators': [
9dab26
-        render_tmpl(f, mode=0o755)
9dab26
-        for f in glob('systemd/*') if is_f(f) and is_generator(f)],
222d62
     'upstart': [f for f in glob('upstart/*') if is_f(f)],
222d62
 }
222d62
 INITSYS_ROOTS = {
9dab26
@@ -155,9 +147,6 @@ INITSYS_ROOTS = {
222d62
     'sysvinit_deb': 'etc/init.d',
222d62
     'sysvinit_openrc': 'etc/init.d',
222d62
     'sysvinit_suse': 'etc/init.d',
222d62
-    'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'),
222d62
-    'systemd.generators': pkg_config_read('systemd',
222d62
-                                          'systemdsystemgeneratordir'),
222d62
     'upstart': 'etc/init/',
222d62
 }
222d62
 INITSYS_TYPES = sorted([f.partition(".")[0] for f in INITSYS_ROOTS.keys()])
9dab26
@@ -208,47 +197,6 @@ class MyEggInfo(egg_info):
222d62
         return ret
222d62
 
222d62
 
222d62
-# TODO: Is there a better way to do this??
222d62
-class InitsysInstallData(install):
222d62
-    init_system = None
222d62
-    user_options = install.user_options + [
222d62
-        # This will magically show up in member variable 'init_sys'
222d62
-        ('init-system=', None,
222d62
-         ('init system(s) to configure (%s) [default: None]' %
222d62
-          (", ".join(INITSYS_TYPES)))),
222d62
-    ]
222d62
-
222d62
-    def initialize_options(self):
222d62
-        install.initialize_options(self)
222d62
-        self.init_system = ""
222d62
-
222d62
-    def finalize_options(self):
222d62
-        install.finalize_options(self)
222d62
-
222d62
-        if self.init_system and isinstance(self.init_system, str):
222d62
-            self.init_system = self.init_system.split(",")
222d62
-
222d62
-        if len(self.init_system) == 0:
222d62
-            self.init_system = ['systemd']
222d62
-
222d62
-        bad = [f for f in self.init_system if f not in INITSYS_TYPES]
222d62
-        if len(bad) != 0:
222d62
-            raise DistutilsArgError(
222d62
-                "Invalid --init-system: %s" % (','.join(bad)))
222d62
-
222d62
-        for system in self.init_system:
222d62
-            # add data files for anything that starts with '<system>.'
222d62
-            datakeys = [k for k in INITSYS_ROOTS
222d62
-                        if k.partition(".")[0] == system]
222d62
-            for k in datakeys:
222d62
-                if not INITSYS_FILES[k]:
222d62
-                    continue
222d62
-                self.distribution.data_files.append(
222d62
-                    (INITSYS_ROOTS[k], INITSYS_FILES[k]))
222d62
-        # Force that command to reinitalize (with new file list)
222d62
-        self.distribution.reinitialize_command('install_data', True)
222d62
-
222d62
-
222d62
 if not in_virtualenv():
222d62
     USR = "/" + USR
222d62
     ETC = "/" + ETC
9dab26
@@ -258,14 +206,11 @@ if not in_virtualenv():
9dab26
         INITSYS_ROOTS[k] = "/" + INITSYS_ROOTS[k]
222d62
 
222d62
 data_files = [
222d62
-    (ETC + '/cloud', [render_tmpl("config/cloud.cfg.tmpl")]),
9dab26
+    (ETC + '/bash_completion.d', ['bash_completion/cloud-init']),
222d62
     (ETC + '/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
222d62
     (ETC + '/cloud/templates', glob('templates/*')),
222d62
-    (USR_LIB_EXEC + '/cloud-init', ['tools/ds-identify',
222d62
-                                    'tools/uncloud-init',
222d62
+    (USR_LIB_EXEC + '/cloud-init', ['tools/uncloud-init',
222d62
                                     'tools/write-ssh-key-fingerprints']),
9dab26
-    (USR + '/share/bash-completion/completions',
9dab26
-     ['bash_completion/cloud-init']),
222d62
     (USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]),
222d62
     (USR + '/share/doc/cloud-init/examples',
9dab26
         [f for f in glob('doc/examples/*') if is_f(f)]),
9dab26
@@ -276,15 +221,8 @@ if os.uname()[0] != 'FreeBSD':
222d62
     data_files.extend([
222d62
         (ETC + '/NetworkManager/dispatcher.d/',
222d62
          ['tools/hook-network-manager']),
222d62
-        (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']),
222d62
-        (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')])
222d62
+        ('/usr/lib/udev/rules.d', [f for f in glob('udev/*.rules')])
222d62
     ])
222d62
-# Use a subclass for install that handles
222d62
-# adding on the right init system configuration files
222d62
-cmdclass = {
222d62
-    'install': InitsysInstallData,
222d62
-    'egg_info': MyEggInfo,
222d62
-}
222d62
 
222d62
 requirements = read_requires()
222d62
 
9dab26
@@ -299,8 +237,6 @@ setuptools.setup(
222d62
     scripts=['tools/cloud-init-per'],
222d62
     license='Dual-licensed under GPLv3 or Apache 2.0',
222d62
     data_files=data_files,
222d62
-    install_requires=requirements,
222d62
-    cmdclass=cmdclass,
222d62
     entry_points={
222d62
         'console_scripts': [
0a07cd
             'cloud-init = cloudinit.cmd.main:main',
222d62
diff --git a/tools/read-version b/tools/read-version
9dab26
index 6dca659..d43cc8f 100755
222d62
--- a/tools/read-version
222d62
+++ b/tools/read-version
9dab26
@@ -65,32 +65,8 @@ output_json = '--json' in sys.argv
222d62
 src_version = ci_version.version_string()
222d62
 version_long = None
222d62
 
222d62
-if is_gitdir(_tdir) and which("git"):
222d62
-    flags = []
222d62
-    if use_tags:
222d62
-        flags = ['--tags']
222d62
-    cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags
222d62
-
9dab26
-    try:
9dab26
-        version = tiny_p(cmd).strip()
9dab26
-    except RuntimeError:
9dab26
-        version = None
222d62
-
9dab26
-    if version is None or not version.startswith(src_version):
222d62
-        sys.stderr.write("git describe version (%s) differs from "
222d62
-                         "cloudinit.version (%s)\n" % (version, src_version))
0a07cd
-        sys.stderr.write(
0a07cd
-            "Please get the latest upstream tags.\n"
0a07cd
-            "As an example, this can be done with the following:\n"
0a07cd
-            "$ git remote add upstream https://git.launchpad.net/cloud-init\n"
0a07cd
-            "$ git fetch upstream --tags\n"
0a07cd
-        )
222d62
-        sys.exit(1)
222d62
-
222d62
-    version_long = tiny_p(cmd + ["--long"]).strip()
222d62
-else:
222d62
-    version = src_version
222d62
-    version_long = None
222d62
+version = src_version
222d62
+version_long = None
222d62
 
222d62
 # version is X.Y.Z[+xxx.gHASH]
222d62
 # version_long is None or X.Y.Z-xxx-gHASH
222d62
-- 
9dab26
1.8.3.1
222d62