Ansible looks a suitable tool to automate initial OS setup Please try to rewrite installation scripts using ansible