Merge pull request #402 from msambol/refactor_ceph_common

Update ceph-common styling
pull/404/head
Leseb 2015-09-04 11:47:06 +02:00
commit 8a5bf6bcf7
13 changed files with 251 additions and 234 deletions

View File

@ -1,6 +1,7 @@
--- ---
- name: update apt cache - name: update apt cache
apt: update-cache=yes apt:
update-cache: yes
- name: restart ceph mons - name: restart ceph mons
command: service ceph restart mon command: service ceph restart mon
@ -66,19 +67,19 @@
rgw_group_name in group_names rgw_group_name in group_names
- name: restart apache2 - name: restart apache2
service: > service:
name=apache2 name: apache2
state=restarted state: restarted
enabled=yes enabled: yes
when: when:
ansible_os_family == 'Debian' and ansible_os_family == 'Debian' and
rgw_group_name in group_names rgw_group_name in group_names
- name: restart apache2 - name: restart apache2
service: > service:
name=httpd name: httpd
state=restarted state: restarted
enabled=yes enabled: yes
when: when:
ansible_os_family == 'RedHat' and ansible_os_family == 'RedHat' and
rgw_group_name in group_names rgw_group_name in group_names

View File

@ -1,6 +1,7 @@
--- ---
- name: make sure an installation source was chosen - name: make sure an installation source was chosen
fail: msg="choose an installation source or read https://github.com/ceph/ceph-ansible/wiki" fail:
msg: "choose an installation source or read https://github.com/ceph/ceph-ansible/wiki"
when: when:
not ceph_stable and not ceph_stable and
not ceph_dev and not ceph_dev and
@ -8,30 +9,36 @@
not ceph_stable_rh_storage not ceph_stable_rh_storage
- name: verify that a method was chosen for red hat storage - name: verify that a method was chosen for red hat storage
fail: msg="choose between ceph_stable_rh_storage_cdn_install and ceph_stable_rh_storage_iso_install" fail:
msg: "choose between ceph_stable_rh_storage_cdn_install and ceph_stable_rh_storage_iso_install"
when: when:
ceph_stable_rh_storage and ceph_stable_rh_storage and
not ceph_stable_rh_storage_cdn_install and not ceph_stable_rh_storage_cdn_install and
not ceph_stable_rh_storage_iso_install not ceph_stable_rh_storage_iso_install
- name: make sure journal_size configured - name: make sure journal_size configured
fail: msg="journal_size must be configured. See http://ceph.com/docs/master/rados/configuration/osd-config-ref/" fail:
msg: "journal_size must be configured. See http://ceph.com/docs/master/rados/configuration/osd-config-ref/"
when: journal_size|int == 0 when: journal_size|int == 0
- name: make sure monitor_interface configured - name: make sure monitor_interface configured
fail: msg="monitor_interface must be configured. Interface for the monitor to listen on" fail:
msg: "monitor_interface must be configured. Interface for the monitor to listen on"
when: monitor_interface == 'interface' when: monitor_interface == 'interface'
- name: make sure cluster_network configured - name: make sure cluster_network configured
fail: msg="cluster_network must be configured. Ceph replication network" fail:
msg: "cluster_network must be configured. Ceph replication network"
when: cluster_network == '0.0.0.0/0' when: cluster_network == '0.0.0.0/0'
- name: make sure public_network configured - name: make sure public_network configured
fail: msg="public_network must be configured. Ceph public network" fail:
msg: "public_network must be configured. Ceph public network"
when: public_network == '0.0.0.0/0' when: public_network == '0.0.0.0/0'
- name: make sure an osd scenario was chosen - name: make sure an osd scenario was chosen
fail: msg="please choose an osd scenario" fail:
msg: "please choose an osd scenario"
when: when:
osd_group_name is defined and osd_group_name is defined and
osd_group_name in group_names and osd_group_name in group_names and
@ -40,7 +47,8 @@
not osd_directory not osd_directory
- name: verify only one osd scenario was chosen - name: verify only one osd scenario was chosen
fail: msg="please select only one osd scenario" fail:
msg: "please select only one osd scenario"
when: when:
osd_group_name is defined and osd_group_name is defined and
osd_group_name in group_names and osd_group_name in group_names and
@ -49,7 +57,8 @@
(raw_multi_journal and osd_directory)) (raw_multi_journal and osd_directory))
- name: verify devices have been provided - name: verify devices have been provided
fail: msg="please provide devices to your osd scenario" fail:
msg: "please provide devices to your osd scenario"
when: when:
osd_group_name is defined and osd_group_name is defined and
osd_group_name in group_names and osd_group_name in group_names and
@ -58,7 +67,8 @@
devices is not defined devices is not defined
- name: verify journal devices have been provided - name: verify journal devices have been provided
fail: msg="please provide devices to your osd scenario" fail:
msg: "please provide devices to your osd scenario"
when: when:
osd_group_name is defined and osd_group_name is defined and
osd_group_name in group_names and osd_group_name in group_names and
@ -67,7 +77,8 @@
devices is not defined) devices is not defined)
- name: verify directories have been provided - name: verify directories have been provided
fail: msg="please provide directories to your osd scenario" fail:
msg: "please provide directories to your osd scenario"
when: when:
osd_group_name is defined and osd_group_name is defined and
osd_group_name in group_names and osd_group_name in group_names and

