sailesh1993 / rpms / cloud-init

Forked from rpms/cloud-init a year ago
Clone
20a859
From 0efc7b53fd849b1faea9fca1ecc85dfe384de035 Mon Sep 17 00:00:00 2001
20a859
From: Lars Kellogg-Stedman <lars@redhat.com>
20a859
Date: Thu, 1 Dec 2016 19:40:36 -0500
20a859
Subject: [PATCH] configuration changes for RHEL package
20a859
20a859
remove python dependencies from setup.py (because we handle these via
20a859
packages instead) and make any changes to default values to handle
20a859
RHEL environments.
20a859
20a859
install README and configfiles for rhel.
20a859
20a859
X-downstream-only: true
20a859
---
20a859
 cloudinit/config/cc_chef.py   |  6 ++--
20a859
 cloudinit/settings.py         |  7 +++--
20a859
 rhel/README.rhel              |  5 ++++
20a859
 rhel/cloud-init-tmpfiles.conf |  1 +
20a859
 rhel/cloud.cfg                | 66 +++++++++++++++++++++++++++++++++++++++++++
20a859
 setup.py                      |  4 +--
20a859
 6 files changed, 81 insertions(+), 8 deletions(-)
20a859
 create mode 100644 rhel/README.rhel
20a859
 create mode 100644 rhel/cloud-init-tmpfiles.conf
20a859
 create mode 100644 rhel/cloud.cfg
20a859
20a859
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
20a859
index f6564e5..38f01b7 100644
20a859
--- a/cloudinit/config/cc_chef.py
20a859
+++ b/cloudinit/config/cc_chef.py
20a859
@@ -33,7 +33,7 @@ file).
20a859
 
20a859
     chef:
20a859
        directories: (defaulting to /etc/chef, /var/log/chef, /var/lib/chef,
20a859
-                     /var/cache/chef, /var/backups/chef, /var/run/chef)
20a859
+                     /var/cache/chef, /var/backups/chef, /run/chef)
20a859
        validation_cert: (optional string to be written to file validation_key)
20a859
                         special value 'system' means set use existing file
