]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-mon: detect ANSIBLE_ROLES_PATH if present 1808/head
authorSébastien Han <seb@redhat.com>
Thu, 24 Aug 2017 14:19:39 +0000 (16:19 +0200)
committerSébastien Han <seb@redhat.com>
Thu, 24 Aug 2017 14:19:39 +0000 (16:19 +0200)
Some deployments can't copy infrastructure playbooks outside of the
infrastructure-playbooks directory. Thus they use ANSIBLE_ROLES_PATH to
overcome this. However some roles have 'playbook_dir' hardcoded, which
results in wrong path since the execution comes from
infrastructure-playbooks. Basically the role triggered by a playbook
from infrastructure-playbooks believes that the roles are in
infrastructure-playbooks/roles. This commit fixes that.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-mon/tasks/docker/main.yml
roles/ceph-nfs/tasks/pre_requisite.yml

index 8813295fd385e66467c74c02dd37c16f4ae0699b..626ecbc21d1aa3d9ad53650e326ac6518caf09db 100644 (file)
     - "{{ inventory_hostname == groups[mon_group_name] | last }}"
     - not containerized_deployment_with_kv
 
-- include: "{{ playbook_dir }}/roles/ceph-mon/tasks/set_osd_pool_default_pg_num.yml"
+- include: "{{ lookup('env', 'ANSIBLE_ROLES_PATH') | default (playbook_dir + '/roles', true) }}/ceph-mon/tasks/set_osd_pool_default_pg_num.yml"
 
 # create openstack pools only when all mons are up.
-- include: "{{ playbook_dir }}/roles/ceph-mon/tasks/openstack_config.yml"
+- include: "{{ lookup('env', 'ANSIBLE_ROLES_PATH') | default (playbook_dir + '/roles', true) }}/ceph-mon/tasks/openstack_config.yml"
   when:
     - openstack_config
     - "{{ inventory_hostname == groups[mon_group_name] | last }}"
index 093d54e801c82486f316bbfbab8a82116e7ccf3a..ad19b4be358171bc97f346de9f7a935d81c31378 100644 (file)
@@ -28,7 +28,7 @@
 - name: generate ganesha configuration file
   action: config_template
   args:
-    src: "{{ playbook_dir }}/roles/ceph-common/templates/ganesha.conf.j2"
+    src: "{{ lookup('env', 'ANSIBLE_ROLES_PATH') | default (playbook_dir + '/roles', true) }}/ceph-common/templates/ganesha.conf.j2"
     dest: /etc/ganesha/ganesha.conf
     owner: "root"
     group: "root"