View File

@ -1,18 +1,22 @@
--- ---
- name: fail on unsupported system - name: fail on unsupported system
fail: "msg=System not supported {{ ansible_system }}" fail:
msg: "System not supported {{ ansible_system }}"
when: "ansible_system not in ['Linux']" when: "ansible_system not in ['Linux']"
- name: fail on unsupported architecture - name: fail on unsupported architecture
fail: "msg=Architecture not supported {{ ansible_architecture }}" fail:
msg: "Architecture not supported {{ ansible_architecture }}"
when: "ansible_architecture not in ['x86_64']" when: "ansible_architecture not in ['x86_64']"
- name: fail on unsupported distribution - name: fail on unsupported distribution
fail: "msg=Distribution not supported {{ ansible_os_family }}" fail:
msg: "Distribution not supported {{ ansible_os_family }}"
when: "ansible_os_family not in ['Debian', 'RedHat']" when: "ansible_os_family not in ['Debian', 'RedHat']"
- name: fail on unsupported distribution for red hat storage - name: fail on unsupported distribution for red hat storage
fail: "msg=Distribution not supported {{ ansible_distribution_version }} by Red Hat Storage, only RHEL 7.1" fail:
msg: "Distribution not supported {{ ansible_distribution_version }} by Red Hat Storage, only RHEL 7.1"
when: when:
ceph_stable_rh_storage and ceph_stable_rh_storage and
{{ ansible_distribution_version | version_compare('7.1', '<') }} {{ ansible_distribution_version | version_compare('7.1', '<') }}

View File

@ -1,40 +1,40 @@
--- ---
- name: install the ceph repository stable key - name: install the ceph repository stable key
apt_key: > apt_key:
data="{{ lookup('file', '../../files/cephstable.asc') }}" data: "{{ lookup('file', '../../files/cephstable.asc') }}"
state=present state: present
when: ceph_stable when: ceph_stable
- name: install the ceph development repository key - name: install the ceph development repository key
apt_key: > apt_key:
data="{{ lookup('file', '../../files/cephdev.asc') }}" data: "{{ lookup('file', '../../files/cephdev.asc') }}"
state=present state: present
when: ceph_dev when: ceph_dev
- name: install intank ceph enterprise repository key - name: install intank ceph enterprise repository key
apt_key: > apt_key:
data="{{ lookup('file', '../../files/cephstableice.asc') }}" data: "{{ lookup('file', '../../files/cephstableice.asc') }}"
state=present state: present
when: ceph_stable_ice when: ceph_stable_ice
- name: add ceph stable repository - name: add ceph stable repository
apt_repository: > apt_repository:
repo="deb http://ceph.com/debian-{{ ceph_stable_release }}/ {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main" repo: "deb http://ceph.com/debian-{{ ceph_stable_release }}/ {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main"
state=present state: present
changed_when: false changed_when: false
when: ceph_stable when: ceph_stable
- name: add ceph development repository - name: add ceph development repository
apt_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" repo: "deb http://gitbuilder.ceph.com/ceph-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/{{ ceph_dev_branch }} {{ ansible_lsb.codename }} main"
state=present state: present
changed_when: false changed_when: false
when: ceph_dev when: ceph_dev
- name: add inktank ceph enterprise repository - name: add inktank ceph enterprise repository
apt_repository: > apt_repository:
repo="deb file://{{ ceph_stable_ice_temp_path }} {{ ansible_lsb.codename }} main" repo: "deb file://{{ ceph_stable_ice_temp_path }} {{ ansible_lsb.codename }} main"
state=present state: present
changed_when: false changed_when: false
when: ceph_stable_ice when: ceph_stable_ice

