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
|
2016-03-03 00:29:57 +08:00
|
|
|
#
|
|
|
|
# To point to a specific role, ie: ceph-mon just run with "-e roles=ceph-mon"
|
|
|
|
#
|
2015-02-24 01:25:37 +08:00
|
|
|
|
|
|
|
- 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:
|
2016-03-03 01:44:36 +08:00
|
|
|
- ceph-common
|
2015-02-24 01:25:37 +08:00
|
|
|
- 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
|
2016-02-16 00:11:03 +08:00
|
|
|
- ceph-agent
|
2016-02-19 01:07:43 +08:00
|
|
|
- ceph-fetch-keys
|
2016-04-08 18:30:14 +08:00
|
|
|
- ceph-rbd-mirror
|
2016-01-23 00:43:47 +08:00
|
|
|
basedir: "{{ lookup('pipe', 'git rev-parse --show-toplevel') }}"
|
2015-02-24 01:25:37 +08:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: check for github prefix option on commandline
|
|
|
|
tags: split
|
2016-01-23 00:43:47 +08:00
|
|
|
fail:
|
|
|
|
msg: 'github prefix missing! e.g: (--extra-vars github=ceph/ansible).'
|
2015-02-24 01:25:37 +08:00
|
|
|
when: github == False
|
|
|
|
|
2016-05-09 15:12:01 +08:00
|
|
|
- name: split the repo in separate branches
|
2015-02-24 01:25:37 +08:00
|
|
|
tags: split
|
2016-01-23 00:43:47 +08:00
|
|
|
command: git subtree split --prefix=roles/{{ item }} -b {{ item }} --squash
|
|
|
|
args:
|
|
|
|
chdir: "{{ basedir }}"
|
2016-03-03 01:44:36 +08:00
|
|
|
with_items: roles
|
2015-02-24 01:25:37 +08:00
|
|
|
|
|
|
|
- name: adds remote github repos for the splits
|
|
|
|
tags: split
|
2016-01-23 00:43:47 +08:00
|
|
|
command: git remote add {{ item }} git@github.com:{{ github }}-{{ item }}.git
|
|
|
|
args:
|
|
|
|
chdir: "{{ basedir }}"
|
2016-03-03 01:44:36 +08:00
|
|
|
with_items: roles
|
2015-02-24 01:25:37 +08:00
|
|
|
|
|
|
|
- name: adds upstream remote
|
|
|
|
tags: update
|
2016-01-23 00:43:47 +08:00
|
|
|
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
|
2016-01-23 00:43:47 +08:00
|
|
|
command: git pull upstream master:master
|
2015-02-24 01:25:37 +08:00
|
|
|
|
|
|
|
- name: update the split repos from master
|
|
|
|
tags: update
|
2016-01-23 00:43:47 +08:00
|
|
|
shell: git push {{ item }} $(git subtree split --prefix roles/{{ item }} master):master --force
|
|
|
|
args:
|
|
|
|
chdir: "{{ basedir }}"
|
2015-02-24 01:25:37 +08:00
|
|
|
with_items: roles
|