mirror of https://github.com/ceph/ceph-ansible.git
Activate rados gateway with systemd
Signed-off-by: leseb <seb@redhat.com>pull/322/head
parent
2dd12c93e1
commit
f3fc01e94c
|
@ -1,12 +1,12 @@
|
||||||
---
|
---
|
||||||
- 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
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
http_100_continue
|
http_100_continue
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
http_100_continue
|
http_100_continue
|
||||||
|
|
||||||
# NOTE (leseb): needed for Ubuntu 14.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
|
# 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"
|
command: "apt-add-repository multiverse"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
http_100_continue
|
http_100_continue
|
||||||
|
|
||||||
# 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 Trusty
|
- name: disable multiverse repo for trusty
|
||||||
command: "apt-add-repository -r multiverse"
|
command: "apt-add-repository -r multiverse"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
|
@ -48,14 +48,14 @@
|
||||||
http_100_continue
|
http_100_continue
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
when: http_100_continue
|
when: http_100_continue
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
when: not http_100_continue
|
when: not http_100_continue
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
purge_default_apache.changed or
|
purge_default_apache.changed or
|
||||||
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
|
||||||
|
@ -118,14 +118,14 @@
|
||||||
- a2enmod fastcgi
|
- a2enmod fastcgi
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: install Rados Gateway vhost
|
- name: install rados gateway vhost
|
||||||
template: >
|
template: >
|
||||||
src=rgw.conf
|
src=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 }}"
|
||||||
with_items:
|
with_items:
|
||||||
- a2ensite rgw.conf
|
- a2ensite rgw.conf
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: add Ceph extra
|
- name: add ceph extra
|
||||||
template: >
|
template: >
|
||||||
src=ceph-extra.repo
|
src=ceph-extra.repo
|
||||||
dest=/etc/yum.repos.d
|
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
|
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
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
- mod_fastcgi
|
- mod_fastcgi
|
||||||
- mod_fcgid
|
- mod_fcgid
|
||||||
|
|
||||||
- name: install Rados Gateway vhost
|
- name: install rados gateway vhost
|
||||||
template: >
|
template: >
|
||||||
src=rgw.conf
|
src=rgw.conf
|
||||||
dest=/etc/httpd/conf.d/rgw.conf
|
dest=/etc/httpd/conf.d/rgw.conf
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
radosgw_frontend == 'apache' and not
|
radosgw_frontend == 'apache' and not
|
||||||
ceph_containerized_deployment
|
ceph_containerized_deployment
|
||||||
|
|
||||||
- name: install Rados Gateway
|
- name: install rados gateway
|
||||||
apt: >
|
apt: >
|
||||||
pkg=radosgw
|
pkg=radosgw
|
||||||
state=present
|
state=present
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
ansible_os_family == 'Debian' and not
|
ansible_os_family == 'Debian' and not
|
||||||
ceph_containerized_deployment
|
ceph_containerized_deployment
|
||||||
|
|
||||||
- name: install Rados Gateway
|
- name: install rados gateway
|
||||||
yum: >
|
yum: >
|
||||||
name=ceph-radosgw
|
name=ceph-radosgw
|
||||||
state=present
|
state=present
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: create nss directory for Keystone certificates
|
- name: create nss directory for keystone certificates
|
||||||
file: >
|
file: >
|
||||||
path={{ radosgw_nss_db_path }}
|
path={{ radosgw_nss_db_path }}
|
||||||
state=directory
|
state=directory
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
group=root
|
group=root
|
||||||
mode=0644
|
mode=0644
|
||||||
|
|
||||||
- name: create nss entries for Keystone certificates
|
- name: create nss entries for keystone certificates
|
||||||
shell: "{{ item }}"
|
shell: "{{ item }}"
|
||||||
with_items:
|
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'"
|
- "openssl x509 -in /etc/keystone/ssl/certs/ca.pem -pubkey |certutil -d {{ radosgw_nss_db_path }} -A -n ca -t 'TCu,Cu,Tuw'"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: create RGW directories
|
- name: create rgw directories
|
||||||
file: >
|
file: >
|
||||||
path={{ item }}
|
path={{ item }}
|
||||||
state=directory
|
state=directory
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
- /var/lib/ceph/bootstrap-rgw
|
- /var/lib/ceph/bootstrap-rgw
|
||||||
- /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
|
- /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
|
||||||
|
|
||||||
- name: copy RGW bootstrap key
|
- name: copy rgw bootstrap key
|
||||||
copy: >
|
copy: >
|
||||||
src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring
|
src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring
|
||||||
dest=/var/lib/ceph/bootstrap-rgw/ceph.keyring
|
dest=/var/lib/ceph/bootstrap-rgw/ceph.keyring
|
||||||
|
@ -19,14 +19,14 @@
|
||||||
mode=600
|
mode=600
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: create RGW keyring
|
- name: create rgw keyring
|
||||||
command: >
|
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
|
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
|
creates=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: set RGW key permissions
|
- name: set rgw key permissions
|
||||||
file: >
|
file: >
|
||||||
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
|
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
|
||||||
mode=0600
|
mode=0600
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
group=root
|
group=root
|
||||||
when: cephx
|
when: cephx
|
||||||
|
|
||||||
- name: activate RGW with upstart
|
- name: activate rgw with upstart
|
||||||
file: >
|
file: >
|
||||||
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }}
|
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }}
|
||||||
state=touch
|
state=touch
|
||||||
|
@ -46,3 +46,17 @@
|
||||||
- upstart
|
- upstart
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
|
- name: activate rgw 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"
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,27 @@
|
||||||
---
|
---
|
||||||
- name: check if RGW is started
|
- name: check if rgw is started
|
||||||
command: /etc/init.d/radosgw status
|
command: /etc/init.d/radosgw status
|
||||||
register: rgwstatus
|
register: rgwstatus
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: start RGW
|
- name: start rgw
|
||||||
command: /etc/init.d/radosgw start
|
command: /etc/init.d/radosgw start
|
||||||
when:
|
when:
|
||||||
rgwstatus.rc != 0 and
|
rgwstatus.rc != 0 and
|
||||||
ansible_distribution != "Ubuntu" and
|
ansible_distribution != "Ubuntu" and
|
||||||
ansible_os_family != 'RedHat'
|
ansible_os_family != 'RedHat'
|
||||||
|
|
||||||
- name: start RGW
|
- name: start rgw
|
||||||
service: >
|
service: >
|
||||||
name=radosgw-all
|
name=radosgw-all
|
||||||
state=started
|
state=started
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
- name: start RGW
|
- name: activate rgw service
|
||||||
|
command: systemctl enable ceph-radosgw.service
|
||||||
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
|
- name: start rgw
|
||||||
service: >
|
service: >
|
||||||
name=ceph-radosgw
|
name=ceph-radosgw
|
||||||
state=started
|
state=started
|
||||||
|
|
Loading…
Reference in New Issue