#NEWLINE# def setup_salt( ) : #NEWLINE# #INDENT# '\n    Setup the salt configuration files and enable dameon on a reboot.\n    ' #NEWLINE# server = [ s for s in env . bootmachine_servers if ( s . public_ip == env . host ) ] [ 0 ] #NEWLINE# if ( env . host == env . master_server . public_ip ) : #NEWLINE# #INDENT# append ( '/etc/salt/master' , 'file_roots:\n  base:\n    - {0}' . format ( settings . REMOTE_STATES_DIR ) ) #NEWLINE# append ( '/etc/salt/master' , 'pillar_roots:\n  base:\n    - {0}' . format ( settings . REMOTE_PILLARS_DIR ) ) #NEWLINE# run ( 'systemctl enable salt-master.service' ) #NEWLINE# #UNINDENT# sed ( '/etc/salt/minion' , '#master: salt' , 'master: {0}' . format ( env . master_server . private_ip ) ) #NEWLINE# sed ( '/etc/salt/minion' , '#id:' , 'id: {0}' . format ( server . name ) ) #NEWLINE# append ( '/etc/salt/minion' , 'grains:\n  roles:' ) #NEWLINE# for role in server . roles : #NEWLINE# #INDENT# append ( '/etc/salt/minion' , '    - {0}' . format ( role ) ) #NEWLINE# #UNINDENT# run ( 'systemctl enable salt-minion.service' ) #NEWLINE# run ( 'iptables -F' )