from .interface import TerraformInterface
-__version__ = '1.5.8'
+__version__ = '1.6.0'
LOG = logging.getLogger(__name__)
re_key_puppet_tier = re.compile(r'^\s*puppet[_-]?tier\s*$', re.IGNORECASE)
re_key_puppet_env = re.compile(r'^\s*puppet[_-]?env(?:ironment)?\s*$', re.IGNORECASE)
re_key_puppet_role = re.compile(r'^\s*puppet[_-]?role\s*$', re.IGNORECASE)
+ re_key_puppet_initial_install = re.compile(
+ r'^\s*puppet[_-]?initial[_-]?install\s*$', re.IGNORECASE)
re_key_env = re.compile(r'^\s*env(?:ironment)?\s*$', re.IGNORECASE)
+ re_key_initial_install = re.compile(r'^\s*initial[_-]?install\s*$', re.IGNORECASE)
re_key_ns = re.compile(r'^\s*nameservers?\s*$', re.IGNORECASE)
re_key_searchdomain = re.compile(r'^\s*search[_-]*domains?\s*$', re.IGNORECASE)
re_key_dnsoptions = re.compile(r'^\s*(dns|resolv)[_-]*options?\s*$', re.IGNORECASE)
cluster=None, boot_delay=None, ds_cluster=None, datastore=None, ds_type=None,
customer=None, rootdisk_size=None, purpose=None, puppet_contact=None, puppet_role=None,
puppet_customer=None, puppet_project=None, puppet_tier=None, puppet_env=None,
- vm_template=None, nameservers=None, searchdomains=None, dns_options=None,
- has_backup=True, has_puppet=True, already_existing=None, vsphere=None):
+ puppet_initial_install=False, vm_template=None, nameservers=None, searchdomains=None,
+ dns_options=None, has_backup=True, has_puppet=True, already_existing=None,
+ vsphere=None):
self._vsphere = self.default_vsphere
self._is_template = bool(is_template)
self._puppet_tier = self.default_puppet_tier
self._puppet_env = None
self._puppet_role = self.default_puppet_role
+ self._puppet_initial_install = bool(puppet_initial_install)
self._vm_template = None
self._has_backup = bool(has_backup)
self._has_puppet = bool(has_puppet)
name=name, fqdn=fqdn, num_cpus=num_cpus, memory=memory, folder=folder,
boot_delay=boot_delay, vm_template=vm_template, puppet_contact=puppet_contact,
puppet_customer=puppet_customer, puppet_tier=puppet_tier, puppet_env=puppet_env,
+ puppet_initial_install=puppet_initial_install,
cluster=cluster, rootdisk_size=rootdisk_size, nameservers=nameservers,
searchdomains=searchdomains, dns_options=dns_options, purpose=purpose,
customer=customer, ds_cluster=ds_cluster, datastore=datastore, ds_type=ds_type,
vm.puppet_role = val_stripped
return True
+ if cls.re_key_puppet_initial_install.search(key) and val_stripped:
+ vm.puppet_initial_install = val_stripped
+ return True
+
if cls.re_key_puppet_tier.search(key) and val_stripped:
if cls.re_invalid_chars.search(val_stripped):
LOG.error(_("Invalid puppet tier {!r}.").format(value))
vm.puppet_role = p_value_stripped
return
+ if cls.re_key_initial_install.search(key) and val_stripped:
+ vm.puppet_initial_install = val_stripped
+ return True
+
if p_key.lower() == 'tier' and p_value_stripped:
if cls.re_invalid_chars.search(p_value_stripped):
LOG.error(_("Invalid puppet tier {!r}.").format(p_value))
searchdomains=self.searchdomains, dns_options=self.dns_options,
rootdisk_size=self.rootdisk_size, has_backup=self.has_backup,
has_puppet=self.has_puppet, puppet_project=self.puppet_project,
- vsphere=self.vsphere,
+ puppet_initial_install=self.puppet_initial_install, vsphere=self.vsphere,
)
vm.disks = copy.copy(self.disks)
def is_template(self, value):
self._is_template = bool(value)
+ # -----------------------------------------------------------
+ @property
+ def puppet_initial_install(self):
+ """Set the initial_install flag for Puppet."""
+ return self._puppet_initial_install
+
+ @puppet_initial_install.setter
+ def puppet_initial_install(self, value):
+ self._puppet_initial_install = to_bool(value)
+
# -----------------------------------------------------------
@property
def has_backup(self):
res['puppet_environment'] = self.puppet_environment
res['puppet_role'] = self.puppet_role
res['puppet_tier'] = self.puppet_tier
+ res['puppet_initial_install'] = self.puppet_initial_install
res['purpose'] = self.purpose
res['rootdisk_size'] = self.rootdisk_size
res['tf_name'] = self.tf_name