Merge pull request #322 from ceph/activate-rgw-rhel

Activate rgw rhel
pull/323/head
Leseb 2015-07-07 17:56:13 +02:00
commit d9b67e0c55
12 changed files with 73 additions and 30 deletions

View File

@ -112,6 +112,7 @@ dummy:
#mon_osd_full_ratio: .95
#mon_osd_nearfull_ratio: .85
#mon_osd_report_timeout: 300
#mon_pg_warn_max_per_osd: 0 # disable complains about low pgs numbers per osd
## OSD options
#

View File

@ -5,6 +5,11 @@ dummy:
#
#cephx: true
# Used for the sudo exception while starting the radosgw process
# a new entry /etc/sudoers.d/ceph will be created
# allowing root to not require tty
#radosgw_user: root
# Toggle 100-continue support for Apache and FastCGI
# WARNING: Changing this value will cause an outage of Apache while it is reinstalled on RGW nodes
#http_100_continue: false

View File

@ -119,6 +119,7 @@ mon_clock_drift_warn_backoff: 30
mon_osd_full_ratio: .95
mon_osd_nearfull_ratio: .85
mon_osd_report_timeout: 300
mon_pg_warn_max_per_osd: 0 # disable complains about low pgs numbers per osd
## OSD options
#

View File

@ -73,6 +73,13 @@
[mon]
mon osd down out interval = {{ mon_osd_down_out_interval }}
mon osd min down reporters = {{ mon_osd_min_down_reporters }}
mon clock drift allowed = {{ mon_clock_drift_allowed }}
mon clock drift warn backoff = {{ mon_clock_drift_warn_backoff }}
mon osd full ratio = {{ mon_osd_full_ratio }}
mon osd nearfull ratio = {{ mon_osd_nearfull_ratio }}
mon osd report timeout = {{ mon_osd_report_timeout }}
mon pg warn max per osd = {{ mon_pg_warn_max_per_osd }}
{% if enable_debug_mon %}
debug mon = {{ debug_mon_level }}
debug paxos = {{ debug_mon_level }}

View File

@ -5,6 +5,11 @@
#
cephx: true
# Used for the sudo exception while starting the radosgw process
# a new entry /etc/sudoers.d/ceph will be created
# allowing root to not require tty
radosgw_user: root
# Toggle 100-continue support for Apache and FastCGI
# WARNING: Changing this value will cause an outage of Apache while it is reinstalled on RGW nodes
http_100_continue: false

View File

@ -1,12 +1,12 @@
---
- name: add Ceph extra
- name: add ceph extra
apt_repository: >
repo="deb http://ceph.com/packages/ceph-extras/debian {{ ansible_lsb.codename }} main"
state=present
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
- name: enable multiverse repo for Precise
- name: enable multiverse repo for precise
apt_repository: >
repo="{{ item }}"
state=present
@ -19,7 +19,7 @@
http_100_continue
# 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: >
repo="{{ item }}"
state=absent
@ -32,7 +32,7 @@
http_100_continue
# NOTE (leseb): needed for Ubuntu 14.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
- name: enable multiverse repo for Trusty
- name: enable multiverse repo for trusty
command: "apt-add-repository multiverse"
changed_when: false
when:
@ -40,7 +40,7 @@
http_100_continue
# NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
- name: disable multiverse repo for Trusty
- name: disable multiverse repo for trusty
command: "apt-add-repository -r multiverse"
changed_when: false
when:
@ -48,14 +48,14 @@
http_100_continue
# 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: >
data="{{ lookup('file', 'cephdev.asc') }}"
state=present
when: http_100_continue
# 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: >
repo="{{ item }}"
state=present
@ -66,7 +66,7 @@
when: http_100_continue
# 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: >
repo="{{ item }}"
state=absent
@ -77,7 +77,7 @@
when: not http_100_continue
# 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: >
pkg="{{ item }}"
state=absent
@ -95,7 +95,7 @@
purge_default_apache.changed or
purge_ceph_apache.changed
- name: install Apache and fastcgi
- name: install apache and fastcgi
apt: >
pkg={{ item }}
state=present
@ -118,14 +118,14 @@
- a2enmod fastcgi
changed_when: false
- name: install Rados Gateway vhost
- name: install rados gateway vhost
template: >
src=rgw.conf
dest=/etc/apache2/sites-available/rgw.conf
owner=root
group=root
- name: enable Rados Gateway vhost and disable default site
- name: enable rados gateway vhost and disable default site
command: "{{ item }}"
with_items:
- a2ensite rgw.conf

