#NEWLINE# def install( ) : #NEWLINE# #INDENT# already_installed = package . is_installed ( 'nginx' ) #NEWLINE# if ( server . version == '10.04' ) : #NEWLINE# #INDENT# package . install_ppa ( 'nginx/stable' ) #NEWLINE# #UNINDENT# package . install ( 'nginx' ) #NEWLINE# if ( not already_installed ) : #NEWLINE# #INDENT# site_disable ( 'default' ) #NEWLINE# #UNINDENT# www_dir = '/var/www' #NEWLINE# www_owner = 'www-data' #NEWLINE# if ( not dir . exists ( www_dir ) ) : #NEWLINE# #INDENT# with ctx . sudo ( ) : #NEWLINE# #INDENT# dir . create ( www_dir ) #NEWLINE# dir . attributes ( www_dir , owner = www_owner , group = www_owner ) #NEWLINE# #UNINDENT# #UNINDENT# restart ( )