From: leseb Date: Tue, 7 Jul 2015 11:48:37 +0000 (+0200) Subject: Activate rgws on rhel7 X-Git-Tag: v1.0.0~174^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fd2515f9c535557aada57724ef904ca81bc72bf1;p=ceph-ansible.git Activate rgws on rhel7 Signed-off-by: leseb --- diff --git a/group_vars/rgws b/group_vars/rgws index 9e085b531..9f6c9a616 100644 --- a/group_vars/rgws +++ b/group_vars/rgws @@ -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 diff --git a/roles/ceph-radosgw/defaults/main.yml b/roles/ceph-radosgw/defaults/main.yml index 0db6f633c..6bb65fe4f 100644 --- a/roles/ceph-radosgw/defaults/main.yml +++ b/roles/ceph-radosgw/defaults/main.yml @@ -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 diff --git a/roles/ceph-radosgw/tasks/pre_requisite.yml b/roles/ceph-radosgw/tasks/pre_requisite.yml index fec0ed0f2..7710546b3 100644 --- a/roles/ceph-radosgw/tasks/pre_requisite.yml +++ b/roles/ceph-radosgw/tasks/pre_requisite.yml @@ -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 @@ -47,7 +47,7 @@ changed_when: false when: ansible_distribution == "Ubuntu" -- name: activate rgw with sysvinit +- name: activate rados gateway with sysvinit file: > path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }} state=touch @@ -60,3 +60,11 @@ 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" diff --git a/roles/ceph-radosgw/tasks/start_radosgw.yml b/roles/ceph-radosgw/tasks/start_radosgw.yml index 4781d5abf..b9c34cc1b 100644 --- a/roles/ceph-radosgw/tasks/start_radosgw.yml +++ b/roles/ceph-radosgw/tasks/start_radosgw.yml @@ -11,19 +11,15 @@ 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" - -- name: activate rgw service - command: systemctl enable ceph-radosgw.service - when: ansible_os_family == 'RedHat' + 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' diff --git a/roles/ceph-radosgw/templates/ceph.j2 b/roles/ceph-radosgw/templates/ceph.j2 new file mode 100644 index 000000000..d0d31dc00 --- /dev/null +++ b/roles/ceph-radosgw/templates/ceph.j2 @@ -0,0 +1,2 @@ +# {{ ansible_managed }} +Defaults:{{ radosgw_user }} !requiretty