Skip to content
Snippets Groups Projects
Commit 277776e2 authored by Rishabh Dave's avatar Rishabh Dave Committed by Sébastien Han
Browse files

use blocks directives to group tasks

Using block directives simplifies the playbooks and makes them more
readable.

Fixes: https://github.com/ceph/ceph-ansible/issues/2835


Signed-off-by: default avatarRishabh Dave <ridave@redhat.com>
parent b483ff5b
No related branches found
No related tags found
No related merge requests found
......@@ -19,34 +19,36 @@
# - Jewel from latest Canonical 16.04 distro
# - All previous versions from Canonical
# - Infernalis from ceph.com
- name: check /etc/default/ceph exist
stat:
path: /etc/default/ceph
register: etc_default_ceph
check_mode: no
when:
- ansible_os_family == "Debian"
- name: debian based systems - configure cluster name
block:
- name: check /etc/default/ceph exist
stat:
path: /etc/default/ceph
register: etc_default_ceph
check_mode: no
- name: configure cluster name
lineinfile:
dest: /etc/default/ceph
insertafter: EOF
create: yes
regexp: "^CLUSTER="
line: "CLUSTER={{ cluster }}"
when:
- ansible_os_family == "Debian"
- etc_default_ceph.stat.exists
- not etc_default_ceph.stat.isdir
- name: configure cluster name
block:
- name: when /etc/default/ceph is not dir
lineinfile:
dest: /etc/default/ceph
insertafter: EOF
create: yes
regexp: "^CLUSTER="
line: "CLUSTER={{ cluster }}"
when:
- not etc_default_ceph.stat.isdir
- name: configure cluster name
lineinfile:
dest: /etc/default/ceph/ceph
insertafter: EOF
create: yes
regexp: "^CLUSTER="
line: "CLUSTER={{ cluster }}"
- name: when /etc/default/ceph is dir
lineinfile:
dest: /etc/default/ceph/ceph
insertafter: EOF
create: yes
regexp: "^CLUSTER="
line: "CLUSTER={{ cluster }}"
when:
- etc_default_ceph.stat.isdir
when:
- etc_default_ceph.stat.exists
when:
- ansible_os_family == "Debian"
- etc_default_ceph.stat.exists
- etc_default_ceph.stat.isdir
......@@ -11,11 +11,18 @@
tags:
- package-install
- name: include_tasks installs/install_on_debian.yml
include_tasks: installs/install_on_debian.yml
when: ansible_os_family == 'Debian'
tags:
- package-install
- name: debian based systems tasks
block:
- name: include installs/install_on_debian.yml
include_tasks: installs/install_on_debian.yml
tags:
- package-install
- name: include ntp debian setup tasks
include_tasks: "misc/ntp_debian.yml"
when:
- ntp_service_enabled
when:
- ansible_os_family == 'Debian'
- name: include_tasks installs/install_on_clear.yml
include_tasks: installs/install_on_clear.yml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment