def __provider_name(self): name = self.options.get(_provider_name, None) if _provider_config and not name: name = self.get_config(_provider, required=False) if not name: name = Config.string("ZIMAGI_{}".format(_provider.upper()), _default) return name
def exec(self): self.manager.start_service(self, 'zimagi-postgres', "postgres:12", { 5432: None }, environment = { 'POSTGRES_USER': Config.string('ZIMAGI_POSTGRES_USER', 'zimagi'), 'POSTGRES_PASSWORD': Config.string('ZIMAGI_POSTGRES_PASSWORD', 'zimagi'), 'POSTGRES_DB': Config.string('ZIMAGI_POSTGRES_DB', 'zimagi') }, volumes = { 'zimagi-postgres': { 'bind': '/var/lib/postgresql', 'mode': 'rw' } }, memory = self.memory, wait = 20 ) self.success('Successfully started PostgreSQL database service')
def exec(self): self.manager.start_service( self, 'zimagi-redis', "redis:5", {6379: None}, docker_command="redis-server --requirepass {}".format( Config.string('ZIMAGI_REDIS_PASSWORD', 'zimagi')), volumes={'zimagi-redis': { 'bind': '/data', 'mode': 'rw' }}, memory=self.memory, wait=20) self.set_state('config_ensure', True) self.success('Successfully started Redis service')