Use cluster_group variable for paths
Instead of trying to automagic this group out of the Ansible hostvars, just make it explicitly defined in the group_vars to avoid any confusion.
This commit is contained in:
parent
a925e4bd40
commit
fbbf5ffe09
|
@ -1,4 +1,8 @@
|
||||||
---
|
---
|
||||||
|
# The name of the Ansible cluster group, used to set file paths and determine hosts in the cluster
|
||||||
|
# This should match the lowest-level group in the Ansible `hosts` file that defines this cluster
|
||||||
|
cluster_group: default
|
||||||
|
|
||||||
# Local timezone for the cluster
|
# Local timezone for the cluster
|
||||||
timezone_location: Canada/Eastern
|
timezone_location: Canada/Eastern
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ server time.nrc.ca iburst
|
||||||
server time.chu.nrc.ca iburst
|
server time.chu.nrc.ca iburst
|
||||||
|
|
||||||
# Local PVC cluster
|
# Local PVC cluster
|
||||||
{% for host in groups[hostvars[inventory_hostname].group_names[0]] %}
|
{% for host in groups[cluster_group] %}
|
||||||
server {{ host }} iburst
|
server {{ host }} iburst
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
- name: collect bootstrapped Ceph files into the role
|
- name: collect bootstrapped Ceph files into the role
|
||||||
fetch:
|
fetch:
|
||||||
src: /tmp/ceph-bootstrap/{{ item }}
|
src: /tmp/ceph-bootstrap/{{ item }}
|
||||||
dest: roles/pvc/files/ceph/{{ hostvars[inventory_hostname].group_names[0] }}/ceph/
|
dest: roles/pvc/files/ceph/{{ cluster_group }}/ceph/
|
||||||
flat: yes
|
flat: yes
|
||||||
with_items:
|
with_items:
|
||||||
- ceph.conf
|
- ceph.conf
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
- name: install configurations
|
- name: install configurations
|
||||||
copy:
|
copy:
|
||||||
src: ceph/{{ hostvars[inventory_hostname].group_names[0] }}/ceph/{{ item }}
|
src: ceph/{{ cluster_group }}/ceph/{{ item }}
|
||||||
dest: /etc/ceph/{{ item }}
|
dest: /etc/ceph/{{ item }}
|
||||||
owner: ceph
|
owner: ceph
|
||||||
group: ceph
|
group: ceph
|
||||||
|
|
Loading…
Reference in New Issue