View File

@ -1,5 +1,5 @@
---
- name: add Ceph extra
- name: add ceph extra
template: >
src=ceph-extra.repo
dest=/etc/yum.repos.d
@ -13,7 +13,7 @@
command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
changed_when: false
- name: install Apache and fastcgi
- name: install apache and fastcgi
yum: >
name={{ item }}
state=present
@ -22,7 +22,7 @@
- mod_fastcgi
- mod_fcgid
- name: install Rados Gateway vhost
- name: install rados gateway vhost
template: >
src=rgw.conf
dest=/etc/httpd/conf.d/rgw.conf

View File

@ -14,7 +14,7 @@
radosgw_frontend == 'apache' and not
ceph_containerized_deployment
- name: install Rados Gateway
- name: install rados gateway
apt: >
pkg=radosgw
state=present
@ -23,7 +23,7 @@
ansible_os_family == 'Debian' and not
ceph_containerized_deployment
- name: install Rados Gateway
- name: install rados gateway
yum: >
name=ceph-radosgw
state=present

View File

@ -1,5 +1,5 @@
---
- name: create nss directory for Keystone certificates
- name: create nss directory for keystone certificates
file: >
path={{ radosgw_nss_db_path }}
state=directory
@ -7,7 +7,7 @@
group=root
mode=0644
- name: create nss entries for Keystone certificates
- name: create nss entries for keystone certificates
shell: "{{ item }}"
with_items:
- "openssl x509 -in /etc/keystone/ssl/certs/ca.pem -pubkey |certutil -d {{ radosgw_nss_db_path }} -A -n ca -t 'TCu,Cu,Tuw'"

View File

@ -1,5 +1,5 @@
---
- name: create RGW directories
- name: create rados gateway directories
file: >
path={{ item }}
state=directory
@ -10,7 +10,7 @@
- /var/lib/ceph/bootstrap-rgw
- /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
- name: copy RGW bootstrap key
- name: copy rados gateway bootstrap key
copy: >
src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring
dest=/var/lib/ceph/bootstrap-rgw/ceph.keyring
@ -19,14 +19,14 @@
mode=600
when: cephx
- name: create RGW keyring
- name: create rados gateway keyring
command: >
ceph --cluster ceph --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/ceph.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
creates=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
changed_when: false
when: cephx
- name: set RGW key permissions
- name: set rados gateway key permissions
file: >
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
mode=0600
@ -34,7 +34,7 @@
group=root
when: cephx
- name: activate RGW with upstart
- name: activate rados gateway with upstart
file: >
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }}
state=touch
@ -46,3 +46,25 @@
- upstart
changed_when: false
when: ansible_distribution == "Ubuntu"
- name: activate rados gateway with sysvinit
file: >
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }}
state=touch
owner=root
group=root
mode=0644
with_items:
- done
- sysvinit
changed_when: false
when: ansible_distribution != "Ubuntu"
- name: generate rados gateway sudoers file
template: >
src=ceph.j2
dest=/etc/sudoers.d/ceph
owner=root
group=root
mode=0400
when: ansible_distribution != "Ubuntu"

View File

@ -1,25 +1,25 @@
---
- name: check if RGW is started
- name: check if rgw is started
command: /etc/init.d/radosgw status
register: rgwstatus
ignore_errors: true
- name: start RGW
- name: start rgw
command: /etc/init.d/radosgw start
when:
rgwstatus.rc != 0 and
ansible_distribution != "Ubuntu" and
ansible_os_family != 'RedHat'
- name: start RGW
- name: start rgw on ubuntu
service: >
name=radosgw-all
state=started
when: ansible_distribution == "Ubuntu"
when: ansible_distribution == 'Ubuntu'
- name: start RGW
- name: start rgw on red hat
service: >
name=ceph-radosgw
state=started
enabled=yes
when: ansible_os_family == 'RedHat'
when: ansible_distribution == 'RedHat'

View File

@ -0,0 +1,2 @@
# {{ ansible_managed }}
Defaults:{{ radosgw_user }} !requiretty