opts.ipolicy_std_specs is not None or
opts.ipolicy_disk_templates is not None or
opts.ipolicy_vcpu_ratio is not None or
- opts.ipolicy_spindle_ratio is not None):
+ opts.ipolicy_spindle_ratio is not None or
+ opts.modify_etc_hosts is not None):
ToStderr("Please give at least one of the parameters.")
return 1
ipolicy=ipolicy,
candidate_pool_size=opts.candidate_pool_size,
maintain_node_health=mnh,
+ modify_etc_hosts=opts.modify_etc_hosts,
uid_pool=uid_pool,
add_uids=add_uids,
remove_uids=remove_uids,
RESERVED_LVS_OPT, DRY_RUN_OPT, PRIORITY_OPT, PREALLOC_WIPE_DISKS_OPT,
NODE_PARAMS_OPT, USE_EXTERNAL_MIP_SCRIPT, DISK_PARAMS_OPT, HV_STATE_OPT,
DISK_STATE_OPT, SUBMIT_OPT, ENABLED_DISK_TEMPLATES_OPT,
- IPOLICY_STD_SPECS_OPT] + INSTANCE_POLICY_OPTS,
+ IPOLICY_STD_SPECS_OPT, MODIFY_ETCHOSTS_OPT] + INSTANCE_POLICY_OPTS,
"[opts...]",
"Alters the parameters of the cluster"),
"renew-crypto": (
" maintenance is not useful (still enabling it)")
self.cluster.maintain_node_health = self.op.maintain_node_health
+ if self.op.modify_etc_hosts is not None:
+ self.cluster.modify_etc_hosts = self.op.modify_etc_hosts
+
if self.op.prealloc_wipe_disks is not None:
self.cluster.prealloc_wipe_disks = self.op.prealloc_wipe_disks
ht.TMaybe(ht.TAnd(ht.TListOf(ht.TElemOf(constants.DISK_TEMPLATES)),
ht.TTrue)),
"List of enabled disk templates"),
+ ("modify_etc_hosts", None, ht.TMaybeBool,
+ "Whether the cluster can modify and keep in sync the /etc/hosts files"),
]
OP_RESULT = ht.TNone
, pBlacklistedOs
, pUseExternalMipScript
, pEnabledDiskTemplates
+ , pModifyEtcHosts
])
, ("OpClusterRedistConf", [])
, ("OpClusterActivateMasterIp", [])
, pAddUids
, pRemoveUids
, pMaintainNodeHealth
+ , pModifyEtcHosts
, pPreallocWipeDisks
, pNicParams
, pInstNics
pMaintainNodeHealth :: Field
pMaintainNodeHealth = optionalField $ booleanField "maintain_node_health"
+-- | Whether to modify and keep in sync the @/etc/hosts@ files of nodes.
+pModifyEtcHosts :: Field
+pModifyEtcHosts = optionalField $ booleanField "modify_etc_hosts"
+
-- | Whether to wipe disks before allocating them to instances.
pPreallocWipeDisks :: Field
pPreallocWipeDisks = optionalField $ booleanField "prealloc_wipe_disks"
arbitrary <*> arbitrary <*> arbitrary <*>
emptyMUD <*> emptyMUD <*> arbitrary <*>
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*>
- arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
+ arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
"OP_CLUSTER_REDIST_CONF" -> pure OpCodes.OpClusterRedistConf
"OP_CLUSTER_ACTIVATE_MASTER_IP" ->
pure OpCodes.OpClusterActivateMasterIp