]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Sweep of all sorts of things. 119/head
authorjjoos <jan@deelstra.org>
Thu, 4 Sep 2014 19:14:11 +0000 (21:14 +0200)
committerjjoos <jan@deelstra.org>
Thu, 4 Sep 2014 19:14:11 +0000 (21:14 +0200)
38 files changed:
ansible.cfg
roles/ceph-common/defaults/main.yml [deleted file]
roles/ceph-common/handlers/main.yml
roles/ceph-common/tasks/Debian.yml [deleted file]
roles/ceph-common/tasks/RedHat.yml [deleted file]
roles/ceph-common/tasks/install_on_debian.yml [new file with mode: 0644]
roles/ceph-common/tasks/install_on_redhat.yml [new file with mode: 0644]
roles/ceph-common/tasks/main.yml
roles/ceph-common/vars/main.yml
roles/ceph-mds/defaults/main.yml [deleted file]
roles/ceph-mds/tasks/main.yml
roles/ceph-mds/vars/main.yml
roles/ceph-mon/defaults/main.yml [deleted file]
roles/ceph-mon/tasks/deploy_monitors.yml [new file with mode: 0644]
roles/ceph-mon/tasks/main.yml
roles/ceph-mon/vars/main.yml
roles/ceph-osd/defaults/main.yml [deleted file]
roles/ceph-osd/tasks/activate_osds.yml [new file with mode: 0644]
roles/ceph-osd/tasks/check_devices.yml [new file with mode: 0644]
roles/ceph-osd/tasks/journal_collocation.yml
roles/ceph-osd/tasks/main.yml
roles/ceph-osd/tasks/osd_directory.yml
roles/ceph-osd/tasks/raw_journal.yml [deleted file]
roles/ceph-osd/tasks/raw_multi_journal.yml
roles/ceph-osd/vars/main.yml
roles/ceph-radosgw/defaults/main.yml [deleted file]
roles/ceph-radosgw/handlers/main.yml
roles/ceph-radosgw/tasks/Debian.yml [deleted file]
roles/ceph-radosgw/tasks/RedHat.yml [deleted file]
roles/ceph-radosgw/tasks/install_debian.yml [new file with mode: 0644]
roles/ceph-radosgw/tasks/install_redhat.yml [new file with mode: 0644]
roles/ceph-radosgw/tasks/main.yml
roles/ceph-radosgw/vars/main.yml
roles/haproxy/defaults/main.yml [deleted file]
roles/haproxy/handlers/precise.yml
roles/haproxy/tasks/precise.yml
roles/haproxy/vars/main.yml
rolling_update.yml

index 8b83ba14d40a10616d45352b9b5c6e1d072b7ff8..9a3686df565d2ef23145b908b6765c3c596b48bc 100644 (file)
@@ -1,2 +1,2 @@
 [defaults]
-ansible_managed = Ansible managed: modified on %Y-%m-%d %H:%M:%S by {uid}
+ansible_managed = Please do not change this file directly since it is managed by Ansible and will be overwritten
diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml
deleted file mode 100644 (file)
index 91e67fa..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
----
-# Variables here are applicable to the current role
-
-## Setup options
-#
-
-# ACTIVATE THE FSID VARIABLE FOR NON-VAGRANT DEPLOYMENT
-#fsid:
-
-## Packages branch
-ceph_key: https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc
-ceph_stable: true # use ceph stable branch
-ceph_stable_release: firefly # ceph stable release
-
-# This option is needed for _both_ stable and dev version, so please always fill the right version
-# # supported distros are el6, rhel6, f18, f19, opensuse12.2, sles11, centos7 (see http://ceph.com/rpm-firefly/)
-ceph_stable_redhat_distro: el7
-
-ceph_dev: false # use ceph developement branch
-ceph_dev_branch: master # developement branch you would like to use e.g: master, wip-hack
-# supported distros are centos6, centos7, fc17, fc18, fc19, fc20, fedora17, fedora18,
-# fedora19, fedora20, opensuse12, sles0. (see http://gitbuilder.ceph.com/).
-# For rhel, please pay attention to the versions: 'rhel6 3' or 'rhel 4', the fullname is _very_ important.
-ceph_dev_redhat_distro: centos7
-
-## Ceph options
-#
-cephx: true
-cephx_require_signatures: true
-cephx_cluster_require_signatures: true
-cephx_service_require_signatures: false
-disable_in_memory_logs: true
-
-## Monitor options
-#
-monitor_interface: eth1
-mon_osd_down_out_interval: 600
-mon_osd_min_down_reporters: 7 # number of OSDs per host + 1
-mon_clock_drift_allowed: .15
-mon_clock_drift_warn_backoff: 30
-mon_osd_full_ratio: .95
-mon_osd_nearfull_ratio: .85
-mon_osd_report_timeout: 300
-
-## OSD options
-#
-journal_size: 100
-pool_default_pg_num: 128
-pool_default_pgp_num: 128
-pool_default_size: 2
-pool_default_min_size: 1
-cluster_network: 192.168.42.0/24
-public_network: 192.168.42.0/24
-osd_mkfs_type: xfs
-osd_mkfs_options_xfs: -f -i size=2048
-osd_mount_options_xfs: noatime
-osd_mon_heartbeat_interval: 30
-# CRUSH
-pool_default_crush_rule: 0
-osd_crush_update_on_start: "true"
-# Object backend
-osd_objectstore: filestore
-# Performance tuning
-filestore_merge_threshold: 40
-filestore_split_multiple: 8
-osd_op_threads: 8
-filestore_op_threads: 8
-filestore_max_sync_interval: 5
-osd_max_scrubs: 1
-# Recovery tuning
-osd_recovery_max_active: 5
-osd_max_backfills: 2
-osd_recovery_op_priority: 2
-
-## MDS options
-#
-mds: true # disable mds configuration in ceph.conf
-
-# Rados Gateway options
-#
-radosgw: true # referenced in monitor role too.
-#radosgw_dns_name: your.subdomain.tld # subdomains used by radosgw. See http://ceph.com/docs/master/radosgw/config/#enabling-subdomain-s3-calls
-
-## Testing mode
-# enable this mode _only_ when you have a single node
-# if you don't want it keep the option commented
-#common_single_host_mode: true
index 7de099f7c59e0b8b079e59e800fd1d812d522b5f..43787c4611fcc7b2169aab6b70c2595268c906c0 100644 (file)
@@ -1,12 +1,11 @@
 ---
-
-- name: "update apt cache"
+- name: update apt cache
   action: apt update-cache=yes
 
-- name: "restart ceph ubuntu"
-  shell: service ceph restart ; service ceph-osd-all restart
+- name: restart ceph
+  shell: service ceph restart
   when: socket.rc == 0
 
