sailesh1993 / rpms / cloud-init

Forked from rpms/cloud-init a year ago
Clone
ea00c4
From 25ea7a28d69518319ae1ed1b3cd510147868fd29 Mon Sep 17 00:00:00 2001
ea00c4
From: Eduardo Otubo <otubo@redhat.com>
ea00c4
Date: Mon, 5 Oct 2020 13:49:36 +0200
c1c26e
Subject: Add initial redhat setup
c1c26e
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 +
ea00c4
 cloudinit/config/cc_chef.py           |  67 ++++-
c1c26e
 cloudinit/settings.py                 |   7 +-
c1c26e
 redhat/.gitignore                     |   1 +
ea00c4
 redhat/Makefile                       |  71 +++++
16d12a
 redhat/Makefile.common                |  37 +++
c1c26e
 redhat/cloud-init-tmpfiles.conf       |   1 +
ea00c4
 redhat/cloud-init.spec.template       | 517 ++++++++++++++++++++++++++++++++++
16d12a
 redhat/gating.yaml                    |   9 +
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 +
ea00c4
 redhat/scripts/frh.py                 |  27 ++
ea00c4
 redhat/scripts/git-backport-diff      | 327 +++++++++++++++++++++
ea00c4
 redhat/scripts/git-compile-check      | 215 ++++++++++++++
ea00c4
 redhat/scripts/process-patches.sh     |  77 +++++
c1c26e
 redhat/scripts/tarball_checksum.sh    |   3 +
c1c26e
 rhel/README.rhel                      |   5 +
c1c26e
 rhel/cloud-init-tmpfiles.conf         |   1 +
ea00c4
 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 ++
ea00c4
 rhel/systemd/cloud-init-local.service |  31 ++
c1c26e
 rhel/systemd/cloud-init.service       |  25 ++
16d12a
 rhel/systemd/cloud-init.target        |   7 +
ea00c4
 setup.py                              |  23 +-
ea00c4
 tools/read-version                    |  28 +-
ea00c4
 30 files changed, 1562 insertions(+), 50 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
ea00c4
index aaf7136..97ef649 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
ea00c4
@@ -31,7 +94,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
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
16d12a
index ca4ffa8..3a04a58 100644
c1c26e
--- a/cloudinit/settings.py
c1c26e
+++ b/cloudinit/settings.py
16d12a
@@ -46,13 +46,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
16d12a
index 0000000..aa29630
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
16d12a
index 0000000..0c6d2a3
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
16d12a
index 0000000..82e8bf6
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
16d12a
index 0000000..f3dcd4b
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
16d12a
index 0000000..ae9b7d0
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
16d12a
index 0000000..739b7e3
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]
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
16d12a
index 0000000..8f9f6c9
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
16d12a
index 0000000..d0023a0
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
16d12a
index 0000000..083c3b6
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
ea00c4
index cbacf48..d5cd01a 100755
c1c26e
--- a/setup.py
c1c26e
+++ b/setup.py
ea00c4
@@ -125,14 +125,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') +
16d12a
-                          glob('systemd/*.target'))
16d12a
-                if (is_f(f) and not is_generator(f))],
16d12a
-    'systemd.generators': [
16d12a
-        render_tmpl(f, mode=0o755)
16d12a
-        for f in glob('systemd/*') if is_f(f) and is_generator(f)],
c1c26e
     'upstart': [f for f in glob('upstart/*') if is_f(f)],
c1c26e
 }
c1c26e
 INITSYS_ROOTS = {
ea00c4
@@ -142,9 +134,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()])
ea00c4
@@ -245,14 +234,11 @@ if not in_virtualenv():
16d12a
         INITSYS_ROOTS[k] = "/" + INITSYS_ROOTS[k]
c1c26e
 
c1c26e
 data_files = [
c1c26e
-    (ETC + '/cloud', [render_tmpl("config/cloud.cfg.tmpl")]),
16d12a
+    (ETC + '/bash_completion.d', ['bash_completion/cloud-init']),
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']),
16d12a
-    (USR + '/share/bash-completion/completions',
16d12a
-     ['bash_completion/cloud-init']),
c1c26e
     (USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]),
c1c26e
     (USR + '/share/doc/cloud-init/examples',
16d12a
         [f for f in glob('doc/examples/*') if is_f(f)]),
ea00c4
@@ -263,8 +249,7 @@ if not platform.system().endswith('BSD'):
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
     ])
ea00c4
 # Use a subclass for install that handles
ea00c4
 # adding on the right init system configuration files
ea00c4
@@ -286,8 +271,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
ea00c4
index 02c9064..79755f7 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
-- 
16d12a
1.8.3.1
c1c26e