20a859
        validation_key: (optional the path for validation_cert. default
20a859
@@ -85,7 +85,7 @@ CHEF_DIRS = tuple([
20a859
     '/var/lib/chef',
20a859
     '/var/cache/chef',
20a859
     '/var/backups/chef',
20a859
-    '/var/run/chef',
20a859
+    '/run/chef',
20a859
 ])
20a859
 REQUIRED_CHEF_DIRS = tuple([
20a859
     '/etc/chef',
20a859
@@ -109,7 +109,7 @@ CHEF_RB_TPL_DEFAULTS = {
20a859
     'json_attribs': CHEF_FB_PATH,
20a859
     'file_cache_path': "/var/cache/chef",
20a859
     'file_backup_path': "/var/backups/chef",
20a859
-    'pid_file': "/var/run/chef/client.pid",
20a859
+    'pid_file': "/run/chef/client.pid",
20a859
     'show_time': True,
20a859
 }
20a859
 CHEF_RB_TPL_BOOL_KEYS = frozenset(['show_time'])
20a859
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
20a859
index b1fdd31..6d31bb6 100644
20a859
--- a/cloudinit/settings.py
20a859
+++ b/cloudinit/settings.py
20a859
@@ -37,13 +37,16 @@ CFG_BUILTIN = {
20a859
     ],
20a859
     'def_log_file': '/var/log/cloud-init.log',
20a859
     'log_cfgs': [],
20a859
-    'syslog_fix_perms': ['syslog:adm', 'root:adm'],
20a859
+    'mount_default_fields': [None, None, 'auto', 'defaults,nofail', '0', '2'],
20a859
+    'ssh_deletekeys': False,
20a859
+    'ssh_genkeytypes': [],
20a859
+    'syslog_fix_perms': [],
20a859
     'system_info': {
20a859
         'paths': {
20a859
             'cloud_dir': '/var/lib/cloud',
20a859
             'templates_dir': '/etc/cloud/templates/',
20a859
         },
20a859
-        'distro': 'ubuntu',
20a859
+        'distro': 'rhel',
20a859
     },
20a859
     'vendor_data': {'enabled': True, 'prefix': []},
20a859
 }
20a859
diff --git a/rhel/README.rhel b/rhel/README.rhel
20a859
new file mode 100644
20a859
index 0000000..aa29630
20a859
--- /dev/null
20a859
+++ b/rhel/README.rhel
20a859
@@ -0,0 +1,5 @@
20a859
+The following cloud-init modules are currently unsupported on this OS:
20a859
+ - apt_update_upgrade ('apt_update', 'apt_upgrade', 'apt_mirror', 'apt_preserve_sources_list', 'apt_old_mirror', 'apt_sources', 'debconf_selections', 'packages' options)
20a859
+ - byobu ('byobu_by_default' option)
20a859
+ - chef
20a859
+ - grub_dpkg
20a859
diff --git a/rhel/cloud-init-tmpfiles.conf b/rhel/cloud-init-tmpfiles.conf
20a859
new file mode 100644
20a859
index 0000000..0c6d2a3
20a859
--- /dev/null
20a859
+++ b/rhel/cloud-init-tmpfiles.conf
20a859
@@ -0,0 +1 @@
20a859
+d /run/cloud-init 0700 root root - -
20a859
diff --git a/rhel/cloud.cfg b/rhel/cloud.cfg
20a859
new file mode 100644
20a859
index 0000000..986f241
20a859
--- /dev/null
20a859
+++ b/rhel/cloud.cfg
20a859
@@ -0,0 +1,66 @@
20a859
+users:
20a859
+ - default
20a859
+
20a859
+disable_root: 1
20a859
+ssh_pwauth:   0
20a859
+
20a859
+mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2']
20a859
+resize_rootfs_tmp: /dev
20a859
+ssh_deletekeys:   0
20a859
+ssh_genkeytypes:  ~
20a859
+syslog_fix_perms: ~
20a859
+
20a859
+cloud_init_modules:
20a859
+ - migrator
20a859
+ - bootcmd
20a859
+ - write-files
20a859
+ - growpart
20a859
+ - resizefs
20a859
+ - set_hostname
20a859
+ - update_hostname
20a859
+ - update_etc_hosts
20a859
+ - rsyslog
20a859
+ - users-groups
20a859
+ - ssh
20a859
+
20a859
+cloud_config_modules:
20a859
+ - mounts
20a859
+ - locale
20a859
+ - set-passwords
20a859
+ - rh_subscription
20a859
+ - yum-add-repo
20a859
+ - package-update-upgrade-install
20a859
+ - timezone
20a859
+ - puppet
20a859
+ - chef
20a859
+ - salt-minion
20a859
+ - mcollective
20a859
+ - disable-ec2-metadata
20a859
+ - runcmd
20a859
+
20a859
+cloud_final_modules:
20a859
+ - rightscale_userdata
20a859
+ - scripts-per-once
20a859
+ - scripts-per-boot
20a859
+ - scripts-per-instance
20a859
+ - scripts-user
20a859
+ - ssh-authkey-fingerprints
20a859
+ - keys-to-console
20a859
+ - phone-home
20a859
+ - final-message
20a859
+
20a859
+system_info:
20a859
+  default_user:
20a859
+    name: cloud-user
20a859
+    lock_passwd: true
20a859
+    gecos: Cloud User
20a859
+    groups: [wheel, adm, systemd-journal]
20a859
+    sudo: ["ALL=(ALL) NOPASSWD:ALL"]
20a859
+    shell: /bin/bash
20a859
+  distro: rhel
20a859
+  paths:
20a859
+    cloud_dir: /var/lib/cloud
20a859
+    templates_dir: /etc/cloud/templates
20a859
+  ssh_svcname: sshd
20a859
+
20a859
+# vim:syntax=yaml
20a859
diff --git a/setup.py b/setup.py
20a859
index 0403607..cc20c60 100755
20a859
--- a/setup.py
20a859
+++ b/setup.py
20a859
@@ -167,7 +167,6 @@ else:
20a859
         (ETC + '/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
20a859
         (ETC + '/cloud/templates', glob('templates/*')),
20a859
         (ETC + '/NetworkManager/dispatcher.d/', ['tools/hook-network-manager']),
20a859
-        (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']),
20a859
         (USR_LIB_EXEC + '/cloud-init', ['tools/uncloud-init',
20a859
                                         'tools/write-ssh-key-fingerprints']),
20a859
         (USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]),
20a859
@@ -175,7 +174,7 @@ else:
20a859
             [f for f in glob('doc/examples/*') if is_f(f)]),
20a859
         (USR + '/share/doc/cloud-init/examples/seed',
20a859
             [f for f in glob('doc/examples/seed/*') if is_f(f)]),
20a859
-        (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')]),
20a859
+        ('/usr/lib/udev/rules.d', [f for f in glob('udev/*.rules')]),
20a859
     ]
20a859
     # Use a subclass for install that handles
20a859
     # adding on the right init system configuration files
20a859
@@ -199,7 +198,6 @@ setuptools.setup(
20a859
     scripts=['tools/cloud-init-per'],
20a859
     license='Dual-licensed under GPLv3 or Apache 2.0',
20a859
     data_files=data_files,
20a859
-    install_requires=requirements,
20a859
     cmdclass=cmdclass,
20a859
     entry_points={
20a859
         'console_scripts': [