View File

@ -1,10 +1,10 @@
--- ---
- name: install dependencies - name: install dependencies
apt: > apt:
pkg={{ item }} pkg: "{{ item }}"
state=present state: present
update_cache=yes update_cache: yes
cache_valid_time=3600 cache_valid_time: 3600
with_items: debian_package_dependencies with_items: debian_package_dependencies
- name: configure ceph apt repository - name: configure ceph apt repository
@ -12,10 +12,10 @@
when: ceph_origin == 'upstream' when: ceph_origin == 'upstream'
- name: install ceph - name: install ceph
apt: > apt:
pkg={{ item }} pkg: "{{ item }}"
state=latest state: latest
default_release={{ ansible_distribution_release }}{{ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}} default_release: "{{ ansible_distribution_release }}{{ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else ''}}"
with_items: with_items:
- ceph - ceph
- ceph-common #| - ceph-common #|
@ -25,20 +25,20 @@
- libcephfs1 #| - libcephfs1 #|
- name: install rados gateway - name: install rados gateway
apt: > apt:
pkg=radosgw pkg: radosgw
state=latest state: latest
update_cache=yes update_cache: yes
when: when:
rgw_group_name in group_names rgw_group_name in group_names
- name: configure rbd clients directories - name: configure rbd clients directories
file: > file:
path={{ item }} path: "{{ item }}"
state=directory state: directory
owner=libvirt-qemu owner: libvirt-qemu
group=kvm group: kvm
mode=0755 mode: 0755
with_items: with_items:
- rbd_client_log_path - rbd_client_log_path
- rbd_client_admin_socket_path - rbd_client_admin_socket_path

View File

@ -1,8 +1,8 @@
--- ---
- name: install dependencies - name: install dependencies
yum: > yum:
name={{ item }} name: "{{ item }}"
state=present state: present
with_items: redhat_package_dependencies with_items: redhat_package_dependencies
- name: configure ceph yum repository - name: configure ceph yum repository
@ -10,15 +10,15 @@
when: ceph_origin == 'upstream' when: ceph_origin == 'upstream'
- name: install ceph - name: install ceph
yum: > yum:
name=ceph name: ceph
state=latest state: latest
when: not ceph_stable_rh_storage when: not ceph_stable_rh_storage
- name: install red hat storage ceph mon - name: install red hat storage ceph mon
yum: > yum:
name={{ item }} name: "{{ item }}"
state=latest state: latest
with_items: with_items:
- ceph - ceph
- ceph-mon - ceph-mon
@ -27,9 +27,9 @@
mon_group_name in group_names mon_group_name in group_names
- name: install red hat storage ceph osd - name: install red hat storage ceph osd
yum: > yum:
name={{ item }} name: "{{ item }}"
state=latest state: latest
with_items: with_items:
- ceph - ceph
- ceph-osd - ceph-osd
@ -38,27 +38,27 @@
osd_group_name in group_names osd_group_name in group_names
- name: install Inktank Ceph Enterprise RBD Kernel modules - name: install Inktank Ceph Enterprise RBD Kernel modules
yum: > yum:
name={{ item }} name: "{{ item }}"
with_items: with_items:
- "{{ ceph_stable_ice_temp_path }}/kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm" - "{{ ceph_stable_ice_temp_path }}/kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm"
- "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm" - "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm"
when: ceph_stable_ice when: ceph_stable_ice
- name: install rados gateway - name: install rados gateway
yum: > yum:
name=ceph-radosgw name: ceph-radosgw
state=latest state: latest
when: when:
rgw_group_name in group_names rgw_group_name in group_names
- name: configure rbd clients directories - name: configure rbd clients directories
file: > file:
path={{ item }} path: "{{ item }}"
state=directory state: directory
owner=qemu owner: qemu
group=libvirtd group: libvirtd
mode=0755 mode: 0755
with_items: with_items:
- rbd_client_log_path - rbd_client_log_path
- rbd_client_admin_socket_path - rbd_client_admin_socket_path