-- name: "restart ceph debian redhat"
-  command: service ceph restart
-  when: socket.rc == 0
+- name: restart ceph-osd-all on ubuntu
+  shell: service ceph-osd-all restart
+  when: socket.rc == 0 and ansible_distribution == 'Ubuntu'
\ No newline at end of file
diff --git a/roles/ceph-common/tasks/Debian.yml b/roles/ceph-common/tasks/Debian.yml
deleted file mode 100644 (file)
index faddc60..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
----
-## Common to all the Ceph Debian nodes
-#
-
-- name: Fail on unsupported system
-  fail: msg="System not supported {{ ansible_system }}"
-  when: ansible_system not in ['Linux']
-
-- name: Fail on unsupported architecture
-  fail: msg="Architecture not supported {{ ansible_architecture }}"
-  when: ansible_architecture not in ['x86_64']
-
-- name: Fail on unsupported distribution
-  fail: msg="Distribution not supported {{ ansible_os_family }}"
-  when: ansible_os_family not in ['Debian', 'RedHat']
-
-- name: Install dependencies
-  apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600 # we update the cache just in case...
-  with_items:
-    - python-pycurl
-    - ntp
-    - hdparm
-
-- name: Install the Ceph repository stable key
-  apt_key: data="{{ lookup('file', 'cephstable.asc') }}" state=present
-  when: ceph_stable
-
-- name: Install the Ceph developement repository key
-  apt_key: data="{{ lookup('file', 'cephdev.asc') }}" state=present
-  when: ceph_dev
-
-- name: Add Ceph stable repository
-  apt_repository: repo='deb http://ceph.com/debian-{{ ceph_stable_release }}/ {{ ansible_lsb.codename }} main' state=present
-  when: ceph_stable
-
-- name: Add Ceph development repository
-  apt_repository: repo='deb http://gitbuilder.ceph.com/ceph-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/{{ ceph_dev_branch }} {{ ansible_lsb.codename }} main' state=present
-  when: ceph_dev
-
-- name: Install Ceph
-  apt: pkg={{ item }} state=latest
-  with_items:
-    - ceph
-    - ceph-common    #|
-    - ceph-fs-common #|--> yes, they are already all dependencies from 'ceph'
-    - ceph-fuse      #|--> however while proceding to rolling upgrades and the 'ceph' package upgrade
-    - ceph-mds       #|--> they don't get update so we need to force them
-    - libcephfs1     #|
-
-- name: Check for a Ceph socket
-  shell: stat /var/run/ceph/*.asok > /dev/null 2>&1
-  ignore_errors: true
-  register: socket
-
-- name: Generate Ceph configuration file
-  template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
-  notify: restart ceph ubuntu
-  when: ansible_distribution == 'Ubuntu'
-
-- name: Generate Ceph configuration file
-  template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
-  notify: restart ceph debian redhat
-  when: ansible_distribution == 'Debian' or ansible_os_family == 'RedHat'
-
-- name: Disable OSD directory parsing by updatedb
-  command: updatedb -e /var/lib/ceph
diff --git a/roles/ceph-common/tasks/RedHat.yml b/roles/ceph-common/tasks/RedHat.yml
deleted file mode 100644 (file)
index d782250..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
----
-## Common to all the Ceph RedHat nodes
-#
-
-- name: Fail on unsupported system
-  fail: msg="System not supported {{ ansible_system }}"
-  when: ansible_system not in ['Linux']
-
-- name: Fail on unsupported architecture
-  fail: msg="Architecture not supported {{ ansible_architecture }}"
-  when: ansible_architecture not in ['x86_64']
-
-- name: Fail on unsupported distribution
-  fail: msg="Distribution not supported {{ ansible_os_family }}"
-  when: ansible_os_family not in ['Debian', 'RedHat']
-
-- name: Install dependencies
-  yum: name={{ item }} state=present
-  with_items:
-    - python-pycurl
-    - ntp
-    - hdparm
-
-- name: Install the Ceph stable repository key
-  rpm_key: key={{ ceph_key }} state=present
-  when: ceph_stable
-
-- name: Install the Ceph developement repository key
-  rpm_key: key={{ ceph_key }} state=present
-  when: ceph_dev
-
-- name: Add Ceph stable repository
-  command: rpm -U http://ceph.com/rpm-{{ ceph_stable_release }}/{{ redhat_distro }}/noarch/ceph-release-1-0.el6.noarch.rpm creates=/etc/yum.repos.d/ceph.repo
-  when: ceph_stable
-
-- name: Add Ceph development repository
-  command: rpm -U http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm creates=/etc/yum.repos.d/ceph.repo
-  when: ceph_dev
-
-- name: Install Ceph
-  yum: name=ceph state=latest
-
-- name: Check for a Ceph socket
-  shell: stat /var/run/ceph/*.asok > /dev/null 2>&1
-  ignore_errors: true
-  register: socket
-
-- name: Generate Ceph configuration file
-  template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
-  notify: restart ceph debian redhat
-
-- name: Disable OSD directory parsing by updatedb
-  command: updatedb -e /var/lib/ceph
-  ignore_errors: true
diff --git a/roles/ceph-common/tasks/install_on_debian.yml b/roles/ceph-common/tasks/install_on_debian.yml
new file mode 100644 (file)
index 0000000..c9089d3
--- /dev/null
@@ -0,0 +1,47 @@
+---
+- name: Install dependencies
+  apt: > 
+    pkg={{ item }} 
+    state=present 
+    update_cache=yes 
+    cache_valid_time=3600
+  with_items:
+    - python-pycurl
+    - ntp
+    - hdparm
+
+- name: Install the Ceph repository stable key
+  apt_key: > 
+    data="{{ lookup('file', 'cephstable.asc') }}"
+    state=present
+  when: ceph_stable
+
+- name: Install the Ceph developement repository key
+  apt_key: > 
+    data="{{ lookup('file', 'cephdev.asc') }}"
+    state=present
+  when: ceph_dev
+
+- name: Add Ceph stable repository
+  apt_repository: > 
+    repo="deb http://ceph.com/debian-{{ ceph_stable_release }}/ {{ ansible_lsb.codename }} main"
+    state=present
+  when: ceph_stable
+
+- name: Add Ceph development repository
+  apt_repository: >
+    repo="deb http://gitbuilder.ceph.com/ceph-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/{{ ceph_dev_branch }} {{ ansible_lsb.codename }} main"
+    state=present
+  when: ceph_dev
+
+- name: Install Ceph
+  apt: >
+    pkg={{ item }}
+    state=latest
+  with_items:
+    - ceph
+    - ceph-common    #|
+    - ceph-fs-common #|--> yes, they are already all dependencies from 'ceph'
+    - ceph-fuse      #|--> however while proceding to rolling upgrades and the 'ceph' package upgrade
+    - ceph-mds       #|--> they don't get update so we need to force them
+    - libcephfs1     #|
diff --git a/roles/ceph-common/tasks/install_on_redhat.yml b/roles/ceph-common/tasks/install_on_redhat.yml
new file mode 100644 (file)
index 0000000..2903113
--- /dev/null
@@ -0,0 +1,35 @@
+---
+- name: Install dependencies
+  yum: > 
+    name={{ item }} 
+    state=present
+  with_items:
+    - python-pycurl
+    - ntp
+    - hdparm
+
+- name: Install the Ceph stable repository key
+  rpm_key: >
+    key={{ ceph_key }} 
+    state=present
+  when: ceph_stable
+
+- name: Install the Ceph developement repository key
+  rpm_key: >
+    key={{ ceph_key }} 
+    state=present
+  when: ceph_dev
+
+- name: Add Ceph stable repository
+  command: "rpm -U http://ceph.com/rpm-{{ ceph_stable_release }}/{{ redhat_distro }}/noarch/ceph-release-1-0.el6.noarch.rpm creates=/etc/yum.repos.d/ceph.repo"
+  when: ceph_stable
+
+- name: Add Ceph development repository
+  command: "rpm -U http://gitbuilder.ceph.com/ceph-rpm-{{ ceph_dev_redhat_distro }}-x86_64-basic/ref/{{ ceph_dev_branch }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro }}.noarch.rpm creates=/etc/yum.repos.d/ceph.repo"
+  when: ceph_dev
+
+- name: Install Ceph
+  yum: > 
+    name=ceph 
+    state=latest
+
index 602b57c69d9e0fdb02145d5c3aad6b17f823cfe8..4129bea96aa83b0896a4e963393dc428a9899872 100644 (file)
@@ -1,8 +1,36 @@
 ---
-## Check OS family
-#
+- name: Fail on unsupported system
+  fail: "msg=System not supported {{ ansible_system }}"
+  when: "ansible_system not in ['Linux']"
 
-- include: RedHat.yml
+- name: Fail on unsupported architecture
+  fail: "msg=Architecture not supported {{ ansible_architecture }}"
+  when: "ansible_architecture not in ['x86_64']"
+
+- name: Fail on unsupported distribution
+  fail: "msg=Distribution not supported {{ ansible_os_family }}"
+  when: "ansible_os_family not in ['Debian', 'RedHat']"
+
+- include: install_on_redhat.yml
   when: ansible_os_family == 'RedHat'
-- include: Debian.yml
+- include: install_on_debian.yml
   when: ansible_os_family == 'Debian'
+
+- name: Check for a Ceph socket
+  shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
+  ignore_errors: true
+  register: socket
+
+- name: Generate Ceph configuration file
+  template: >
+    src=ceph.conf.j2 
+    dest=/etc/ceph/ceph.conf 
+    owner=root 
+    group=root 
+    mode=0644
+  notify:
+    - restart ceph
+    - restart ceph-osd-all on ubuntu
+
+- name: Disable OSD directory parsing by updatedb
+  command: updatedb -e /var/lib/ceph
index d91813410431da7dadb0cdbc332581587e05c5fc..abe6f2c130a938f9f60cfbf8afe3bd45a60fad20 100644 (file)
@@ -1,3 +1,87 @@
 ---\r
-# You can override default vars defined in defaults/main.yml here,\r
-# but I would advice to use host or group vars instead \r
+# You can override vars by using host or group vars\r
+\r
+## Setup options\r
+#\r
+\r
+# ACTIVATE THE FSID VARIABLE FOR NON-VAGRANT DEPLOYMENT\r
+#fsid:\r
+\r
+## Packages branch\r
+ceph_key: https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc\r
+ceph_stable: true # use ceph stable branch\r
+ceph_stable_release: firefly # ceph stable release\r
+\r
+# This option is needed for _both_ stable and dev version, so please always fill the right version\r
+# # supported distros are el6, rhel6, f18, f19, opensuse12.2, sles11, centos7 (see http://ceph.com/rpm-firefly/)\r
+ceph_stable_redhat_distro: el7\r
+\r
+ceph_dev: false # use ceph developement branch\r
+ceph_dev_branch: master # developement branch you would like to use e.g: master, wip-hack\r
+# supported distros are centos6, centos7, fc17, fc18, fc19, fc20, fedora17, fedora18,\r
+# fedora19, fedora20, opensuse12, sles0. (see http://gitbuilder.ceph.com/).\r
+# For rhel, please pay attention to the versions: 'rhel6 3' or 'rhel 4', the fullname is _very_ important.\r
+ceph_dev_redhat_distro: centos7\r
+\r
+## Ceph options\r
+#\r
+cephx: true\r
+cephx_require_signatures: true\r
+cephx_cluster_require_signatures: true\r
+cephx_service_require_signatures: false\r
+disable_in_memory_logs: true\r
+\r
+## Monitor options\r
+#\r
+monitor_interface: eth1\r
+mon_osd_down_out_interval: 600\r
+mon_osd_min_down_reporters: 7 # number of OSDs per host + 1\r
+mon_clock_drift_allowed: .15\r
+mon_clock_drift_warn_backoff: 30\r
+mon_osd_full_ratio: .95\r
+mon_osd_nearfull_ratio: .85\r
+mon_osd_report_timeout: 300\r
+\r
+## OSD options\r
+#\r
+journal_size: 100\r
+pool_default_pg_num: 128\r
+pool_default_pgp_num: 128\r
+pool_default_size: 2\r
+pool_default_min_size: 1\r
+cluster_network: 192.168.42.0/24\r
+public_network: 192.168.42.0/24\r
+osd_mkfs_type: xfs\r
+osd_mkfs_options_xfs: -f -i size=2048\r
+osd_mount_options_xfs: noatime\r
+osd_mon_heartbeat_interval: 30\r
+# CRUSH\r
+pool_default_crush_rule: 0\r
+osd_crush_update_on_start: "true"\r
+# Object backend\r
+osd_objectstore: filestore\r
+# Performance tuning\r
+filestore_merge_threshold: 40\r
+filestore_split_multiple: 8\r
+osd_op_threads: 8\r
+filestore_op_threads: 8\r
+filestore_max_sync_interval: 5\r
+osd_max_scrubs: 1\r
+# Recovery tuning\r
+osd_recovery_max_active: 5\r
+osd_max_backfills: 2\r
+osd_recovery_op_priority: 2\r
+\r
+## MDS options\r
+#\r
+mds: true # disable mds configuration in ceph.conf\r
+\r
+# Rados Gateway options\r
+#\r
+radosgw: true # referenced in monitor role too.\r
+#radosgw_dns_name: your.subdomain.tld # subdomains used by radosgw. See http://ceph.com/docs/master/radosgw/config/#enabling-subdomain-s3-calls\r
+\r
+## Testing mode\r
+# enable this mode _only_ when you have a single node\r
+# if you don't want it keep the option commented\r
+#common_single_host_mode: true\r
diff --git a/roles/ceph-mds/defaults/main.yml b/roles/ceph-mds/defaults/main.yml
deleted file mode 100644 (file)
index 5cba76d..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
----
-# Variables here are applicable to the current role
-
-## Ceph options
-#
-cephx: true
-
index 1b08d8eb749e51db5f8b95899a7a8b994fdaed65..26cb5f279a2052194f9e9b1d215366417283d123 100644 (file)
@@ -1,13 +1,22 @@
 ---
 ## Deploy Ceph metadata server(s)
-#
 
 - name: Copy MDS bootstrap key
-  copy: src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-mds/ceph.keyring dest=/var/lib/ceph/bootstrap-mds/ceph.keyring owner=root group=root mode=600
+  copy: >
+    src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-mds/ceph.keyring 
+    dest=/var/lib/ceph/bootstrap-mds/ceph.keyring 
+    owner=root 
+    group=root 
+    mode=600
   when: cephx
 
 - name: Create MDS directory
-  action: file path=/var/lib/ceph/mds/ceph-{{ ansible_hostname }} state=directory owner=root group=root mode=0644
+  file: >
+    path=/var/lib/ceph/mds/ceph-{{ ansible_hostname }} 
+    state=directory 
+    owner=root 
+    group=root 
+    mode=0644
   when: cephx
 
 - name: Create MDS keyring
   changed_when: False
 
 - name: Set MDS key permissions
-  file: path=/var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring mode=0600 owner=root group=root
+  file: >
+    path=/var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring 
+    mode=0600 
+    owner=root 
+    group=root
   when: cephx
 
 - name: Start and add that the MDS service to the init sequence
-  service: name=ceph state=started enabled=yes args=mds
+  service: > 
+    name=ceph 
+    state=started 
+    enabled=yes 
+    args=mds
index d91813410431da7dadb0cdbc332581587e05c5fc..bd46d3bd5f09852e38d9b2743bcdf27a0cacf5bc 100644 (file)
@@ -1,3 +1,4 @@
 ---\r
-# You can override default vars defined in defaults/main.yml here,\r
-# but I would advice to use host or group vars instead \r
+# You can override vars by using host or group vars\r
+\r
+cephx: true\r
diff --git a/roles/ceph-mon/defaults/main.yml b/roles/ceph-mon/defaults/main.yml
deleted file mode 100644 (file)
index 89fde5a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
----
-# Variables here are applicable to the current role
-
-## Ceph options
-#
-
-# ACTIVATE BOTH FSID AND MONITOR_SECRET VARIABLES FOR NON-VAGRANT DEPLOYMENT
-# fsid:
-# monitor_secret:
-cephx: true
-
-# Rados Gateway options
-# referenced in common role too.
-radosgw: true
diff --git a/roles/ceph-mon/tasks/deploy_monitors.yml b/roles/ceph-mon/tasks/deploy_monitors.yml
new file mode 100644 (file)
index 0000000..54ea3ba
--- /dev/null
@@ -0,0 +1,28 @@
+---
+- name: Create monitor initial keyring
+  command: "ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} --create-keyring --name=mon. --add-key={{ monitor_secret }} --cap mon 'allow *' creates=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}"
+
+- name: Set initial monitor key permissions
+  file: >
+    path=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
+    mode=0600
+    owner=root
+    group=root
+
+- name: Create monitor directory
+  file: >
+    path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}
+    state=directory
+    owner=root
+    group=root
+    mode=0644
+
+- name: Ceph monitor mkfs
+  command: "ceph-mon --mkfs -i {{ ansible_hostname }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring"
+
+- name: Start and add that the monitor service to the init sequence
+  service: >
+    name=ceph
+    state=started
+    enabled=yes
+    args=mon
index b0b0c3e545d218389e307fa30a13dbd21ecbd578..a57746b87e4690571c6bc2950b09ae4632e98d30 100644 (file)
@@ -1,26 +1,8 @@
 ---
-## Deploy Ceph monitor(s)
-#
-
-- name: Create monitor initial keyring
-  command: ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} --create-keyring --name=mon. --add-key={{ monitor_secret }} --cap mon 'allow *' creates=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
-
-- name: Set initial monitor key permissions
-  file: path=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} mode=0600 owner=root group=root
-
-- name: Create monitor directory
-  file: path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }} state=directory owner=root group=root mode=0644
-
-- name: Ceph monitor mkfs
-  command: ceph-mon --mkfs -i {{ ansible_hostname }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring
-
-- name: Start and add that the monitor service to the init sequence
-  service: name=ceph state=started enabled=yes args=mon
+- include: deploy_monitors.yml
 
 # Wait for mon discovery and quorum resolution
 # the admin key is not instantanely created so we have to wait a bit
-#
-
 - name: If client.admin key exists
   command: stat /etc/ceph/ceph.client.admin.keyring
   register: result
   changed_when: False
 
 - name: Copy keys to the ansible server
-  fetch: src={{ item }} dest=fetch/{{ fsid }}/{{ item }} flat=yes
+  fetch: >
+    src={{ item }} 
+    dest=fetch/{{ fsid }}/{{ item }} 
+    flat=yes
   when: cephx
   with_items:
     - /etc/ceph/ceph.client.admin.keyring # just in case another application needs it
     - /etc/ceph/keyring.radosgw.gateway
 
 - name: Drop in a motd script to report status when logging in
-  copy: src=precise/92-ceph dest=/etc/update-motd.d/92-ceph owner=root group=root mode=0755
+  copy: >
+    src=precise/92-ceph 
+    dest=/etc/update-motd.d/92-ceph 
+    owner=root 
+    group=root 
+    mode=0755
   when: ansible_distribution_release == 'precise'
index d91813410431da7dadb0cdbc332581587e05c5fc..0aed6ee70900f8215aedeb4051f0cead9be73758 100644 (file)
@@ -1,3 +1,11 @@
 ---\r
-# You can override default vars defined in defaults/main.yml here,\r
-# but I would advice to use host or group vars instead \r
+# You can override vars by using host or group vars\r
+\r
+# ACTIVATE BOTH FSID AND MONITOR_SECRET VARIABLES FOR NON-VAGRANT DEPLOYMENT\r
+# fsid:\r
+# monitor_secret:\r
+cephx: true\r
+\r
+# Rados Gateway options\r
+# referenced in common role too.\r
+radosgw: true\r
diff --git a/roles/ceph-osd/defaults/main.yml b/roles/ceph-osd/defaults/main.yml
deleted file mode 100644 (file)
index 845ef22..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
----
-# Variables here are applicable to the current role
-#
-
-## Ceph options
-#
-
-# ACTIVATE THE FSID VARIABLE FOR NON-VAGRANT DEPLOYMENT
-# fsid:
-cephx: true
-
-# Devices to be used as OSDs
-# You can pre-provision disks that are not present yet.
-# Ansible will just skip them. Newly added disk will be
-# automatically configured during the next run.
-#
-
-
-# !! WARNING !!
-#
-# /!\ ENABLE ONLY ONE SCENARIO AT A TIME /!\
-#
-# !! WARNING !!
-
-
-# Declare devices
-# All the scenarii inherit from the following device declaration
-#
-devices: [ '/dev/sdb', '/dev/sdc', '/dev/sdd', '/dev/sde']
-
-
-# I. First scenario: journal and osd_data on the same device
-# Use 'true' to enable this scenario
-# This will collocate both journal and data on the same disk
-# creating a partition at the beginning of the device
-#
-journal_collocation: true
-
-
-# II. Second scenario: single journal device for N OSDs
-# Use 'true' to enable this scenario
-#
-raw_journal: false
-raw_journal_device: /dev/sdb
-
-
-# III. Third scenario: N journal devices for N OSDs
-# Use 'true' to enable this scenario
-#
-# In the following example:
-# * sdd and sde will get sdb as a journal
-# * sdf and sdg will get sdc as a journal
-# While starting you have 2 options:
-# 1. Pre-allocate all the devices
-# 2. Progressively add new devices
-
-raw_multi_journal: false
-raw_journal_devices:  [ '/dev/sdb', '/dev/sdb', '/dev/sdc', '/dev/sdc' ]
-
-
-# IV. Fourth scenario: use directory instead of disk for OSDs
-# Use 'true' to enable this scenario
-
-osd_directory: false
-osd_directories: [ '/var/lib/ceph/osd/mydir1', '/var/lib/ceph/osd/mydir2', '/var/lib/ceph/osd/mydir3', '/var/lib/ceph/osd/mydir4']
diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml
new file mode 100644 (file)
index 0000000..2d937a5
--- /dev/null
@@ -0,0 +1,38 @@
+---
+# Activate means:
+# - mount the volume in a temp location
+# - allocate an osd id (if needed)
+# - remount in the correct location /var/lib/ceph/osd/$cluster-$id
+# - start ceph-osd
+#
+
+# This task is for disk devices only because of the explicit use of the first
+# partition.
+
+- name: Activate OSD(s) when device is a disk
+  command: |
+    ceph-disk activate {{ item.2 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
+  with_together:
+    - parted.results
+    - ispartition.results
+    - devices
+  when: item.0.rc == 0 and item.1.rc != 0
+  ignore_errors: True
+  changed_when: False
+
+# This task is for partitions because we don't explicitly use a partition.
+
+- name: Activate OSD(s) when device is a partition
+  command: "ceph-disk activate {{ item.1 }}"
+  with_together:
+    - ispartition.results
+    - devices
+  when: item.0.rc == 0
+  ignore_errors: True
+  changed_when: False
+
+- name: Start and add that the OSD service to the init sequence
+  service: > 
+    name=ceph 
+    state=started 
+    enabled=yes
diff --git a/roles/ceph-osd/tasks/check_devices.yml b/roles/ceph-osd/tasks/check_devices.yml
new file mode 100644 (file)
index 0000000..ae213ae
--- /dev/null
@@ -0,0 +1,19 @@
+---
+# NOTE (leseb): current behavior of ceph-disk is to fail when the device is mounted "stderr: ceph-disk: Error: Device is mounted: /dev/sdb1"
+# the return code is 1, which makes sense, however ideally if ceph-disk will detect a ceph partition
+# it should exist we rc=0 and don't do anything unless we do something like --force
+# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "ignore_errors: True"
+# I believe it's safer
+- name: Check if the device is a partition or a disk
+  shell: "echo '{{ item }}' | egrep '/dev/(([a-z]{3,4}[0-9]$)|(cciss/c[0-9]{1}d[0-9]{1}p[0-9]$))'"
+  ignore_errors: true
+  with_items: devices
+  register: ispartition
+  changed_when: False
+
+- name: If partition named 'ceph' exists
+  shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
+  ignore_errors: True
+  with_items: devices
+  register: parted
+  changed_when: False
index 780277abf68a33e5206b6efb35ca5c478e65f284..df2b741a54a62d8c4cab77d4f88e3d42f22d305f 100644 (file)
@@ -1,39 +1,7 @@
 ---
 ## SCENARIO 1: JOURNAL AND OSD_DATA ON THE SAME DEVICE
-#
-
-- name: Install dependencies
-  apt: pkg=parted state=present
-  when: ansible_os_family == 'Debian'
-
-- name: Install dependencies
-  yum: name=parted state=present
-  when: ansible_os_family == 'RedHat'
-
-- name: Copy OSD bootstrap key
-  copy: src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring dest=/var/lib/ceph/bootstrap-osd/ceph.keyring owner=root group=root mode=600
-  when: cephx
-
-# NOTE (leseb): current behavior of ceph-disk is to fail when the device is mounted "stderr: ceph-disk: Error: Device is mounted: /dev/sdb1"
-# the return code is 1, which makes sense, however ideally if ceph-disk will detect a ceph partition
-# it should exist we rc=0 and don't do anything unless we do something like --force
-# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "ignore_errors: True"
-# I believe it's safer
-#
 
-- name: Check if the device is a partition or a disk
-  shell: echo '{{ item }}' | egrep '/dev/(([a-z]{3,4}[0-9]$)|(cciss/c[0-9]{1}d[0-9]{1}p[0-9]$))'
-  ignore_errors: true
-  with_items: devices
-  register: ispartition
-  changed_when: False
-
-- name: If partition named 'ceph' exists
-  shell: parted --script {{ item }} print | egrep -sq '^ 1.*ceph'
-  ignore_errors: True
-  with_items: devices
-  register: parted
-  changed_when: False
+- include: check_devices.yml
 
 # Prepare means
 # - create GPT partition for a disk, or a loop label for a partition
@@ -52,7 +20,7 @@
 # failed, this is why we check if the device is a partition too.
 
 - name: Prepare OSD disk(s)
-  command: ceph-disk prepare {{ item.2 }}
+  command: "ceph-disk prepare {{ item.2 }}"
   when: (item.0.rc != 0 or item.1.rc != 0) and journal_collocation
   ignore_errors: True
   with_together:
     - ispartition.results
     - devices
 
-# Activate means:
-# - mount the volume in a temp location
-# - allocate an osd id (if needed)
-# - remount in the correct location /var/lib/ceph/osd/$cluster-$id
-# - start ceph-osd
-#
-
-# This task is for disk devices only because of the explicit use of the first
-# partition.
-
-- name: Activate OSD(s) when device is a disk
-  command: ceph-disk activate {{ item.2 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
-  with_together:
-    - parted.results
-    - ispartition.results
-    - devices
-  when: item.0.rc == 0 and item.1.rc != 0
-  ignore_errors: True
-  changed_when: False
-
-# This task is for partitions because we don't explicitly use a partition.
-
-- name: Activate OSD(s) when device is a partition
-  command: ceph-disk activate {{ item.1 }}
-  with_together:
-    - ispartition.results
-    - devices
-  when: item.0.rc == 0
-  ignore_errors: True
-  changed_when: False
-
-- name: Start and add that the OSD service to the init sequence
-  service: name=ceph state=started enabled=yes
+- include: activate_osds.yml
index 1ff2a2db2db0136f13ace81b9af3906417e53d04..f9288bf6db85be2342a1d8ae5ef197088b6003f1 100644 (file)
@@ -1,13 +1,30 @@
 ---
 ## Deploy Ceph Oject Storage Daemon(s)
-#
+
+- name: Install dependencies
+  apt: >
+    pkg=parted 
+    state=present
+  when: ansible_os_family == 'Debian'
+
+- name: Install dependencies
+  yum: >
+    name=parted 
+    state=present
+  when: ansible_os_family == 'RedHat'
+
+- name: Copy OSD bootstrap key
+  copy: >
+    src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring 
+    dest=/var/lib/ceph/bootstrap-osd/ceph.keyring 
+    owner=root 
+    group=root 
+    mode=600
+  when: cephx
 
 - include: journal_collocation.yml
   when: journal_collocation
 
-- include: raw_journal.yml
-  when: raw_journal
-
 - include: raw_multi_journal.yml
   when: raw_multi_journal
 
index 75ea2813c2268366eb342ab284c6314632ae1350..3d477d3b04ebb8a73335250642f93e6dafec5817 100644 (file)
@@ -1,25 +1,16 @@
 ---
 ## SCENARIO 4: USE A DIRECTORY INSTEAD OF A DISK FOR OSD
-#
-
-- name: Install dependencies
-  apt: pkg=parted state=present
-  when: ansible_os_family == 'Debian'
-
-- name: Install dependencies
-  yum: name=parted state=present
-  when: ansible_os_family == 'RedHat'
-
-- name: Copy OSD bootstrap key
-  copy: src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring dest=/var/lib/ceph/bootstrap-osd/ceph.keyring owner=root group=root mode=600
-  when: cephx
 
 # NOTE (leseb): we do not check the filesystem underneath the directory
 # so it is really up to you to configure this properly.
 # Declaring more than one directory on the same filesystem will confuse Ceph.
 
 - name: Create OSD directories
-  file: path={{ item }} state=directory owner=root group=root
+  file: > 
+    path={{ item }} 
+    state=directory 
+    owner=root 
+    group=root
   with_items: osd_directories
 
 # Prepare means
@@ -36,7 +27,7 @@
 # since Ansible will sequential process the loop
 
 - name: Prepare OSD disk(s)
-  command: ceph-disk prepare {{ item }}
+  command: "ceph-disk prepare {{ item }}"
   when: osd_directory
   with_items: osd_directories
 
 #
 
 - name: Activate OSD(s)
-  command: ceph-disk activate {{ item }}
+  command: "ceph-disk activate {{ item }}"
   with_items: osd_directories
   changed_when: False
 
 - name: Start and add that the OSD service to the init sequence
-  service: name=ceph state=started enabled=yes
+  service: >
+    name=ceph 
+    state=started 
+    enabled=yes
diff --git a/roles/ceph-osd/tasks/raw_journal.yml b/roles/ceph-osd/tasks/raw_journal.yml
deleted file mode 100644 (file)
index 3dce90f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
----
-## SCENARIO 2: SINGLE JOURNAL DEVICE FOR N OSDS
-#
-
-- name: Install dependencies
-  apt: pkg=parted state=present
-  when: ansible_os_family == 'Debian'
-
-- name: Install dependencies
-  yum: name=parted state=present
-  when: ansible_os_family == 'RedHat'
-
-- name: Copy OSD bootstrap key
-  copy: src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring dest=/var/lib/ceph/bootstrap-osd/ceph.keyring owner=root group=root mode=600
-  when: cephx
-
-# NOTE (leseb): current behavior of ceph-disk is to fail when the device is mounted "stderr: ceph-disk: Error: Device is mounted: /dev/sdb1"
-# the return code is 1, which makes sense, however ideally if ceph-disk will detect a ceph partition
-# it should exist we rc=0 and don't do anything unless we do something like --force
-# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "ignore_errors: True"
-# I believe it's safer
-#
-
-- name: Check if the device is a partition or a disk
-  shell: echo '{{ item }}' | egrep '/dev/[a-z]{3}[0-9]$'
-  ignore_errors: true
-  with_items: devices
-  register: ispartition
-  changed_when: False
-
-- name: If partition named 'ceph' exists
-  shell: parted --script {{ item }} print | egrep -sq '^ 1.*ceph'
-  ignore_errors: True
-  with_items: devices
-  register: parted
-  changed_when: False
-
-# Prepare means
-# - create GPT partition for a disk, or a loop label for a partition
-# - mark the partition with the ceph type uuid
-# - create a file system
-# - mark the fs as ready for ceph consumption
-# - entire data disk is used (one big partition)
-# - a new partition is added to the journal disk (so it can be easily shared)
-#
-
-# NOTE (leseb): the prepare process must be parallelized somehow...
-# if you have 64 disks with 4TB each, this will take a while
-# since Ansible will sequential process the loop
-
-# NOTE (alahouze): if the device is a partition, the parted command below has
-# failed, this is why we check if the device is a partition too.
-
-- name: Prepare OSD disk(s)
-  command: ceph-disk prepare {{ item.2 }} {{ raw_journal_device }}
-  when: (item.0.rc != 0 or item.1.rc != 0) and raw_journal
-  ignore_errors: True
-  with_together:
-    - parted.results
-    - ispartition.results
-    - devices
-
-# Activate means:
-# - mount the volume in a temp location
-# - allocate an osd id (if needed)
-# - remount in the correct location /var/lib/ceph/osd/$cluster-$id
-# - start ceph-osd
-#
-
-# This task is for disk devices only because of the explicit use of the first
-# partition.
-
-- name: Activate OSD(s) when device is a disk
-  command: ceph-disk activate {{ item.2 }}1
-  with_together:
-    - parted.results
-    - ispartition.results
-    - devices
-  when: item.0.rc == 0 and item.1.rc != 0
-  ignore_errors: True
-  changed_when: False
-
-# This task is for partitions because we don't explicitly use a partition.
-
-- name: Activate OSD(s) when device is a partition
-  command: ceph-disk activate {{ item.1 }}
-  with_together:
-    - ispartition.results
-    - devices
-  when: item.0.rc == 0
-  ignore_errors: True
-  changed_when: False
-
-- name: Start and add that the OSD service to the init sequence
-  service: name=ceph state=started enabled=yes
index c54e6fd7e31a2cd86daeee481f47f4f1c05f898b..01147d63f5fbbea664e03b0ff5942194cdeff068 100644 (file)
@@ -1,39 +1,7 @@
 ---
 ## SCENARIO 3: N JOURNAL DEVICES FOR N OSDS
-#
-
-- name: Install dependencies
-  apt: pkg=parted state=present
-  when: ansible_os_family == 'Debian'
-
-- name: Install dependencies
-  yum: name=parted state=present
-  when: ansible_os_family == 'RedHat'
-
-- name: Copy OSD bootstrap key
-  copy: src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring dest=/var/lib/ceph/bootstrap-osd/ceph.keyring owner=root group=root mode=600
-  when: cephx
-
-# NOTE (leseb): current behavior of ceph-disk is to fail when the device is mounted "stderr: ceph-disk: Error: Device is mounted: /dev/sdb1"
-# the return code is 1, which makes sense, however ideally if ceph-disk will detect a ceph partition
-# it should exist we rc=0 and don't do anything unless we do something like --force
-# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "ignore_errors: True"
-# I believe it's safer
-#
 
-- name: Check if the device is a partition or a disk
-  shell: echo '{{ item }}' | egrep '/dev/[a-z]{3}[0-9]$'
-  ignore_errors: true
-  with_items: devices
-  register: ispartition
-  changed_when: False
-
-- name: If partition named 'ceph' exists
-  shell: parted --script {{ item }} print | egrep -sq '^ 1.*ceph'
-  ignore_errors: True
-  with_items: devices
-  register: parted
-  changed_when: False
+- include: check_devices.yml
 
 # Prepare means
 # - create GPT partition for a disk, or a loop label for a partition
@@ -52,7 +20,7 @@
 # failed, this is why we check if the device is a partition too.
 
 - name: Prepare OSD disk(s)
-  command: ceph-disk prepare {{ item.2 }} {{ item.3 }}
+  command: "ceph-disk prepare {{ item.2 }} {{ item.3 }}"
   when: (item.0.rc != 0 or item.1.rc != 0) and raw_multi_journal
   ignore_errors: True
   with_together:
     - devices
     - raw_journal_devices
 
-# Activate means:
-# - mount the volume in a temp location
-# - allocate an osd id (if needed)
-# - remount in the correct location /var/lib/ceph/osd/$cluster-$id
-# - start ceph-osd
-#
-
-# This task is for disk devices only because of the explicit use of the first
-# partition.
-
-- name: Activate OSD(s) when device is a disk
-  command: ceph-disk activate {{ item.2 }}1
-  with_together:
-    - parted.results
-    - ispartition.results
-    - devices
-  when: item.0.rc == 0 and item.1.rc != 0
-  ignore_errors: True
-  changed_when: False
-
-# This task is for partitions because we don't explicitly use a partition.
-
-- name: Activate OSD(s) when device is a partition
-  command: ceph-disk activate {{ item.1 }}
-  with_together:
-    - ispartition.results
-    - devices
-  when: item.0.rc == 0
-  ignore_errors: True
-  changed_when: False
-
-- name: Start and add that the OSD service to the init sequence
-  service: name=ceph state=started enabled=yes
+- include: activate_osds.yml
index d91813410431da7dadb0cdbc332581587e05c5fc..020470c699c14ef09d4482c9833f4b775ba14e8f 100644 (file)
@@ -1,3 +1,76 @@
 ---\r
 # You can override default vars defined in defaults/main.yml here,\r
 # but I would advice to use host or group vars instead \r
+\r
+## Ceph options\r
+#\r
+\r
+# ACTIVATE THE FSID VARIABLE FOR NON-VAGRANT DEPLOYMENT\r
+# fsid:\r
+cephx: true\r
+\r
+# Devices to be used as OSDs\r
+# You can pre-provision disks that are not present yet.\r
+# Ansible will just skip them. Newly added disk will be\r
+# automatically configured during the next run.\r
+#\r
+\r
+\r
+# !! WARNING !!\r
+#\r
+# /!\ ENABLE ONLY ONE SCENARIO AT A TIME /!\\r
+#\r
+# !! WARNING !!\r
+\r
+\r
+# Declare devices\r
+# All the scenarii inherit from the following device declaration\r
+#\r
+devices: \r
+  - /dev/sdb\r
+  - /dev/sdc\r
+  - /dev/sdd\r
+  - /dev/sde\r
+\r
+\r
+# I. First scenario: journal and osd_data on the same device\r
+# Use 'true' to enable this scenario\r
+# This will collocate both journal and data on the same disk\r
+# creating a partition at the beginning of the device\r
+\r
+journal_collocation: true\r
+\r
+\r
+# II. Second scenario: single journal device for N OSDs\r
+# Use 'true' to enable this scenario\r
+\r
+# deprecated, please use scenario III with a single raw_journal_device\r
+\r
+\r
+# III. Third scenario: N journal devices for N OSDs\r
+# Use 'true' to enable this scenario\r
+#\r
+# In the following example:\r
+# * sdd and sde will get sdb as a journal\r
+# * sdf and sdg will get sdc as a journal\r
+# While starting you have 2 options:\r
+# 1. Pre-allocate all the devices\r
+# 2. Progressively add new devices\r
+\r
+raw_multi_journal: false\r
+raw_journal_devices:\r
+  - /dev/sdb\r
+  - /dev/sdb\r
+  - /dev/sdc\r
+  - /dev/sdc\r
+\r
+\r
+# IV. Fourth scenario: use directory instead of disk for OSDs\r
+# Use 'true' to enable this scenario\r
+\r
+osd_directory: false\r
+osd_directories: \r
+ - /var/lib/ceph/osd/mydir1\r
+ - /var/lib/ceph/osd/mydir2\r
+ - /var/lib/ceph/osd/mydir3\r
+ - /var/lib/ceph/osd/mydir4\r
diff --git a/roles/ceph-radosgw/defaults/main.yml b/roles/ceph-radosgw/defaults/main.yml
deleted file mode 100644 (file)
index 3ab4cae..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
----
-# Variables here are applicable to the current role
-
-
-## Ceph options
-#
-cephx: true
-
-# Rados Gateway options
-redhat_distro_ceph_extra: centos6.4 # supported distros are centos6.3, centos6.4, centos6, fedora18, fedora19, opensuse12.2, rhel6.3, rhel6.4, rhel6.5, rhel6, sles11sp2
-email_address: foo@bar.com
-
index 5222302ff39ee6e76214844322e16965e799994f..06c73989ae3e6dbca138e0e1197d69f69fe9311d 100644 (file)
@@ -1,8 +1,14 @@
 ---
 - name: restart apache2
-  service: name=apache2 state=restarted enabled=yes
+  service: >
+    name=apache2
+    state=restarted
+    enabled=yes
   when: ansible_os_family == 'Debian'
 
 - name: restart apache2
-  service: name=httpd state=restarted enabled=yes
+  service: >
+    name=httpd
+    state=restarted
+    enabled=yes
   when: ansible_os_family == 'RedHat'
diff --git a/roles/ceph-radosgw/tasks/Debian.yml b/roles/ceph-radosgw/tasks/Debian.yml
deleted file mode 100644 (file)
index 7bc01ba..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
----
-## Deploy RADOS Gateway
-#
-
-- name: Copy RGW bootstrap key
-  copy: src=fetch/{{ fsid }}/etc/ceph/keyring.radosgw.gateway dest=/etc/ceph/keyring.radosgw.gateway owner=root group=root mode=600
-  when: cephx
-
-- name: Set RGW bootstrap key permissions
-  file: path=/etc/ceph/keyring.radosgw.gateway mode=0600 owner=root group=root
-  when: cephx
-
-#- name: Add optimized version of the apache2 package repository
-#  apt_repository: repo='deb http://gitbuilder.ceph.com/apache2-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main' state=present
-#
-#- name: Add optimized version of the fastcgi package repository
-#  apt_repository: repo='deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main' state=present
-#
-
-- name: Add Ceph extra
-  apt_repository: repo='deb http://ceph.com/packages/ceph-extras/debian {{ ansible_lsb.codename }} main' state=present
-
-- name: Install Apache, fastcgi and Rados Gateway
-  apt: pkg={{ item }} state=present
-  with_items:
-    - apache2
-    - libapache2-mod-fastcgi
-    - radosgw
-
-## Prepare Apache
-#
-
-- name: Install default httpd.conf
-  template: src=httpd.conf dest=/etc/apache2/httpd.conf owner=root group=root
-
-- name: Enable some apache mod rewrite and fastcgi
-  command: "{{ item }}"
-  with_items:
-    - a2enmod rewrite
-    - a2enmod fastcgi
-
-- name: Install Rados Gateway vhost
-  template: src=rgw.conf dest=/etc/apache2/sites-available/rgw.conf owner=root group=root
-
-## Prepare RGW
-#
-
-- name: Create RGW directory
-  file: path=/var/lib/ceph/radosgw/{{ ansible_fqdn }} state=directory owner=root group=root mode=0644
-
-- name: Enable Rados Gateway vhost and disable default site
-  command: "{{ item }}"
-  with_items:
-    - a2ensite rgw.conf
-    - a2dissite default
-  notify:
-    - restart apache2
-
-- name: Install s3gw.fcgi script
-  copy: src=s3gw.fcgi dest=/var/www/s3gw.fcgi mode=0555 owner=root group=root
-
-## If we don't perform this check Ansible will start multiple instance of radosgw
-- name: Check if RGW is started
-  command: /etc/init.d/radosgw status
-  register: rgwstatus
-  ignore_errors: True
-
-- name: Start RGW
-  command: /etc/init.d/radosgw start
-  when: rgwstatus.rc != 0
diff --git a/roles/ceph-radosgw/tasks/RedHat.yml b/roles/ceph-radosgw/tasks/RedHat.yml
deleted file mode 100644 (file)
index a2960b5..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
----
-## Deploy RADOS Gateway
-#
-
-- name: Copy RGW bootstrap key
-  copy: src=fetch/{{ fsid }}/etc/ceph/keyring.radosgw.gateway dest=/etc/ceph/keyring.radosgw.gateway owner=root group=root mode=600
-  when: cephx
-
-- name: Set RGW bootstrap key permissions
-  file: path=/etc/ceph/keyring.radosgw.gateway mode=0644 owner=root group=root
-  when: cephx
-
-- name: Add Ceph extra
-  template: src=ceph-extra.repo dest=/etc/yum.repos.d owner=root group=root
-
-- name: Add special fastcgi repository key
-  rpm_key: key=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
-
-- name: Add special fastcgi repository
-  command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
-
-- name: Install Apache, fastcgi, and Rados Gateway
-  yum: name={{ item }} state=present
-  with_items:
-    - httpd
-    - mod_fastcgi
-    - mod_fcgid
-    - ceph-radosgw
-
-## Prepare Apache
-#
-
-- name: Install Rados Gateway vhost
-  template: src=rgw.conf dest=/etc/httpd/conf.d/rgw.conf owner=root group=root
-
-## Prepare RGW
-#
-
-- name: Create RGW directory
-  file: path=/var/lib/ceph/radosgw/{{ ansible_fqdn }} state=directory owner=root group=root mode=0644
-
-- name: Install s3gw.fcgi script
-  copy: src=s3gw.fcgi dest=/var/www/s3gw.fcgi mode=0555 owner=root group=root
-
-- name: Disable default site
-  shell: sed -i "s/^[^+#]/#/g" /etc/httpd/conf.d/welcome.conf
-  changed_when: False
-  notify:
-    - restart apache2
-
-## If we don't perform this check Ansible will start multiple instance of radosgw
-- name: Check if RGW is started
-  command: /etc/init.d/ceph-radosgw status
-  register: rgwstatus
-  ignore_errors: True
-
-- name: Start RGW
-  command: /etc/init.d/ceph-radosgw start
-  when: rgwstatus.rc != 0
diff --git a/roles/ceph-radosgw/tasks/install_debian.yml b/roles/ceph-radosgw/tasks/install_debian.yml
new file mode 100644 (file)
index 0000000..d3d5f58
--- /dev/null
@@ -0,0 +1,73 @@
+---
+## Deploy RADOS Gateway
+#
+
+- name: Add Ceph extra
+  apt_repository: >
+    repo="deb http://ceph.com/packages/ceph-extras/debian {{ ansible_lsb.codename }} main"
+    state=present
+
+- name: "Install Apache, fastcgi and Rados Gateway"
+  apt: >
+    pkg={{ item }}
+    state=present
+  with_items:
+    - apache2
+    - libapache2-mod-fastcgi
+    - radosgw
+
+## Prepare Apache
+#
+
+- name: Install default httpd.conf
+  template: src=httpd.conf dest=/etc/apache2/httpd.conf owner=root group=root
+
+- name: Enable some apache mod rewrite and fastcgi
+  command: "{{ item }}"
+  with_items:
+    - a2enmod rewrite
+    - a2enmod fastcgi
+
+- name: Install Rados Gateway vhost
+  template: >
+    src=rgw.conf
+    dest=/etc/apache2/sites-available/rgw.conf
+    owner=root
+    group=root
+
+## Prepare RGW
+#
+
+- name: Create RGW directory
+  file: >
+    path=/var/lib/ceph/radosgw/{{ ansible_fqdn }}
+    state=directory
+    owner=root
+    group=root
+    mode=0644
+
+- name: Enable Rados Gateway vhost and disable default site
+  command: "{{ item }}"
+  with_items:
+    - a2ensite rgw.conf
+    - a2dissite default
+  notify:
+    - restart apache2
+
+- name: Install s3gw.fcgi script
+  copy: >
+    src=s3gw.fcgi
+    dest=/var/www/s3gw.fcgi
+    mode=0555
+    owner=root
+    group=root
+
+## If we don't perform this check Ansible will start multiple instance of radosgw
+- name: Check if RGW is started
+  command: /etc/init.d/radosgw status
+  register: rgwstatus
+  ignore_errors: True
+
+- name: Start RGW
+  command: /etc/init.d/radosgw start
+  when: rgwstatus.rc != 0
diff --git a/roles/ceph-radosgw/tasks/install_redhat.yml b/roles/ceph-radosgw/tasks/install_redhat.yml
new file mode 100644 (file)
index 0000000..511af7b
--- /dev/null
@@ -0,0 +1,71 @@
+---
+## Deploy RADOS Gateway
+#
+
+- name: Add Ceph extra
+  template: >
+    src=ceph-extra.repo 
+    dest=/etc/yum.repos.d 
+    owner=root 
+    group=root
+
+- name: Add special fastcgi repository key
+  rpm_key: key=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
+
+- name: Add special fastcgi repository
+  command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
+
+- name: "Install Apache, fastcgi, and Rados Gateway"
+  yum: >
+    name={{ item }}
+    state=present
+  with_items:
+    - httpd
+    - mod_fastcgi
+    - mod_fcgid
+    - ceph-radosgw
+
+## Prepare Apache
+#
+
+- name: Install Rados Gateway vhost
+  template: >
+    src=rgw.conf
+    dest=/etc/httpd/conf.d/rgw.conf
+    owner=root
+    group=root
+
+## Prepare RGW
+#
+
+- name: Create RGW directory
+  file: >
+    path=/var/lib/ceph/radosgw/{{ ansible_fqdn }}
+    state=directory
+    owner=root
+    group=root
+    mode=0644
+
+- name: Install s3gw.fcgi script
+  copy: >
+    src=s3gw.fcgi
+    dest=/var/www/s3gw.fcgi
+    mode=0555
+    owner=root
+    group=root
+
+- name: Disable default site
+  shell: sed -i "s/^[^+#]/#/g" /etc/httpd/conf.d/welcome.conf
+  changed_when: False
+  notify:
+    - restart apache2
+
+## If we don't perform this check Ansible will start multiple instance of radosgw
+- name: Check if RGW is started
+  command: /etc/init.d/ceph-radosgw status
+  register: rgwstatus
+  ignore_errors: True
+
+- name: Start RGW
+  command: /etc/init.d/ceph-radosgw start
+  when: rgwstatus.rc != 0
index f23dc609796ac79c73450b3dbbdc3b6fde285b45..9463a82503c68e53b52f5be4a6f2796e97d717e4 100644 (file)
@@ -1,4 +1,12 @@
 ---
+- name: Copy RGW bootstrap key
+  copy: src=fetch/{{ fsid }}/etc/ceph/keyring.radosgw.gateway dest=/etc/ceph/keyring.radosgw.gateway owner=root group=root mode=600
+  when: cephx
+
+- name: Set RGW bootstrap key permissions
+  file: path=/etc/ceph/keyring.radosgw.gateway mode=0600 owner=root group=root
+  when: cephx
+
 ## Check OS family
 #
 
index d91813410431da7dadb0cdbc332581587e05c5fc..e2fa05f346baefe9190d84408b812641e88aa97c 100644 (file)
@@ -1,3 +1,10 @@
 ---\r
-# You can override default vars defined in defaults/main.yml here,\r
-# but I would advice to use host or group vars instead \r
+# You can override vars by using host or group vars\r
+\r
+## Ceph options\r
+#\r
+cephx: true\r
+\r
+# Rados Gateway options\r
+redhat_distro_ceph_extra: centos6.4 # supported distros are centos6.3, centos6.4, centos6, fedora18, fedora19, opensuse12.2, rhel6.3, rhel6.4, rhel6.5, rhel6, sles11sp2\r
+email_address: foo@bar.com\r
diff --git a/roles/haproxy/defaults/main.yml b/roles/haproxy/defaults/main.yml
deleted file mode 100644 (file)
index ef3489d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
----
-# Variables here are applicable to the current role
-
-# Rados Gateway options
-radosgw_interface: eth1 # the public interface which the radosgw talks to the world with, this variable is used in the haproxy role, this does not need to be set if haproxy is not used.
-
index 2de15f4574e0eb2b2eb0d0677860f598adf0da5e..f2e666cf5cb1a27eca51eb0020dfde4dac51b2bb 100644 (file)
@@ -1,3 +1,5 @@
 ---
 - name: restart haproxy
-  service: name=haproxy state=restarted
+  service: >
+    name=haproxy
+    state=restarted
index d1e2f0518823de6abe86f79b9d671b762891169e..b9c409fb1802aa6b043517e2c9e5a775eb97e617 100644 (file)
@@ -1,15 +1,32 @@
 ---
-- apt_repository: repo=ppa:vbernat/haproxy-1.5 state=present
+- name: add repository
+  apt_repository: >
+    repo=ppa:vbernat/haproxy-1.5 
+    state=present
 
-- apt: name={{ item }} state=present
+- name: install haproxy
+  apt: >
+    name={{ item }}
+    state=present
   with_items:
    - haproxy
    - socat
 
-- copy: src=precise/haproxy dest=/etc/default/haproxy
+- name: copy default configuration
+  copy: >
+    src=precise/haproxy
+    dest=/etc/default/haproxy
   notify: restart haproxy
 
-- template: src=precise/haproxy.cfg dest=/etc/haproxy/haproxy.cfg backup=yes
+- name: create configuration
+  template: >
+    src=precise/haproxy.cfg
+    dest=/etc/haproxy/haproxy.cfg
+    backup=yes
   notify: restart haproxy
 
-- service: name=haproxy state=started enabled=yes
+- name: start and enable haproxy
+  service: >
+    name=haproxy
+    state=started
+    enabled=yes
index d91813410431da7dadb0cdbc332581587e05c5fc..bee39111e41fa42d308f63543eec4de86dabf81a 100644 (file)
@@ -1,3 +1,5 @@
 ---\r
-# You can override default vars defined in defaults/main.yml here,\r
-# but I would advice to use host or group vars instead \r
+# You can override vars by using host or group vars\r
+\r
+# Rados Gateway options\r
+radosgw_interface: eth1 # the public interface which the radosgw talks to the world with, this variable is used in the haproxy role, this does not need to be set if haproxy is not used.\r
index 56b63573eadbdf5c017d0629e7a779d88202a88e..798def97fbd99e508f433f98f4c896b36cb97956 100644 (file)
   - ceph-mon
   post_tasks:
   - name: restart monitor(s)
-    service: name=ceph state=restarted args=mon
+    service: >
+      name=ceph
+      state=restarted
+      args=mon
 
 - hosts: osds
   serial: 1
@@ -47,4 +50,7 @@
   - ceph-mds
   post_tasks:
   - name: restart metadata server(s)
-    service: name=ceph state=restarted args=mds
+    service: >
+      name=ceph 
+      state=restarted 
+      args=mds