2015-02-24 01:25:37 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
# This repice can be used to split this repo and keep the part updated!
|
|
|
|
# Use it like this:
|
|
|
|
#
|
|
|
|
# ansible-playbook -i dummy-ansible-hosts contrib/splitup.yml \
|
|
|
|
# --tags split --extra-vars github=mhubig/ansible
|
|
|
|
#
|
|
|
|
# ansible-playbook -i dummy-ansible-hosts contrib/splitup.yml \
|
|
|
|
# --tags update --extra-vars github=mhubig/ansible
|
|
|
|
|
|
|
|
- name: This recipe split the roles into repos and keeps them updated.
|
|
|
|
hosts: localhost
|
|
|
|
connection: local
|
|
|
|
gather_facts: False
|
|
|
|
|
|
|
|
vars:
|
2015-07-25 00:14:59 +08:00
|
|
|
github: ceph/ansible
|
2015-02-24 01:25:37 +08:00
|
|
|
roles:
|
|
|
|
- ceph-common
|
|
|
|
- ceph-mon
|
|
|
|
- ceph-osd
|
|
|
|
- ceph-mds
|
2015-07-25 00:14:59 +08:00
|
|
|
- ceph-rgw
|
2015-07-25 01:13:14 +08:00
|
|
|
- ceph-restapi
|
2015-02-24 01:25:37 +08:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: check for github prefix option on commandline
|
|
|
|
tags: split
|
|
|
|
fail: >
|
2015-07-25 00:14:59 +08:00
|
|
|
msg='github prefix missing! e.g: (--extra-vars github=ceph/ansible).'
|
2015-02-24 01:25:37 +08:00
|
|
|
when: github == False
|
|
|
|
|
|
|
|
- name: split the repo in seperate branches
|
|
|
|
tags: split
|
|
|
|
command: >
|
|
|
|
git subtree split --prefix=roles/{{ item }} -b {{ item }} --squash
|
|
|
|
chdir=../
|
|
|
|
with_items: roles
|
|
|
|
|
|
|
|
- name: adds remote github repos for the splits
|
|
|
|
tags: split
|
|
|
|
command: >
|
|
|
|
git remote add {{ item }} git@github.com:{{ github }}-{{ item }}.git
|
|
|
|
chdir=../
|
|
|
|
with_items: roles
|
|
|
|
|
|
|
|
- name: adds upstream remote
|
|
|
|
tags: update
|
|
|
|
command: >
|
|
|
|
git remote add upstream git@github.com:ceph/ceph-ansible.git
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-02-24 01:25:37 +08:00
|
|
|
|
|
|
|
- name: pulles the newest changes from upstream
|
|
|
|
tags: update
|
|
|
|
command: >
|
|
|
|
git pull upstream master:master
|
|
|
|
|
|
|
|
- name: update the split repos from master
|
|
|
|
tags: update
|
2015-07-25 01:13:14 +08:00
|
|
|
shell: >
|
|
|
|
git push {{ item }} $(git subtree split --prefix roles/{{ item }} master):master --force
|
2015-02-24 01:25:37 +08:00
|
|
|
chdir=../
|
|
|
|
with_items: roles
|