Move hostname registration to common

The storage hostname is used in many conf files all over the place and
should be registered upon each run for every service

TrivialFix

Change-Id: I1d5a20cb6d51cee9f529cf2e1fb144158f7718a9
This commit is contained in:
SamYaple 2016-03-03 03:47:17 +00:00
parent 5bbd578379
commit 7f6de0a7e0
2 changed files with 9 additions and 9 deletions

View File

@ -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 - name: Ensuring config directories exist
file: file:
path: "{{ node_config_directory }}/{{ item }}" path: "{{ node_config_directory }}/{{ item }}"

View File

@ -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 - name: Ensuring config directories exist
file: file:
path: "{{ node_config_directory }}/{{ item }}" path: "{{ node_config_directory }}/{{ item }}"