mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Disabling managing firewall - cloudstack-setup-management (#4239)
* Adding message to ensure ports are open * Removing configuring iptables * Fixing merge conflict
This commit is contained in:
parent
c06e7ded3c
commit
ead9a34b3d
@ -45,13 +45,14 @@ if __name__ == '__main__':
|
|||||||
try:
|
try:
|
||||||
syscfg = sysConfigFactory.getSysConfigFactory(glbEnv)
|
syscfg = sysConfigFactory.getSysConfigFactory(glbEnv)
|
||||||
except UnknownSystemException:
|
except UnknownSystemException:
|
||||||
print(("Error: CloudStack failed to detect your "
|
print("Error: CloudStack failed to detect your "
|
||||||
"operating system. Exiting."), file=sys.stderr)
|
"operating system. Exiting.", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
try:
|
try:
|
||||||
syscfg.registerService(cloudManagementConfig)
|
syscfg.registerService(cloudManagementConfig)
|
||||||
syscfg.config()
|
syscfg.config()
|
||||||
print("CloudStack Management Server setup is Done!")
|
print("CloudStack Management Server setup is Done!")
|
||||||
|
print("Please ensure the following ports are open for the management server to function properly : 8080 8250 8443 9090")
|
||||||
except (CloudRuntimeException, CloudInternalException) as e:
|
except (CloudRuntimeException, CloudInternalException) as e:
|
||||||
print(e)
|
print(e)
|
||||||
print("Try to restore your system:")
|
print("Try to restore your system:")
|
||||||
|
|||||||
@ -775,32 +775,3 @@ class cloudAgentConfig(serviceCfgBase):
|
|||||||
|
|
||||||
def restore(self):
|
def restore(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class firewallConfigServer(firewallConfigBase):
|
|
||||||
def __init__(self, syscfg):
|
|
||||||
super(firewallConfigServer, self).__init__(syscfg)
|
|
||||||
#9090 is used for cluster management server
|
|
||||||
if self.syscfg.env.svrMode == "myCloud":
|
|
||||||
self.ports = "443 8080 8250 8443 9090".split()
|
|
||||||
else:
|
|
||||||
self.ports = "8080 8250 9090".split()
|
|
||||||
|
|
||||||
class ubuntuFirewallConfigServer(firewallConfigServer):
|
|
||||||
def allowPort(self, port):
|
|
||||||
status = False
|
|
||||||
try:
|
|
||||||
status = bash("iptables-save|grep INPUT|grep -w %s"%port).isSuccess()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if not status:
|
|
||||||
bash("ufw allow %s/tcp"%port)
|
|
||||||
|
|
||||||
def config(self):
|
|
||||||
try:
|
|
||||||
for port in self.ports:
|
|
||||||
self.allowPort(port)
|
|
||||||
|
|
||||||
return True
|
|
||||||
except:
|
|
||||||
raise
|
|
||||||
|
|||||||
@ -224,10 +224,10 @@ class sysConfigServerRedhat(sysConfigServer):
|
|||||||
def __init__(self, glbEnv):
|
def __init__(self, glbEnv):
|
||||||
super(sysConfigServerRedhat, self).__init__(glbEnv)
|
super(sysConfigServerRedhat, self).__init__(glbEnv)
|
||||||
self.svo = serviceOpsRedhat()
|
self.svo = serviceOpsRedhat()
|
||||||
self.services = [firewallConfigServer(self)]
|
self.services = []
|
||||||
|
|
||||||
class sysConfigServerUbuntu(sysConfigServer):
|
class sysConfigServerUbuntu(sysConfigServer):
|
||||||
def __init__(self, glbEnv):
|
def __init__(self, glbEnv):
|
||||||
super(sysConfigServerUbuntu, self).__init__(glbEnv)
|
super(sysConfigServerUbuntu, self).__init__(glbEnv)
|
||||||
self.svo = serviceOpsUbuntu()
|
self.svo = serviceOpsUbuntu()
|
||||||
self.services = [ubuntuFirewallConfigServer(self)]
|
self.services = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user