exclude modules fix 1
This commit is contained in:
parent
721ba62bf3
commit
9d3990ee82
@ -40,8 +40,7 @@ def handle(_name, cfg, cloud, log, _args):
|
|||||||
See doc/examples/cloud-config_disk-setup.txt for documentation on the
|
See doc/examples/cloud-config_disk-setup.txt for documentation on the
|
||||||
format.
|
format.
|
||||||
"""
|
"""
|
||||||
if cloud.is_excluded(_name):
|
|
||||||
return
|
|
||||||
disk_setup = cfg.get("disk_setup")
|
disk_setup = cfg.get("disk_setup")
|
||||||
if isinstance(disk_setup, dict):
|
if isinstance(disk_setup, dict):
|
||||||
update_disk_setup_devices(disk_setup, cloud.device_name_to_device)
|
update_disk_setup_devices(disk_setup, cloud.device_name_to_device)
|
||||||
|
@ -213,8 +213,7 @@ def resize_devices(resizer, devices):
|
|||||||
|
|
||||||
|
|
||||||
def handle(_name, cfg, _cloud, log, _args):
|
def handle(_name, cfg, _cloud, log, _args):
|
||||||
if _cloud.is_excluded(_name):
|
|
||||||
return
|
|
||||||
if 'growpart' not in cfg:
|
if 'growpart' not in cfg:
|
||||||
log.debug("No 'growpart' entry in cfg. Using default: %s" %
|
log.debug("No 'growpart' entry in cfg. Using default: %s" %
|
||||||
DEFAULT_CONFIG)
|
DEFAULT_CONFIG)
|
||||||
|
@ -49,8 +49,7 @@ def _autostart_puppet(log):
|
|||||||
|
|
||||||
|
|
||||||
def handle(name, cfg, cloud, log, _args):
|
def handle(name, cfg, cloud, log, _args):
|
||||||
if cloud.is_excluded(name):
|
|
||||||
return
|
|
||||||
# If there isn't a puppet key in the configuration don't do anything
|
# If there isn't a puppet key in the configuration don't do anything
|
||||||
if 'puppet' not in cfg:
|
if 'puppet' not in cfg:
|
||||||
log.debug(("Skipping module named %s,"
|
log.debug(("Skipping module named %s,"
|
||||||
|
@ -39,8 +39,7 @@ def _decode(data, encoding=None):
|
|||||||
|
|
||||||
|
|
||||||
def handle(name, cfg, cloud, log, _args):
|
def handle(name, cfg, cloud, log, _args):
|
||||||
if cloud.is_excluded(name):
|
|
||||||
return
|
|
||||||
if not cfg or "random_seed" not in cfg:
|
if not cfg or "random_seed" not in cfg:
|
||||||
log.debug(("Skipping module named %s, "
|
log.debug(("Skipping module named %s, "
|
||||||
"no 'random_seed' configuration found"), name)
|
"no 'random_seed' configuration found"), name)
|
||||||
|
@ -22,8 +22,7 @@ from cloudinit import util
|
|||||||
|
|
||||||
|
|
||||||
def handle(name, cfg, cloud, log, _args):
|
def handle(name, cfg, cloud, log, _args):
|
||||||
if cloud.is_excluded(name):
|
|
||||||
return
|
|
||||||
if util.get_cfg_option_bool(cfg, "preserve_hostname", False):
|
if util.get_cfg_option_bool(cfg, "preserve_hostname", False):
|
||||||
log.debug(("Configuration option 'preserve_hostname' is set,"
|
log.debug(("Configuration option 'preserve_hostname' is set,"
|
||||||
" not setting the hostname in module %s"), name)
|
" not setting the hostname in module %s"), name)
|
||||||
|
@ -36,8 +36,7 @@ PW_SET = (letters.translate(None, 'loLOI') +
|
|||||||
|
|
||||||
|
|
||||||
def handle(_name, cfg, cloud, log, args):
|
def handle(_name, cfg, cloud, log, args):
|
||||||
if cloud.is_excluded(_name):
|
|
||||||
return
|
|
||||||
if len(args) != 0:
|
if len(args) != 0:
|
||||||
# if run from command line, and give args, wipe the chpasswd['list']
|
# if run from command line, and give args, wipe the chpasswd['list']
|
||||||
password = args[0]
|
password = args[0]
|
||||||
|
@ -56,8 +56,7 @@ KEY_FILE_TPL = '/etc/ssh/ssh_host_%s_key'
|
|||||||
|
|
||||||
|
|
||||||
def handle(_name, cfg, cloud, log, _args):
|
def handle(_name, cfg, cloud, log, _args):
|
||||||
if cloud.is_excluded(_name):
|
|
||||||
return
|
|
||||||
# remove the static keys from the pristine image
|
# remove the static keys from the pristine image
|
||||||
if cfg.get("ssh_deletekeys", True):
|
if cfg.get("ssh_deletekeys", True):
|
||||||
key_pth = os.path.join("/etc/ssh/", "ssh_host_*key*")
|
key_pth = os.path.join("/etc/ssh/", "ssh_host_*key*")
|
||||||
|
@ -92,8 +92,7 @@ def _pprint_key_entries(user, key_fn, key_entries, hash_meth='md5',
|
|||||||
|
|
||||||
|
|
||||||
def handle(name, cfg, cloud, log, _args):
|
def handle(name, cfg, cloud, log, _args):
|
||||||
if cloud.is_excluded(name):
|
|
||||||
return
|
|
||||||
if 'no_ssh_fingerprints' in cfg:
|
if 'no_ssh_fingerprints' in cfg:
|
||||||
log.debug(("Skipping module named %s, "
|
log.debug(("Skipping module named %s, "
|
||||||
"logging of ssh fingerprints disabled"), name)
|
"logging of ssh fingerprints disabled"), name)
|
||||||
|
@ -32,8 +32,7 @@ distros = ['ubuntu']
|
|||||||
|
|
||||||
|
|
||||||
def handle(_name, cfg, cloud, log, args):
|
def handle(_name, cfg, cloud, log, args):
|
||||||
if cloud.is_excluded(_name):
|
|
||||||
return
|
|
||||||
# import for "user: XXXXX"
|
# import for "user: XXXXX"
|
||||||
if len(args) != 0:
|
if len(args) != 0:
|
||||||
user = args[0]
|
user = args[0]
|
||||||
|
@ -26,8 +26,7 @@ frequency = PER_INSTANCE
|
|||||||
|
|
||||||
|
|
||||||
def handle(name, cfg, cloud, log, args):
|
def handle(name, cfg, cloud, log, args):
|
||||||
if cloud.is_excluded(name):
|
|
||||||
return
|
|
||||||
if len(args) != 0:
|
if len(args) != 0:
|
||||||
timezone = args[0]
|
timezone = args[0]
|
||||||
else:
|
else:
|
||||||
|
@ -27,8 +27,7 @@ frequency = PER_ALWAYS
|
|||||||
|
|
||||||
|
|
||||||
def handle(name, cfg, cloud, log, _args):
|
def handle(name, cfg, cloud, log, _args):
|
||||||
if cloud.is_excluded(name):
|
|
||||||
return
|
|
||||||
manage_hosts = util.get_cfg_option_str(cfg, "manage_etc_hosts", False)
|
manage_hosts = util.get_cfg_option_str(cfg, "manage_etc_hosts", False)
|
||||||
if util.translate_bool(manage_hosts, addons=['template']):
|
if util.translate_bool(manage_hosts, addons=['template']):
|
||||||
(hostname, fqdn) = util.get_hostname_fqdn(cfg, cloud)
|
(hostname, fqdn) = util.get_hostname_fqdn(cfg, cloud)
|
||||||
|
@ -27,8 +27,7 @@ frequency = PER_ALWAYS
|
|||||||
|
|
||||||
|
|
||||||
def handle(name, cfg, cloud, log, _args):
|
def handle(name, cfg, cloud, log, _args):
|
||||||
if cloud.is_excluded(name):
|
|
||||||
return
|
|
||||||
if util.get_cfg_option_bool(cfg, "preserve_hostname", False):
|
if util.get_cfg_option_bool(cfg, "preserve_hostname", False):
|
||||||
log.debug(("Configuration option 'preserve_hostname' is set,"
|
log.debug(("Configuration option 'preserve_hostname' is set,"
|
||||||
" not updating the hostname in module %s"), name)
|
" not updating the hostname in module %s"), name)
|
||||||
|
@ -27,8 +27,7 @@ frequency = PER_INSTANCE
|
|||||||
|
|
||||||
|
|
||||||
def handle(name, cfg, cloud, _log, _args):
|
def handle(name, cfg, cloud, _log, _args):
|
||||||
if cloud.is_excluded(name):
|
|
||||||
return
|
|
||||||
(users, groups) = ds.normalize_users_groups(cfg, cloud.distro)
|
(users, groups) = ds.normalize_users_groups(cfg, cloud.distro)
|
||||||
for (name, members) in groups.items():
|
for (name, members) in groups.items():
|
||||||
cloud.distro.create_group(name, members)
|
cloud.distro.create_group(name, members)
|
||||||
|
@ -62,7 +62,7 @@ class Distro(object):
|
|||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def is_excluded(self, name):
|
def is_excluded(self, name):
|
||||||
if name in self.excluded_modules:
|
if name in self.exclude_modules:
|
||||||
distro = getattr(self, name, None) or getattr(self, 'osfamily')
|
distro = getattr(self, name, None) or getattr(self, 'osfamily')
|
||||||
LOG.debug(("Skipping module named %s, distro excluded"), name,
|
LOG.debug(("Skipping module named %s, distro excluded"), name,
|
||||||
distro)
|
distro)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user