View File

@ -1,15 +1,15 @@
--- ---
- name: add ceph extra - name: add ceph extra
apt_repository: > apt_repository:
repo="deb http://ceph.com/packages/ceph-extras/debian {{ ansible_lsb.codename }} main" repo: "deb http://ceph.com/packages/ceph-extras/debian {{ ansible_lsb.codename }} main"
state=present state: present
when: ansible_lsb.codename in ['natty', 'oneiric', 'precise', 'quantal', 'raring', 'sid', 'squeeze', 'wheezy'] when: ansible_lsb.codename in ['natty', 'oneiric', 'precise', 'quantal', 'raring', 'sid', 'squeeze', 'wheezy']
# NOTE (leseb): needed for Ubuntu 12.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used # NOTE (leseb): needed for Ubuntu 12.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
- name: enable multiverse repo for precise - name: enable multiverse repo for precise
apt_repository: > apt_repository:
repo="{{ item }}" repo: "{{ item }}"
state=present state: present
with_items: with_items:
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }} multiverse - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }} multiverse
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse
@ -20,9 +20,9 @@
# NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages # NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
- name: disable multiverse repo for precise - name: disable multiverse repo for precise
apt_repository: > apt_repository:
repo="{{ item }}" repo: "{{ item }}"
state=absent state: absent
with_items: with_items:
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }} multiverse - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }} multiverse
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse - deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse
@ -49,16 +49,16 @@
# NOTE (leseb): if using 100-continue, add Ceph dev key # NOTE (leseb): if using 100-continue, add Ceph dev key
- name: install the ceph development repository key - name: install the ceph development repository key
apt_key: > apt_key:
data="{{ lookup('file', 'cephdev.asc') }}" data: "{{ lookup('file', 'cephdev.asc') }}"
state=present state: present
when: http_100_continue when: http_100_continue
# NOTE (leseb): if using 100-continue, add Ceph sources and update # NOTE (leseb): if using 100-continue, add Ceph sources and update
- name: add ceph apache and fastcgi sources - name: add ceph apache and fastcgi sources
apt_repository: > apt_repository:
repo="{{ item }}" repo: "{{ item }}"
state=present state: present
with_items: with_items:
- deb http://gitbuilder.ceph.com/apache2-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main - deb http://gitbuilder.ceph.com/apache2-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main
- deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main - deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main
@ -67,9 +67,9 @@
# NOTE (leseb): else remove them to ensure you use the default packages # NOTE (leseb): else remove them to ensure you use the default packages
- name: remove ceph apache and fastcgi sources - name: remove ceph apache and fastcgi sources
apt_repository: > apt_repository:
repo="{{ item }}" repo: "{{ item }}"
state=absent state: absent
with_items: with_items:
- deb http://gitbuilder.ceph.com/apache2-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main - deb http://gitbuilder.ceph.com/apache2-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main
- deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main - deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main
@ -78,10 +78,10 @@
# NOTE (leseb): purge Ceph Apache and FastCGI packages if needed # NOTE (leseb): purge Ceph Apache and FastCGI packages if needed
- name: purge ceph apache and fastcgi packages - name: purge ceph apache and fastcgi packages
apt: > apt:
pkg="{{ item }}" pkg: "{{ item }}"
state=absent state: absent
purge=yes purge: yes
with_items: with_items:
- apache2 - apache2
- apache2-bin - apache2-bin
@ -96,20 +96,20 @@
purge_ceph_apache.changed purge_ceph_apache.changed
- name: install apache and fastcgi - name: install apache and fastcgi
apt: > apt:
pkg={{ item }} pkg: "{{ item }}"
state=present state: present
update_cache=yes update_cache: yes
with_items: with_items:
- apache2 - apache2
- libapache2-mod-fastcgi - libapache2-mod-fastcgi
- name: install default httpd.conf - name: install default httpd.conf
template: > template:
src=../../templates/httpd.conf src: ../../templates/httpd.conf
dest=/etc/apache2/httpd.conf dest: /etc/apache2/httpd.conf
owner=root owner: root
group=root group: root
- name: enable some apache mod rewrite and fastcgi - name: enable some apache mod rewrite and fastcgi
command: "{{ item }}" command: "{{ item }}"
@ -119,11 +119,11 @@
changed_when: false changed_when: false
- name: install rados gateway vhost - name: install rados gateway vhost
template: > template:
src=../../templates/rgw.conf src: ../../templates/rgw.conf
dest=/etc/apache2/sites-available/rgw.conf dest: /etc/apache2/sites-available/rgw.conf
owner=root owner: root
group=root group: root
- name: enable rados gateway vhost and disable default site - name: enable rados gateway vhost and disable default site
command: "{{ item }}" command: "{{ item }}"
@ -136,9 +136,9 @@
- restart apache2 - restart apache2
- name: install s3gw.fcgi script - name: install s3gw.fcgi script
template: > template:
src=../../templates/s3gw.fcgi.j2 src: ../../templates/s3gw.fcgi.j2
dest=/var/www/s3gw.fcgi dest: /var/www/s3gw.fcgi
mode=0555 mode: 0555
owner=root owner: root
group=root group: root

