<s> import os <EOL> from fabric . api import * <EOL> from fabric . contrib . files import sed <EOL> """<STR_LIT>""" <EOL> env . user = '<STR_LIT:root>' <EOL> env . password = '<STR_LIT>' <EOL> env . hosts = [ '<STR_LIT>' ] <EOL> env . new_user_full_name = '<STR_LIT>' <EOL> env . new_user = '<STR_LIT>' <EOL> env . new_user_grp = '<STR_LIT>' <EOL> env . ssh_key_dir = '<STR_LIT>' <EOL> """<STR_LIT>""" <EOL> def bootstrap ( ) : <EOL> env . ssh_key_filepath = os . path . join ( env . ssh_key_dir , env . host_string + "<STR_LIT>" ) <EOL> local ( '<STR_LIT>' . format ( env . ssh_key_filepath ) ) <EOL> local ( '<STR_LIT>' . format ( env . ssh_key_filepath + "<STR_LIT>" , env . ssh_key_dir ) ) <EOL> sed ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> sed ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> sed ( '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> _create_privileged_group ( ) <EOL> _create_privileged_user ( ) <EOL> _upload_keys ( env . new_user ) <EOL> run ( '<STR_LIT>' ) <EOL> def _create_privileged_group ( ) : <EOL> run ( '<STR_LIT>' + env . new_user_grp ) <EOL> run ( '<STR_LIT>' ) <EOL> run ( '<STR_LIT>' + env . new_user_grp + '<STR_LIT>' ) <EOL> run ( '<STR_LIT>' ) <EOL> def _create_privileged_user ( ) : <EOL> run ( '<STR_LIT>' % ( env . new_user_full_name , env . new_user_grp , env . new_user ) ) <EOL> run ( '<STR_LIT>' % env . new_user ) <EOL> run ( '<STR_LIT>' + env . new_user_grp + '<STR_LIT:U+0020>' + env . new_user ) <EOL> run ( '<STR_LIT>' % env . new_user ) <EOL> run ( '<STR_LIT>' % ( env . new_user , <EOL> env . new_user ) ) <EOL> run ( '<STR_LIT>' % ( env . new_user_grp , <EOL> env . new_user ) ) <EOL> def _upload_keys ( username ) : <EOL> scp_command = "<STR_LIT>" . format ( <EOL> env . ssh_key_filepath + "<STR_LIT>" , <EOL> env . ssh_key_dir , <EOL> username , <EOL> env . host_string <EOL> ) <EOL> local ( scp_command ) </s>
