From f1e6b0216d1ea5dd509e7d6704f9b4c92083814a Mon Sep 17 00:00:00 2001 From: leseb Date: Thu, 23 Jul 2015 20:01:43 +0200 Subject: [PATCH] Re-arrange roles Trying to add more clarity in the role's task structure. Signed-off-by: leseb --- .../{ => checks}/check_mandatory_vars.yml | 0 .../{os_check.yml => checks/check_system.yml} | 0 .../{ => installs}/install_on_debian.yml | 20 ++++++++-------- .../{ => installs}/install_on_redhat.yml | 14 +++++------ roles/ceph-common/tasks/main.yml | 24 +++++++++---------- .../{os_tuning.yml => misc/system_tuning.yml} | 4 ++-- .../{ => pre_requisites}/prerequisite_ice.yml | 12 +++++----- .../prerequisite_rh_storage_cdn_install.yml | 0 .../prerequisite_rh_storage_iso_install.yml | 0 roles/ceph-mds/tasks/docker.yml | 4 ++-- roles/ceph-mds/tasks/pre_requisite.yml | 10 ++++---- roles/ceph-mon/tasks/ceph_keys.yml | 4 ++-- .../ceph-mon/tasks/create_mds_filesystems.yml | 2 +- roles/ceph-mon/tasks/docker.yml | 8 +++---- roles/ceph-mon/tasks/openstack_config.yml | 4 ++-- roles/ceph-mon/tasks/secure_cluster.yml | 2 +- roles/ceph-mon/tasks/start_monitor.yml | 4 ++-- roles/ceph-osd/tasks/activate_osds.yml | 6 ++--- roles/ceph-osd/tasks/main.yml | 8 +++---- roles/ceph-osd/tasks/osd_fragment.yml | 12 +++++----- roles/ceph-osd/tasks/pre_requisite.yml | 2 +- .../ceph-osd/tasks/{ => scenarios}/docker.yml | 6 ++--- .../{ => scenarios}/journal_collocation.yml | 10 ++++---- .../tasks/{ => scenarios}/osd_directory.yml | 2 +- .../{ => scenarios}/raw_multi_journal.yml | 8 +++---- roles/ceph-osd/tasks/zap_devices.yml | 2 +- roles/ceph-radosgw/tasks/docker.yml | 4 ++-- .../tasks/{ => installs}/install_debian.yml | 0 .../tasks/{ => installs}/install_redhat.yml | 0 roles/ceph-radosgw/tasks/main.yml | 4 ++-- roles/ceph-restapi/tasks/docker.yml | 8 +++---- roles/ceph-restapi/tasks/pre_requisite.yml | 8 +++---- roles/ceph-restapi/tasks/start_restapi.yml | 4 ++-- 33 files changed, 98 insertions(+), 98 deletions(-) rename roles/ceph-common/tasks/{ => checks}/check_mandatory_vars.yml (100%) rename roles/ceph-common/tasks/{os_check.yml => checks/check_system.yml} (100%) rename roles/ceph-common/tasks/{ => installs}/install_on_debian.yml (76%) rename roles/ceph-common/tasks/{ => installs}/install_on_redhat.yml (89%) rename roles/ceph-common/tasks/{os_tuning.yml => misc/system_tuning.yml} (86%) rename roles/ceph-common/tasks/{ => pre_requisites}/prerequisite_ice.yml (88%) rename roles/ceph-common/tasks/{ => pre_requisites}/prerequisite_rh_storage_cdn_install.yml (100%) rename roles/ceph-common/tasks/{ => pre_requisites}/prerequisite_rh_storage_iso_install.yml (100%) rename roles/ceph-osd/tasks/{ => scenarios}/docker.yml (91%) rename roles/ceph-osd/tasks/{ => scenarios}/journal_collocation.yml (83%) rename roles/ceph-osd/tasks/{ => scenarios}/osd_directory.yml (96%) rename roles/ceph-osd/tasks/{ => scenarios}/raw_multi_journal.yml (84%) rename roles/ceph-radosgw/tasks/{ => installs}/install_debian.yml (100%) rename roles/ceph-radosgw/tasks/{ => installs}/install_redhat.yml (100%) diff --git a/roles/ceph-common/tasks/check_mandatory_vars.yml b/roles/ceph-common/tasks/checks/check_mandatory_vars.yml similarity index 100% rename from roles/ceph-common/tasks/check_mandatory_vars.yml rename to roles/ceph-common/tasks/checks/check_mandatory_vars.yml diff --git a/roles/ceph-common/tasks/os_check.yml b/roles/ceph-common/tasks/checks/check_system.yml similarity index 100% rename from roles/ceph-common/tasks/os_check.yml rename to roles/ceph-common/tasks/checks/check_system.yml diff --git a/roles/ceph-common/tasks/install_on_debian.yml b/roles/ceph-common/tasks/installs/install_on_debian.yml similarity index 76% rename from roles/ceph-common/tasks/install_on_debian.yml rename to roles/ceph-common/tasks/installs/install_on_debian.yml index db323a977..df129b0a5 100644 --- a/roles/ceph-common/tasks/install_on_debian.yml +++ b/roles/ceph-common/tasks/installs/install_on_debian.yml @@ -10,46 +10,46 @@ - ntp - hdparm -- name: install the Ceph repository stable key +- name: install the ceph repository stable key apt_key: > - data="{{ lookup('file', 'cephstable.asc') }}" + data="{{ lookup('file', '../../files/cephstable.asc') }}" state=present when: ceph_stable -- name: install the Ceph development repository key +- name: install the ceph development repository key apt_key: > - data="{{ lookup('file', 'cephdev.asc') }}" + data="{{ lookup('file', '../../files/cephdev.asc') }}" state=present when: ceph_dev -- name: install Intank Ceph Enterprise repository key +- name: install intank ceph enterprise repository key apt_key: > - data="{{ lookup('file', 'cephstableice.asc') }}" + data="{{ lookup('file', '../../files/cephstableice.asc') }}" state=present when: ceph_stable_ice -- name: add Ceph stable repository +- name: add ceph stable repository apt_repository: > repo="deb http://ceph.com/debian-{{ ceph_stable_release }}/ {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main" state=present changed_when: false when: ceph_stable -- name: add Ceph development repository +- name: add ceph development 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" state=present changed_when: false when: ceph_dev -- name: add Inktank Ceph Enterprise repository +- name: add inktank ceph enterprise repository apt_repository: > repo="deb file://{{ ceph_stable_ice_temp_path }} {{ ansible_lsb.codename }} main" state=present changed_when: false when: ceph_stable_ice -- name: install Ceph +- name: install ceph apt: > pkg={{ item }} state=present diff --git a/roles/ceph-common/tasks/install_on_redhat.yml b/roles/ceph-common/tasks/installs/install_on_redhat.yml similarity index 89% rename from roles/ceph-common/tasks/install_on_redhat.yml rename to roles/ceph-common/tasks/installs/install_on_redhat.yml index 57ce50153..d8fbfe6f8 100644 --- a/roles/ceph-common/tasks/install_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_on_redhat.yml @@ -10,19 +10,19 @@ - yum-plugin-priorities.noarch - epel-release -- name: install the Ceph stable repository key +- name: install the ceph stable repository key rpm_key: > key={{ ceph_stable_key }} state=present when: ceph_stable -- name: install the Ceph development repository key +- name: install the ceph development repository key rpm_key: > key={{ ceph_dev_key }} state=present when: ceph_dev -- name: install Inktank Ceph Enterprise repository key +- name: install inktank ceph enterprise repository key rpm_key: > key={{ ceph_stable_ice_temp_path }}/release.asc state=present @@ -36,17 +36,17 @@ ceph_stable_rh_storage and 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 changed_when: false 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 changed_when: false when: ceph_dev -- name: add Inktank Ceph Enterprise repository +- name: add inktank ceph enterprise repository template: > src=redhat_ice_repo.j2 dest=/etc/yum.repos.d/ice.repo @@ -66,7 +66,7 @@ ceph_stable_rh_storage and ceph_stable_rh_storage_iso_install -- name: install Ceph +- name: install ceph yum: > name=ceph state=present diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index cefe1e50f..55fd15860 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -1,31 +1,31 @@ --- -- include: os_check.yml +- include: ./checks/check_system.yml -- include: check_mandatory_vars.yml +- include: ./checks/check_mandatory_vars.yml -- include: os_tuning.yml +- include: ./misc/system_tuning.yml when: osd_group_name in group_names -- include: prerequisite_ice.yml +- include: ./pre_requisites/prerequisite_ice.yml when: ceph_stable_ice -- include: prerequisite_rh_storage_iso_install.yml +- include: ./pre_requisites/prerequisite_rh_storage_iso_install.yml when: ceph_stable_rh_storage and ceph_stable_rh_storage_iso_install -- include: prerequisite_rh_storage_cdn_install.yml +- include: ./pre_requisites/prerequisite_rh_storage_cdn_install.yml when: ceph_stable_rh_storage and ceph_stable_rh_storage_cdn_install -- include: install_on_redhat.yml +- include: ./installs/install_on_redhat.yml when: ansible_os_family == 'RedHat' -- include: install_on_debian.yml +- include: ./installs/install_on_debian.yml when: ansible_os_family == 'Debian' -- name: check for a Ceph socket +- name: check for a ceph socket shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1" changed_when: false ignore_errors: true @@ -37,14 +37,14 @@ ignore_errors: true register: socketrgw -- name: generate cluster UUID +- name: generate cluster uuid local_action: shell uuidgen | tee fetch/ceph_cluster_uuid.conf creates=fetch/ceph_cluster_uuid.conf register: cluster_uuid sudo: false 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/ceph_cluster_uuid.conf removes=fetch/ceph_cluster_uuid.conf changed_when: false @@ -52,7 +52,7 @@ sudo: false when: fsid != '4a158d27-f750-41d5-9e7f-26ce4c9d2d45' -- name: generate Ceph configuration file +- name: generate ceph configuration file template: > src=ceph.conf.j2 dest=/etc/ceph/ceph.conf diff --git a/roles/ceph-common/tasks/os_tuning.yml b/roles/ceph-common/tasks/misc/system_tuning.yml similarity index 86% rename from roles/ceph-common/tasks/os_tuning.yml rename to roles/ceph-common/tasks/misc/system_tuning.yml index 8e8e61f8a..8717a6ce6 100644 --- a/roles/ceph-common/tasks/os_tuning.yml +++ b/roles/ceph-common/tasks/misc/system_tuning.yml @@ -1,5 +1,5 @@ --- -- name: disable OSD directory parsing by updatedb +- name: disable osd directory parsing by updatedb command: updatedb -e /var/lib/ceph changed_when: false ignore_errors: true @@ -16,7 +16,7 @@ ignore_errors: true when: disable_swap -- name: apply OS tuning +- name: apply operating system tuning sysctl: > name={{ item.name }} value={{ item.value }} diff --git a/roles/ceph-common/tasks/prerequisite_ice.yml b/roles/ceph-common/tasks/pre_requisites/prerequisite_ice.yml similarity index 88% rename from roles/ceph-common/tasks/prerequisite_ice.yml rename to roles/ceph-common/tasks/pre_requisites/prerequisite_ice.yml index d03f33e31..d723e6037 100644 --- a/roles/ceph-common/tasks/prerequisite_ice.yml +++ b/roles/ceph-common/tasks/pre_requisites/prerequisite_ice.yml @@ -1,5 +1,5 @@ --- -- name: create ICE package directory +- name: create ice package directory file: > path={{ ceph_stable_ice_temp_path }} state=directory @@ -8,7 +8,7 @@ mode=0644 when: ceph_stable_ice -- name: get ICE packages +- name: get ice packages get_url: > url_username={{ ceph_stable_ice_user }} url_password={{ ceph_stable_ice_password }} @@ -16,7 +16,7 @@ dest={{ ceph_stable_ice_temp_path }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz when: ceph_stable_ice -- name: get ICE Kernel Modules +- name: get ice Kernel Modules get_url: > url_username={{ ceph_stable_ice_user }} url_password={{ ceph_stable_ice_password }} @@ -29,13 +29,13 @@ ceph_stable_ice and ansible_os_family == 'RedHat' -- name: stat extracted ICE repo files +- name: stat extracted ice repo files stat: > path={{ ceph_stable_ice_temp_path }}/ice_setup.py register: repo_exist when: ceph_stable_ice -- name: extract ICE packages +- name: extract ice packages shell: > tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz chdir={{ ceph_stable_ice_temp_path }} @@ -44,7 +44,7 @@ ceph_stable_ice and repo_exist.stat.exists == False -- name: move ICE extracted packages +- name: move ice extracted packages shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}" changed_when: false when: diff --git a/roles/ceph-common/tasks/prerequisite_rh_storage_cdn_install.yml b/roles/ceph-common/tasks/pre_requisites/prerequisite_rh_storage_cdn_install.yml similarity index 100% rename from roles/ceph-common/tasks/prerequisite_rh_storage_cdn_install.yml rename to roles/ceph-common/tasks/pre_requisites/prerequisite_rh_storage_cdn_install.yml diff --git a/roles/ceph-common/tasks/prerequisite_rh_storage_iso_install.yml b/roles/ceph-common/tasks/pre_requisites/prerequisite_rh_storage_iso_install.yml similarity index 100% rename from roles/ceph-common/tasks/prerequisite_rh_storage_iso_install.yml rename to roles/ceph-common/tasks/pre_requisites/prerequisite_rh_storage_iso_install.yml diff --git a/roles/ceph-mds/tasks/docker.yml b/roles/ceph-mds/tasks/docker.yml index d0cb7ac5f..a598de070 100644 --- a/roles/ceph-mds/tasks/docker.yml +++ b/roles/ceph-mds/tasks/docker.yml @@ -13,14 +13,14 @@ name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227 -- name: stat for Ceph config and keys +- name: stat for ceph config and keys stat: > path={{ item }} with_items: ceph_config_keys ignore_errors: true register: statconfig -- name: try to fetch Ceph config and keys +- name: try to fetch ceph config and keys copy: > src=fetch/docker_mon_files/"{{ item }}" dest=/etc/ceph/ diff --git a/roles/ceph-mds/tasks/pre_requisite.yml b/roles/ceph-mds/tasks/pre_requisite.yml index d7412ae43..177eda371 100644 --- a/roles/ceph-mds/tasks/pre_requisite.yml +++ b/roles/ceph-mds/tasks/pre_requisite.yml @@ -1,7 +1,7 @@ --- # Deploy Ceph metadata server(s) -- name: copy MDS bootstrap key +- name: copy mds bootstrap key copy: > src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-mds/ceph.keyring dest=/var/lib/ceph/bootstrap-mds/ceph.keyring @@ -10,7 +10,7 @@ mode=600 when: cephx -- name: create MDS directory +- name: create mds directory file: > path=/var/lib/ceph/mds/ceph-{{ ansible_hostname }} state=directory @@ -19,14 +19,14 @@ mode=0644 when: cephx -- name: create MDS keyring +- name: create mds keyring command: > ceph --cluster ceph --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/ceph.keyring auth get-or-create mds.{{ ansible_hostname }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring creates=/var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring changed_when: false when: cephx -- name: set MDS key permissions +- name: set mds key permissions file: > path=/var/lib/ceph/mds/ceph-{{ ansible_hostname }}/keyring mode=0600 @@ -60,7 +60,7 @@ changed_when: false when: ansible_distribution != "Ubuntu" -- name: start and add that the metadata service to the init sequence (Ubuntu) +- name: start and add that the metadata service to the init sequence (ubuntu) service: > name=ceph-mds state=started diff --git a/roles/ceph-mon/tasks/ceph_keys.yml b/roles/ceph-mon/tasks/ceph_keys.yml index 7465db5af..6b616a58c 100644 --- a/roles/ceph-mon/tasks/ceph_keys.yml +++ b/roles/ceph-mon/tasks/ceph_keys.yml @@ -4,7 +4,7 @@ - name: wait for client.admin key exists wait_for: path=/etc/ceph/ceph.client.admin.keyring -- name: create Ceph REST API keyring +- name: create ceph rest api keyring command: > ceph auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/ceph.client.restapi.keyring creates=/etc/ceph/ceph.client.restapi.keyring @@ -18,7 +18,7 @@ openstack_config and cephx -- name: find Ceph keys +- name: find ceph keys shell: ls -1 /etc/ceph/*.keyring changed_when: false register: ceph_keys diff --git a/roles/ceph-mon/tasks/create_mds_filesystems.yml b/roles/ceph-mon/tasks/create_mds_filesystems.yml index 2a917ceb4..c47e0941a 100644 --- a/roles/ceph-mon/tasks/create_mds_filesystems.yml +++ b/roles/ceph-mon/tasks/create_mds_filesystems.yml @@ -11,7 +11,7 @@ changed_when: false when: not {{ ceph_version.stdout | version_compare('0.84', '<') }} -- name: create Ceph Filesystem +- name: create ceph filesystem command: ceph fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }} changed_when: false when: not {{ ceph_version.stdout | version_compare('0.84', '<') }} diff --git a/roles/ceph-mon/tasks/docker.yml b/roles/ceph-mon/tasks/docker.yml index a920f1658..f74e29d6c 100644 --- a/roles/ceph-mon/tasks/docker.yml +++ b/roles/ceph-mon/tasks/docker.yml @@ -12,14 +12,14 @@ name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227 -- name: stat for Ceph config and keys +- name: stat for ceph config and keys stat: > path={{ item }} with_items: ceph_config_keys ignore_errors: true register: statconfig -- name: try to fetch Ceph config and keys +- name: try to fetch ceph config and keys copy: > src=fetch/docker_mon_files/"{{ item }}" dest=/etc/ceph/ @@ -31,7 +31,7 @@ - statconfig.results when: item.1.stat.exists == False -- name: run the Ceph Monitor docker image +- name: run the ceph Monitor docker image docker: > image="{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}" name=ceph-{{ ansible_hostname }} @@ -48,7 +48,7 @@ detach=yes state=running -- name: collect Ceph files to the Ansible server +- name: collect ceph files to the ansible server fetch: > src={{ item }} dest=fetch/docker_mon_files/{{ item }} diff --git a/roles/ceph-mon/tasks/openstack_config.yml b/roles/ceph-mon/tasks/openstack_config.yml index 1bfdf4582..58b46fd36 100644 --- a/roles/ceph-mon/tasks/openstack_config.yml +++ b/roles/ceph-mon/tasks/openstack_config.yml @@ -1,5 +1,5 @@ --- -- name: create OpenStack pool +- name: create openstack pool command: rados mkpool {{ item }} with_items: - "{{ openstack_glance_pool }}" @@ -9,7 +9,7 @@ changed_when: false ignore_errors: true -- name: create OpenStack keys +- name: create openstack keys command: > ceph auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/ceph.{{ item.name }}.keyring creates=/etc/ceph/ceph.{{ item.name }}.keyring diff --git a/roles/ceph-mon/tasks/secure_cluster.yml b/roles/ceph-mon/tasks/secure_cluster.yml index 6e5f6cc37..8bf7a63e6 100644 --- a/roles/ceph-mon/tasks/secure_cluster.yml +++ b/roles/ceph-mon/tasks/secure_cluster.yml @@ -1,5 +1,5 @@ --- -- name: collect all the pool +- name: collect all the pools command: rados lspools register: ceph_pools when: "{{ ceph_version.stdout | version_compare('0.94', '>=') }}" diff --git a/roles/ceph-mon/tasks/start_monitor.yml b/roles/ceph-mon/tasks/start_monitor.yml index 62937a21f..1d829d239 100644 --- a/roles/ceph-mon/tasks/start_monitor.yml +++ b/roles/ceph-mon/tasks/start_monitor.yml @@ -12,7 +12,7 @@ when: ansible_distribution == "Ubuntu" changed_when: false -- name: start and add that the monitor service to the init sequence (Ubuntu) +- name: start and add that the monitor service to the init sequence (ubuntu) service: > name=ceph-mon state=started @@ -33,7 +33,7 @@ failed_when: false when: ansible_os_family == 'RedHat' -- name: get Ceph monitor version +- name: get ceph monitor version shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.' changed_when: false register: ceph_version diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index a1d12e88f..d638c2a9b 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -1,7 +1,7 @@ --- # NOTE (leseb) : this task is for disk devices only because of the explicit use of the first # partition. -- name: activate OSD(s) when device is a disk +- name: activate osd(s) when device is a disk command: | ceph-disk activate {{ item.2 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1 with_together: @@ -15,7 +15,7 @@ item.1.rc != 0 # NOTE (leseb): this task is for partitions because we don't explicitly use a partition. -- name: activate OSD(s) when device is a partition +- name: activate osd(s) when device is a partition command: "ceph-disk activate {{ item.1 }}" with_together: - ispartition.results @@ -27,7 +27,7 @@ - include: osd_fragment.yml when: crush_location -- name: start and add that the OSD service to the init sequence +- name: start and add that the osd service(s) to the init sequence service: > name=ceph state=started diff --git a/roles/ceph-osd/tasks/main.yml b/roles/ceph-osd/tasks/main.yml index fca779bb5..c092f933e 100644 --- a/roles/ceph-osd/tasks/main.yml +++ b/roles/ceph-osd/tasks/main.yml @@ -3,14 +3,14 @@ - include: pre_requisite.yml when: not ceph_containerized_deployment -- include: journal_collocation.yml +- include: ./scenarios/journal_collocation.yml when: journal_collocation and not ceph_containerized_deployment -- include: raw_multi_journal.yml +- include: ./scenarios/raw_multi_journal.yml when: raw_multi_journal and not ceph_containerized_deployment -- include: osd_directory.yml +- include: ./scenarios/osd_directory.yml when: osd_directory and not ceph_containerized_deployment -- include: docker.yml +- include: ./scenarios/docker.yml when: ceph_containerized_deployment diff --git a/roles/ceph-osd/tasks/osd_fragment.yml b/roles/ceph-osd/tasks/osd_fragment.yml index 13ac57c89..9c66da05c 100644 --- a/roles/ceph-osd/tasks/osd_fragment.yml +++ b/roles/ceph-osd/tasks/osd_fragment.yml @@ -1,19 +1,19 @@ --- -- name: get OSD path +- name: get osd path shell: "df | grep {{ item }} | awk '{print $6}'" with_items: devices changed_when: false ignore_errors: true register: osd_path -- name: get OSD id +- name: get osd id command: cat {{ item.stdout }}/whoami with_items: osd_path.results changed_when: false ignore_errors: true register: osd_id -- name: create a Ceph fragment and assemble directory +- name: create a ceph fragment and assemble directory file: > path={{ item }} state=directory @@ -24,7 +24,7 @@ - /etc/ceph/ceph.d/ - /etc/ceph/ceph.d/osd_fragments -- name: create the OSD fragment +- name: create the osd fragment template: > src=osd.conf.j2 dest=/etc/ceph/ceph.d/osd_fragments/osd.{{ item.stdout }}.conf @@ -34,7 +34,7 @@ command: cp /etc/ceph/ceph.conf /etc/ceph/ceph.d/ changed_when: false -- name: assemble OSD sections +- name: assemble osd sections assemble: > src=/etc/ceph/ceph.d/osd_fragments/ dest=/etc/ceph/ceph.d/osd.conf @@ -42,7 +42,7 @@ group=root mode=0644 -- name: assemble Ceph conf and OSD fragments +- name: assemble ceph conf and osd fragments assemble: > src=/etc/ceph/ceph.d/ dest=/etc/ceph/ceph.conf diff --git a/roles/ceph-osd/tasks/pre_requisite.yml b/roles/ceph-osd/tasks/pre_requisite.yml index 0153625e7..61dd65d3f 100644 --- a/roles/ceph-osd/tasks/pre_requisite.yml +++ b/roles/ceph-osd/tasks/pre_requisite.yml @@ -11,7 +11,7 @@ state=present when: ansible_os_family == 'RedHat' -- name: copy OSD bootstrap key +- name: copy osd bootstrap key copy: > src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring dest=/var/lib/ceph/bootstrap-osd/ceph.keyring diff --git a/roles/ceph-osd/tasks/docker.yml b/roles/ceph-osd/tasks/scenarios/docker.yml similarity index 91% rename from roles/ceph-osd/tasks/docker.yml rename to roles/ceph-osd/tasks/scenarios/docker.yml index 1d9fdad7a..97a5a679c 100644 --- a/roles/ceph-osd/tasks/docker.yml +++ b/roles/ceph-osd/tasks/scenarios/docker.yml @@ -13,14 +13,14 @@ name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227 -- name: stat for Ceph config and keys +- name: stat for ceph config and keys stat: > path={{ item }} with_items: ceph_config_keys ignore_errors: true register: statconfig -- name: try to fetch Ceph config and keys +- name: try to fetch ceph config and keys copy: > src=fetch/docker_mon_files/"{{ item }}" dest=/etc/ceph/ @@ -32,7 +32,7 @@ - statconfig.results when: item.1.stat.exists == False -- name: run the Ceph OSD docker image +- name: run the ceph osd docker image docker: > image="{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}" name={{ ansible_hostname }}-osd-{{ item | regex_replace('/', '') }} diff --git a/roles/ceph-osd/tasks/journal_collocation.yml b/roles/ceph-osd/tasks/scenarios/journal_collocation.yml similarity index 83% rename from roles/ceph-osd/tasks/journal_collocation.yml rename to roles/ceph-osd/tasks/scenarios/journal_collocation.yml index 394e49ecb..6a425c4e1 100644 --- a/roles/ceph-osd/tasks/journal_collocation.yml +++ b/roles/ceph-osd/tasks/scenarios/journal_collocation.yml @@ -1,8 +1,8 @@ --- ## SCENARIO 1: JOURNAL AND OSD_DATA ON THE SAME DEVICE -- include: check_devices.yml -- include: zap_devices.yml +- include: ../check_devices.yml +- include: ../zap_devices.yml # NOTE (leseb): the prepare process must be parallelized somehow... # if you have 64 disks with 4TB each, this will take a while @@ -10,7 +10,7 @@ # NOTE (alahouze): if the device is a partition, the parted command below has # failed, this is why we check if the device is a partition too. -- name: automatic prepare OSD disk(s) without partitions +- name: automatic prepare osd disk(s) without partitions command: ceph-disk prepare "/dev/{{ item.key }}" ignore_errors: true register: prepared_osds @@ -22,7 +22,7 @@ journal_collocation and osd_auto_discovery -- name: manually Prepare OSD disk(s) +- name: manually Prepare osd disk(s) command: "ceph-disk prepare {{ item.2 }}" ignore_errors: true with_together: @@ -35,4 +35,4 @@ journal_collocation and not osd_auto_discovery -- include: activate_osds.yml +- include: ../activate_osds.yml diff --git a/roles/ceph-osd/tasks/osd_directory.yml b/roles/ceph-osd/tasks/scenarios/osd_directory.yml similarity index 96% rename from roles/ceph-osd/tasks/osd_directory.yml rename to roles/ceph-osd/tasks/scenarios/osd_directory.yml index 7be19b77c..be6754024 100644 --- a/roles/ceph-osd/tasks/osd_directory.yml +++ b/roles/ceph-osd/tasks/scenarios/osd_directory.yml @@ -4,7 +4,7 @@ # NOTE (leseb): we do not check the filesystem underneath the directory # so it is really up to you to configure this properly. # Declaring more than one directory on the same filesystem will confuse Ceph. -- name: create OSD directories +- name: create osd directories file: > path={{ item }} state=directory diff --git a/roles/ceph-osd/tasks/raw_multi_journal.yml b/roles/ceph-osd/tasks/scenarios/raw_multi_journal.yml similarity index 84% rename from roles/ceph-osd/tasks/raw_multi_journal.yml rename to roles/ceph-osd/tasks/scenarios/raw_multi_journal.yml index c85a04108..2d00bae01 100644 --- a/roles/ceph-osd/tasks/raw_multi_journal.yml +++ b/roles/ceph-osd/tasks/scenarios/raw_multi_journal.yml @@ -1,8 +1,8 @@ --- ## SCENARIO 3: N JOURNAL DEVICES FOR N OSDS -- include: check_devices.yml -- include: zap_devices.yml +- include: ../check_devices.yml +- include: ../zap_devices.yml # NOTE (leseb): the prepare process must be parallelized somehow... # if you have 64 disks with 4TB each, this will take a while @@ -10,7 +10,7 @@ # NOTE (alahouze): if the device is a partition, the parted command below has # failed, this is why we check if the device is a partition too. -- name: prepare OSD disk(s) +- name: prepare osd disk(s) command: "ceph-disk prepare {{ item.2 }} {{ item.3 }}" with_together: - parted.results @@ -24,4 +24,4 @@ item.1.rc != 0 and raw_multi_journal -- include: activate_osds.yml +- include: ../activate_osds.yml diff --git a/roles/ceph-osd/tasks/zap_devices.yml b/roles/ceph-osd/tasks/zap_devices.yml index afe5a365d..34bbc90bc 100644 --- a/roles/ceph-osd/tasks/zap_devices.yml +++ b/roles/ceph-osd/tasks/zap_devices.yml @@ -2,7 +2,7 @@ # NOTE (leseb): some devices might miss partition label which which will result # in ceph-disk failing to prepare OSD. Thus zapping them prior to prepare the OSD # ensures that the device will get successfully prepared. -- name: erasing partitions and labels from OSD disk(s) +- name: erasing partitions and labels from osd disk(s) command: ceph-disk zap {{ item.2 }} changed_when: false with_together: diff --git a/roles/ceph-radosgw/tasks/docker.yml b/roles/ceph-radosgw/tasks/docker.yml index 43bf4c1ab..fae1aaa23 100644 --- a/roles/ceph-radosgw/tasks/docker.yml +++ b/roles/ceph-radosgw/tasks/docker.yml @@ -13,14 +13,14 @@ name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227 -- name: stat for Ceph config and keys +- name: stat for ceph config and keys stat: > path={{ item }} with_items: ceph_config_keys ignore_errors: true register: statconfig -- name: try to fetch Ceph config and keys +- name: try to fetch ceph config and keys copy: > src=fetch/docker_mon_files/"{{ item }}" dest=/etc/ceph/ diff --git a/roles/ceph-radosgw/tasks/install_debian.yml b/roles/ceph-radosgw/tasks/installs/install_debian.yml similarity index 100% rename from roles/ceph-radosgw/tasks/install_debian.yml rename to roles/ceph-radosgw/tasks/installs/install_debian.yml diff --git a/roles/ceph-radosgw/tasks/install_redhat.yml b/roles/ceph-radosgw/tasks/installs/install_redhat.yml similarity index 100% rename from roles/ceph-radosgw/tasks/install_redhat.yml rename to roles/ceph-radosgw/tasks/installs/install_redhat.yml diff --git a/roles/ceph-radosgw/tasks/main.yml b/roles/ceph-radosgw/tasks/main.yml index f05123b21..0ce9168c7 100644 --- a/roles/ceph-radosgw/tasks/main.yml +++ b/roles/ceph-radosgw/tasks/main.yml @@ -2,13 +2,13 @@ - include: pre_requisite.yml when: not ceph_containerized_deployment -- include: install_redhat.yml +- include: ./installs/install_redhat.yml when: ansible_os_family == 'RedHat' and radosgw_frontend == 'apache' and not ceph_containerized_deployment -- include: install_debian.yml +- include: ./installs/install_debian.yml when: ansible_os_family == 'Debian' and radosgw_frontend == 'apache' and not diff --git a/roles/ceph-restapi/tasks/docker.yml b/roles/ceph-restapi/tasks/docker.yml index fc3006c22..1974e3e9e 100644 --- a/roles/ceph-restapi/tasks/docker.yml +++ b/roles/ceph-restapi/tasks/docker.yml @@ -10,14 +10,14 @@ name=docker-py version=1.1.0 # https://github.com/ansible/ansible-modules-core/issues/1227 -- name: stat for Ceph config and keys +- name: stat for ceph config and keys stat: > path={{ item }} with_items: ceph_config_keys ignore_errors: true register: statconfig -- name: try to fetch Ceph config and keys +- name: try to fetch ceph config and keys copy: > src=fetch/docker_mon_files/"{{ item }}" dest=/etc/ceph/ @@ -29,7 +29,7 @@ - statconfig.results when: item.1.stat.exists == False -- name: run the Ceph REST API docker image +- name: run the ceph rest api docker image docker: > image="{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}" name={{ ansible_hostname }}-ceph-restapi @@ -39,7 +39,7 @@ env="RESTAPI_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_restapi_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=RESTAPI" volumes="/etc/ceph:/etc/ceph" -- name: ensure Ceph REST API service is running +- name: ensure ceph rest api service is running docker: > image="{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}" name="ceph-{{ ansible_hostname }}" diff --git a/roles/ceph-restapi/tasks/pre_requisite.yml b/roles/ceph-restapi/tasks/pre_requisite.yml index 982f9828c..04a9a0c54 100644 --- a/roles/ceph-restapi/tasks/pre_requisite.yml +++ b/roles/ceph-restapi/tasks/pre_requisite.yml @@ -1,5 +1,5 @@ --- -- name: create Ceph REST API directory +- name: create ceph rest api directory file: > path=/var/lib/ceph/restapi/ceph-restapi state=directory @@ -7,7 +7,7 @@ group=root mode=0755 -- name: copy Ceph REST API keyring +- name: copy ceph rest api keyring copy: > src=fetch/{{ fsid }}/etc/ceph/ceph.client.restapi.keyring dest=/var/lib/ceph/restapi/ceph-restapi/keyring @@ -16,7 +16,7 @@ mode=600 when: cephx -- name: activate Ceph REST API with upstart +- name: activate ceph rest api with upstart file: > path=/var/lib/ceph/restapi/{{ item }} state=touch @@ -29,7 +29,7 @@ changed_when: false when: ansible_distribution == "Ubuntu" -- name: activate Ceph REST API with sysvinit +- name: activate ceph rest api with sysvinit file: > path=/var/lib/ceph/restapi/{{ item }} state=touch diff --git a/roles/ceph-restapi/tasks/start_restapi.yml b/roles/ceph-restapi/tasks/start_restapi.yml index 6a62c19f2..0aecd90d6 100644 --- a/roles/ceph-restapi/tasks/start_restapi.yml +++ b/roles/ceph-restapi/tasks/start_restapi.yml @@ -1,11 +1,11 @@ --- -- name: check if Ceph REST API is already started +- name: check if ceph rest api is already started shell: "pgrep ceph-rest-api" changed_when: false ignore_errors: true register: restapi_status -- name: start Ceph REST API +- name: start ceph rest api shell: "nohup ceph-rest-api &" changed_when: false when: restapi_status.rc != 0