View File

@ -1,41 +1,42 @@
--- ---
- name: add ceph extra - name: add ceph extra
template: > template:
src=../../templates/ceph-extra.repo src: ../../templates/ceph-extra.repo
dest=/etc/yum.repos.d dest: /etc/yum.repos.d
owner=root owner: root
group=root group: root
- name: add special fastcgi repository key - name: add special fastcgi repository key
rpm_key: key=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt rpm_key:
key: http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
- name: add special fastcgi repository - 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 command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
changed_when: false changed_when: false
- name: install apache and fastcgi - name: install apache and fastcgi
yum: > yum:
name={{ item }} name: "{{ item }}"
state=present state: present
with_items: with_items:
- httpd - httpd
- mod_fastcgi - mod_fastcgi
- mod_fcgid - mod_fcgid
- name: install rados gateway vhost - name: install rados gateway vhost
template: > template:
src=../../templates/rgw.conf src: ../../templates/rgw.conf
dest=/etc/httpd/conf.d/rgw.conf dest: /etc/httpd/conf.d/rgw.conf
owner=root owner: root
group=root group: root
- name: install s3gw.fcgi script - name: install s3gw.fcgi script
template: > template:
src=../../templates/s3gw.fcgi.j2 src: ../../templates/s3gw.fcgi.j2
dest=/var/www/s3gw.fcgi dest: /var/www/s3gw.fcgi
mode=0555 mode: 0555
owner=root owner: root
group=root group: root
- name: disable default site - name: disable default site
shell: sed -i "s/^[^+#]/#/g" /etc/httpd/conf.d/welcome.conf shell: sed -i "s/^[^+#]/#/g" /etc/httpd/conf.d/welcome.conf

View File

