@@ -0,0 +1,1587 @@
+#!/usr/bin/python%0A%0Aimport os%0Afrom subprocess import call%0A%0Agithub_root = %22/home/arothste/git/github/andrewrothstein%22%0Aansible_playbooks_dir = github_root + %22/ansible-mesosphere-lab%22%0Aansible_playbooks_roles_dir = ansible_playbooks_dir + %22/roles%22%0A%0Aaddl_files_path = github_root + %22/ansible-julia%22%0Aaddl_files_to_copy = %5B%22LICENSE%22, %22README.md%22, %22.gitignore%22, %22test.yml%22, %22meta/main.yml%22%5D%0A%0Adef create_git_repo(role) :%0A  print %22creating repo for role %22 + role%0A  github_repos_dir = %22/home/arothste/git/github-target%22%0A  src_role_path = ansible_playbooks_roles_dir + %22/%22 + role%0A  target_role_name = %22ansible-mesosphere-%22 + role%0A  target_role_path = github_repos_dir + %22/%22 + target_role_name%0A  if (not os.path.isdir(target_role_path)):%0A    print(%22copying role files from %7B0%7D to %7B1%7D...%22.format(src_role_path, target_role_path))%0A    call(%5B'cp', '-R', src_role_path, target_role_path%5D)%0A    call(%5B'mkdir', '-p', target_role_path + %22/meta%22%5D)%0A    for f in addl_files_to_copy :%0A      call(%5B'cp', addl_files_path + '/' + f, target_role_path%5D)%0A%0A    target_role_path_git_dir = target_role_path + %22/.git%22%0A    if (not os.path.isdir(target_role_path_git_dir)):%0A      print(%22initializing git in %7B0%7D...%22.format(target_role_path))%0A      os.chdir(target_role_path)%0A      call(%5B'git', 'init'%5D)%0A      call(%5B'git', 'add', '.'%5D)%0A      call(%5B'git', 'commit', '-m', 'initial commit'%5D)%0A      call(%5B'hub', 'create', target_role_name%5D)%0A      call(%5B'git', 'push', 'origin', 'master'%5D)%0A%0Aroles = filter(lambda x : not os.path.isdir(x), os.listdir(ansible_playbooks_roles_dir))%0Amap(create_git_repo, roles)%0Aprint(%22roles:%22, roles)%0A

add a python script to split the roles into separate github repos