aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamYaple <sam@yaple.net>2016-03-03 03:47:17 +0000
committerSamYaple <sam@yaple.net>2016-03-03 15:18:30 +0000
commit7f6de0a7e0d784181a6f99270768712e761f113a (patch)
treeab08f608ab4ea869c91cd5e2c4115251046cfbad
parent5bbd578379876c236581dd3ada8619095e750c91 (diff)
downloadkolla-7f6de0a7e0d784181a6f99270768712e761f113a.tar.gz
kolla-7f6de0a7e0d784181a6f99270768712e761f113a.zip
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
-rw-r--r--ansible/roles/ceph/tasks/config.yml9
-rw-r--r--ansible/roles/common/tasks/config.yml9
2 files changed, 9 insertions, 9 deletions
diff --git a/ansible/roles/ceph/tasks/config.yml b/ansible/roles/ceph/tasks/config.yml
index d9af3a5c6..21ae654b9 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 18f87c610..c792f4939 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 }}"