diff --git a/ansible/roles/ceph/tasks/config.yml b/ansible/roles/ceph/tasks/config.yml index d9af3a5c69..21ae654b9d 100644 --- a/ansible/roles/ceph/tasks/config.yml +++ b/ansible/roles/ceph/tasks/config.yml @@ -1,13 +1,4 @@ --- -- name: Looking up hostname - command: getent hosts {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }} - changed_when: False - register: storage_hostname - -- name: Setting storage hostname - set_fact: - storage_hostname: "{{ storage_hostname.stdout.split()[1] }}" - - name: Ensuring config directories exist file: path: "{{ node_config_directory }}/{{ item }}" diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 18f87c610a..c792f49392 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -1,4 +1,13 @@ --- +- name: Looking up storage hostname + command: getent hosts {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }} + changed_when: False + register: storage_hostname + +- name: Setting storage hostname + set_fact: + storage_hostname: "{{ storage_hostname.stdout.split()[1] }}" + - name: Ensuring config directories exist file: path: "{{ node_config_directory }}/{{ item }}"