sailesh1993 / rpms / cloud-init

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