#NEWLINE# def provision( self ) : #NEWLINE# #INDENT# "\n        Installs `MySQL <http://www.mysql.com/>`_ Server and its dependencies.\n        This method should be called upon if overriden in base classes, or MySQL won't work properly in the remote server.\n\n        Example:\n        ::\n\n            class MySampleRole(Role):\n                def provision(self):\n                    self.provision_role(MySQLRole) # no need to call this if using with block.\n        " #NEWLINE# with self . using ( YumRole ) as role : #NEWLINE# #INDENT# role . ensure_up_to_date ( ) #NEWLINE# result = role . ensure_package_installed ( 'mysql-server' ) #NEWLINE# role . ensure_package_installed ( 'mysql-devel' ) #NEWLINE# role . ensure_package_installed ( 'mysql-libs' ) #NEWLINE# if result : #NEWLINE# #INDENT# self . log ( ( 'setting root user %s password...' % self . mysql_root_user ) ) #NEWLINE# self . execute ( ( "mysqladmin -u %s -p'temppass' password '%s'" % ( self . mysql_root_user , self . mysql_root_pass ) ) , stdout = False , sudo = True )