@ -1,58 +1,58 @@
--- ---
- name: install the ceph stable repository key - name: install the ceph stable repository key
rpm_key: > rpm_key:
key={{ ceph_stable_key }} key: "{{ ceph_stable_key }}"
state=present state: present
when: ceph_stable when: ceph_stable
- name: install the ceph development repository key - name: install the ceph development repository key
rpm_key: > rpm_key:
key={{ ceph_dev_key }} key: "{{ ceph_dev_key }}"
state=present state: present
when: ceph_dev when: ceph_dev
- name: install inktank ceph enterprise repository key - name: install inktank ceph enterprise repository key
rpm_key: > rpm_key:
key={{ ceph_stable_ice_temp_path }}/release.asc key: "{{ ceph_stable_ice_temp_path }}/release.asc"
state=present state: present
when: ceph_stable_ice when: ceph_stable_ice
- name: install red hat storage repository key - name: install red hat storage repository key
rpm_key: > rpm_key:
key={{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release key: "{{ ceph_stable_rh_storage_repository_path }}/RPM-GPG-KEY-redhat-release"
state=present state: present
when: when:
ceph_stable_rh_storage and ceph_stable_rh_storage and
ceph_stable_rh_storage_iso_install ceph_stable_rh_storage_iso_install
- name: add ceph stable repository - name: add ceph stable repository
yum: name=http://ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm yum:
name: http://ceph.com/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch/ceph-release-1-0.{{ ceph_stable_redhat_distro|replace('rhel', 'el') }}.noarch.rpm
changed_when: false changed_when: false
when: ceph_stable when: ceph_stable
- name: add ceph development repository - name: add ceph development repository
yum: name=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 yum:
name: 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
changed_when: false changed_when: false
when: ceph_dev when: ceph_dev
- name: add inktank ceph enterprise repository - name: add inktank ceph enterprise repository
template: > template:
src=redhat_ice_repo.j2 src: redhat_ice_repo.j2
dest=/etc/yum.repos.d/ice.repo dest: /etc/yum.repos.d/ice.repo
owner=root owner: root
group=root group: root
mode=0644 mode: 0644
when: ceph_stable_ice when: ceph_stable_ice
- name: add red hat storage repository - name: add red hat storage repository
template: > template:
src=redhat_storage_repo.j2 src: redhat_storage_repo.j2
dest=/etc/yum.repos.d/rh_storage.repo dest: /etc/yum.repos.d/rh_storage.repo
owner=root owner: root
group=root group: root
mode=0644 mode: 0644
when: when:
ceph_stable_rh_storage and ceph_stable_rh_storage and
ceph_stable_rh_storage_iso_install ceph_stable_rh_storage_iso_install

View File

@ -57,26 +57,26 @@
- name: generate cluster uuid - name: generate cluster uuid
local_action: shell uuidgen | tee {{ fetch_directory }}/ceph_cluster_uuid.conf local_action: shell uuidgen | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
creates={{ fetch_directory }}/ceph_cluster_uuid.conf creates="{{ fetch_directory }}/ceph_cluster_uuid.conf"
register: cluster_uuid register: cluster_uuid
sudo: false sudo: false
when: fsid != '4a158d27-f750-41d5-9e7f-26ce4c9d2d45' when: fsid != '4a158d27-f750-41d5-9e7f-26ce4c9d2d45'
- name: read cluster uuid if it already exists - name: read cluster uuid if it already exists
local_action: command cat {{ fetch_directory }}/ceph_cluster_uuid.conf local_action: command cat {{ fetch_directory }}/ceph_cluster_uuid.conf
removes={{ fetch_directory }}/ceph_cluster_uuid.conf removes="{{ fetch_directory }}/ceph_cluster_uuid.conf"
changed_when: false changed_when: false
register: cluster_uuid register: cluster_uuid
sudo: false sudo: false
when: fsid != '4a158d27-f750-41d5-9e7f-26ce4c9d2d45' when: fsid != '4a158d27-f750-41d5-9e7f-26ce4c9d2d45'
- name: generate ceph configuration file - name: generate ceph configuration file
template: > template:
src=ceph.conf.j2 src: ceph.conf.j2
dest=/etc/ceph/ceph.conf dest: /etc/ceph/ceph.conf
owner=root owner: root
group=root group: root
mode=0644 mode: 0644
notify: notify:
- restart ceph mons - restart ceph mons
- restart ceph mons on ubuntu - restart ceph mons on ubuntu
@ -89,9 +89,9 @@
- restart ceph rgws on red hat - restart ceph rgws on red hat
- name: create rbd client directory - name: create rbd client directory
file: > file:
path={{ rbd_client_admin_socket_path }} path: "{{ rbd_client_admin_socket_path }}"
state=directory state: directory
owner=root owner: root
group=root group: root
mode=0644 mode: 0644

View File

@ -17,10 +17,10 @@
when: disable_swap when: disable_swap
- name: apply operating system tuning - name: apply operating system tuning
sysctl: > sysctl:
name="{{ item.name }}" name: "{{ item.name }}"
value="{{ item.value }}" value: "{{ item.value }}"
state=present state: present
sysctl_file=/etc/sysctl.conf sysctl_file: /etc/sysctl.conf
ignoreerrors=yes ignoreerrors: yes
with_items: os_tuning_params with_items: os_tuning_params

View File

@ -1,27 +1,27 @@
--- ---
- name: create ice package directory - name: create ice package directory
file: > file:
path={{ ceph_stable_ice_temp_path }} path: "{{ ceph_stable_ice_temp_path }}"
state=directory state: directory
owner=root owner: root
group=root group: root
mode=0644 mode: 0644
when: ceph_stable_ice when: ceph_stable_ice
- name: get ice packages - name: get ice packages
get_url: > get_url:
url_username={{ ceph_stable_ice_user }} url_username: "{{ ceph_stable_ice_user }}"
url_password={{ ceph_stable_ice_password }} url_password: "{{ ceph_stable_ice_password }}"
url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_version }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz url: "{{ ceph_stable_ice_url }}/{{ ceph_stable_ice_version }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz"
dest={{ ceph_stable_ice_temp_path }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz dest: "{{ ceph_stable_ice_temp_path }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz"
when: ceph_stable_ice when: ceph_stable_ice
- name: get ice Kernel Modules - name: get ice Kernel Modules
get_url: > get_url:
url_username={{ ceph_stable_ice_user }} url_username: "{{ ceph_stable_ice_user }}"
url_password={{ ceph_stable_ice_password }} url_password: "{{ ceph_stable_ice_password }}"
url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_kmod_version }}/{{ item }} url: "{{ ceph_stable_ice_url }}/{{ ceph_stable_ice_kmod_version }}/{{ item }}"
dest={{ ceph_stable_ice_temp_path }} dest: "{{ ceph_stable_ice_temp_path }}"
with_items: with_items:
- kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm - kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm
- kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm - kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm
@ -30,15 +30,15 @@
ansible_os_family == 'RedHat' ansible_os_family == 'RedHat'
- name: stat extracted ice repo files - name: stat extracted ice repo files
stat: > stat:
path={{ ceph_stable_ice_temp_path }}/ice_setup.py path: "{{ ceph_stable_ice_temp_path }}/ice_setup.py"
register: repo_exist register: repo_exist
when: ceph_stable_ice when: ceph_stable_ice
- name: extract ice packages - name: extract ice packages
shell: > shell: tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz
tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz args:
chdir={{ ceph_stable_ice_temp_path }} chdir: "{{ ceph_stable_ice_temp_path }}"
changed_when: false changed_when: false
when: when:
ceph_stable_ice and ceph_stable_ice and

