From dedb7cfd969317b4266973d40f8ffc1171c53ba2 Mon Sep 17 00:00:00 2001 From: Michael Sambol Date: Sun, 18 Oct 2015 22:19:31 -0500 Subject: [PATCH] Refactor rgw --- roles/ceph-rgw/tasks/docker/fetch_configs.yml | 12 +-- roles/ceph-rgw/tasks/docker/pre_requisite.yml | 12 +-- .../tasks/docker/start_docker_rgw.yml | 16 ++-- roles/ceph-rgw/tasks/openstack-keystone.yml | 12 +-- roles/ceph-rgw/tasks/pre_requisite.yml | 76 +++++++++---------- roles/ceph-rgw/tasks/start_radosgw.yml | 16 ++-- 6 files changed, 72 insertions(+), 72 deletions(-) diff --git a/roles/ceph-rgw/tasks/docker/fetch_configs.yml b/roles/ceph-rgw/tasks/docker/fetch_configs.yml index 64b0258fe..2da6ce8a2 100644 --- a/roles/ceph-rgw/tasks/docker/fetch_configs.yml +++ b/roles/ceph-rgw/tasks/docker/fetch_configs.yml @@ -14,12 +14,12 @@ register: statconfig - name: try to fetch ceph config and keys - copy: > - src={{ fetch_directory }}/docker_mon_files/{{ item.0 }} - dest={{ item.0 }} - owner=root - group=root - mode=644 + copy: + src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}" + dest: "{{ item.0 }}" + owner: root + group: root + mode: 644 changed_when: false with_together: - ceph_config_keys diff --git a/roles/ceph-rgw/tasks/docker/pre_requisite.yml b/roles/ceph-rgw/tasks/docker/pre_requisite.yml index 99704d7e5..ddd26ea7d 100644 --- a/roles/ceph-rgw/tasks/docker/pre_requisite.yml +++ b/roles/ceph-rgw/tasks/docker/pre_requisite.yml @@ -1,11 +1,11 @@ --- - name: create rgw bootstrap directory - file: > - path=/var/lib/ceph/bootstrap-rgw - state=directory + file: + path: /var/lib/ceph/bootstrap-rgw + state: directory # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227 - name: install docker-py - pip: > - name=docker-py - version=1.1.0 + pip: + name: docker-py + version: 1.1.0 diff --git a/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml b/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml index 8dcb094b5..65781fbba 100644 --- a/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml +++ b/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml @@ -1,10 +1,10 @@ --- - name: run the rados gateway docker image - docker: > - image="{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}" - name=ceph-{{ ansible_hostname }}-rgw - expose={{ ceph_rgw_civetweb_port }} - ports="{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}" - state=running - env="CEPH_DAEMON=RGW,{{ ceph_rgw_docker_extra_env }}" - volumes="/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph" + docker: + image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}" + name: ceph-{{ ansible_hostname }}-rgw + expose=: "{{ ceph_rgw_civetweb_port }}" + ports: "{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}" + state: running + env=: "CEPH_DAEMON=RGW,{{ ceph_rgw_docker_extra_env }}" + volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph" diff --git a/roles/ceph-rgw/tasks/openstack-keystone.yml b/roles/ceph-rgw/tasks/openstack-keystone.yml index 24306c2d8..770782015 100644 --- a/roles/ceph-rgw/tasks/openstack-keystone.yml +++ b/roles/ceph-rgw/tasks/openstack-keystone.yml @@ -1,11 +1,11 @@ --- - name: create nss directory for keystone certificates - file: > - path={{ radosgw_nss_db_path }} - state=directory - owner=root - group=root - mode=0644 + file: + path: "{{ radosgw_nss_db_path }}" + state: directory + owner: root + group: root + mode: 0644 - name: create nss entries for keystone certificates shell: "{{ item }}" diff --git a/roles/ceph-rgw/tasks/pre_requisite.yml b/roles/ceph-rgw/tasks/pre_requisite.yml index 3bafff17d..fb15a3788 100644 --- a/roles/ceph-rgw/tasks/pre_requisite.yml +++ b/roles/ceph-rgw/tasks/pre_requisite.yml @@ -1,46 +1,46 @@ --- - name: create rados gateway directories - file: > - path={{ item }} - state=directory - owner=root - group=root - mode=0644 + file: + path: "{{ item }}" + state: directory + owner: root + group: root + mode: 0644 with_items: - /var/lib/ceph/bootstrap-rgw - /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }} - name: copy rados gateway bootstrap key - copy: > - src={{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring - dest=/var/lib/ceph/bootstrap-rgw/ceph.keyring - owner=root - group=root - mode=600 + copy: + src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring" + dest: /var/lib/ceph/bootstrap-rgw/ceph.keyring + owner: root + group: root + mode: 600 when: cephx - 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 + 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 + args: + creates: /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring changed_when: false when: cephx - name: set rados gateway key permissions - file: > - path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring - mode=0600 - owner=root - group=root + file: + path: /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring + mode: 0600 + owner: root + group: root when: cephx - name: activate rados gateway with upstart - file: > - path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }} - state=touch - owner=root - group=root - mode=0644 + file: + path: /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }} + state: touch + owner: root + group: root + mode: 0644 with_items: - done - upstart @@ -48,12 +48,12 @@ 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 + file: + path: /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }} + state: touch + owner: root + group: root + mode: 0644 with_items: - done - sysvinit @@ -61,10 +61,10 @@ 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 + template: + src: ceph.j2 + dest: /etc/sudoers.d/ceph + owner: root + group: root + mode: 0400 when: ansible_distribution != "Ubuntu" diff --git a/roles/ceph-rgw/tasks/start_radosgw.yml b/roles/ceph-rgw/tasks/start_radosgw.yml index f67ed9299..b5294df45 100644 --- a/roles/ceph-rgw/tasks/start_radosgw.yml +++ b/roles/ceph-rgw/tasks/start_radosgw.yml @@ -18,15 +18,15 @@ when: ansible_distribution == 'Ubuntu' - name: start rgw on ubuntu - service: > - name=radosgw - args=id=rgw.{{ ansible_hostname }} - state=started + service: + name: radosgw + args: id=rgw.{{ ansible_hostname }} + state: started when: ansible_distribution == 'Ubuntu' - name: start rgw on red hat - service: > - name=ceph-radosgw - state=started - enabled=yes + service: + name: ceph-radosgw + state: started + enabled: yes when: ansible_distribution == 'RedHat'