mirror of https://github.com/ceph/ceph-ansible.git
Merge pull request #1613 from ceph/wip-takeover
Fixes to take-over-existing-cluster playbookpull/1616/head
commit
cc7f9e874a
|
@ -28,20 +28,30 @@
|
|||
|
||||
- name: get the name of the existing ceph cluster
|
||||
shell: |
|
||||
basename $(grep -R fsid /etc/ceph/ | egrep -o '^[^.]*')
|
||||
basename $(grep --exclude '*.bak' -R fsid /etc/ceph/ | egrep -o '^[^.]*')
|
||||
changed_when: false
|
||||
register: ceph_conf
|
||||
register: cluster_name
|
||||
|
||||
- name: stat ceph.conf
|
||||
- name: "stat {{ cluster_name.stdout }}.conf"
|
||||
stat:
|
||||
path: "{{ ceph_conf.stdout }}"
|
||||
path: "/etc/ceph/{{ cluster_name.stdout }}.conf"
|
||||
register: ceph_conf_stat
|
||||
|
||||
# Creates a backup of original ceph conf file in 'cluster_name-YYYYMMDDTHHMMSS.conf.bak' format
|
||||
- name: "make a backup of original {{ cluster_name.stdout }}.conf"
|
||||
copy:
|
||||
src: "/etc/ceph/{{ cluster_name.stdout }}.conf"
|
||||
dest: "/etc/ceph/{{ cluster_name.stdout }}-{{ ansible_date_time.iso8601_basic_short }}.conf.bak"
|
||||
remote_src: true
|
||||
owner: "{{ ceph_conf_stat.stat.pw_name }}"
|
||||
group: "{{ ceph_conf_stat.stat.gr_name }}"
|
||||
mode: "{{ ceph_conf_stat.stat.mode }}"
|
||||
|
||||
- name: generate ceph configuration file
|
||||
action: config_template
|
||||
args:
|
||||
src: "roles/ceph-common/templates/ceph.conf.j2"
|
||||
dest: "{{ ceph_conf.stdout }}"
|
||||
dest: "/etc/ceph/{{ cluster_name.stdout }}.conf"
|
||||
owner: "{{ ceph_conf_stat.stat.pw_name }}"
|
||||
group: "{{ ceph_conf_stat.stat.gr_name }}"
|
||||
mode: "{{ ceph_conf_stat.stat.mode }}"
|
||||
|
|
Loading…
Reference in New Issue