View File

@ -1,32 +1,32 @@
--- ---
- name: create red hat storage package directories - name: create red hat storage package directories
file: > file:
path={{ item }} path: "{{ item }}"
state=directory state: directory
with_items: with_items:
- "{{ ceph_stable_rh_storage_mount_path }}" - "{{ ceph_stable_rh_storage_mount_path }}"
- "{{ ceph_stable_rh_storage_repository_path }}" - "{{ ceph_stable_rh_storage_repository_path }}"
- name: fetch the red hat storage iso from the ansible server - name: fetch the red hat storage iso from the ansible server
copy: > copy:
src={{ ceph_stable_rh_storage_iso_path }} src: "{{ ceph_stable_rh_storage_iso_path }}"
dest={{ ceph_stable_rh_storage_iso_path }} dest: "{{ ceph_stable_rh_storage_iso_path }}"
- name: mount red hat storage iso file - name: mount red hat storage iso file
mount: > mount:
name={{ ceph_stable_rh_storage_mount_path }} name: "{{ ceph_stable_rh_storage_mount_path }}"
src={{ ceph_stable_rh_storage_iso_path }} src: "{{ ceph_stable_rh_storage_iso_path }}"
fstype=iso9660 fstype: iso9660
state=mounted state: mounted
- name: copy red hat storage iso content - name: copy red hat storage iso content
shell: shell: cp -r {{ ceph_stable_rh_storage_mount_path }}/* {{ ceph_stable_rh_storage_repository_path }}
cp -r {{ ceph_stable_rh_storage_mount_path }}/* {{ ceph_stable_rh_storage_repository_path }} args:
creates={{ ceph_stable_rh_storage_repository_path }}/README creates: "{{ ceph_stable_rh_storage_repository_path }}/README"
- name: mount red hat storage iso file - name: mount red hat storage iso file
mount: > mount:
name={{ ceph_stable_rh_storage_mount_path }} name: "{{ ceph_stable_rh_storage_mount_path }}"
src={{ ceph_stable_rh_storage_iso_path }} src: "{{ ceph_stable_rh_storage_iso_path }}"
fstype=iso9660 fstype: iso9660
state=unmounted state: unmounted