]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add customisable env variables
authorSébastien Han <seb@redhat.com>
Tue, 28 Jul 2015 13:32:58 +0000 (15:32 +0200)
committerSébastien Han <seb@redhat.com>
Tue, 28 Jul 2015 13:32:58 +0000 (15:32 +0200)
Now we can easily pass new variables to bootstrap the container.

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

index 44b0b4d79e68bb0fa8f3fc2b15884ff607375c32..6c35f81aa39c762af95fda66bec8307e05df657b 100644 (file)
@@ -58,3 +58,4 @@ dummy:
 #ceph_mon_docker_imagename: "daemon"\r
 #ceph_mon_docker_interface: eth0\r
 #ceph_mon_docker_subnet: # subnet of the ceph_mon_docker_interface\r
+#ceph_mon_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variables\r
index da2298a51657ca6eea934046a660c682ed1c223e..5bc220fcc96f1c9769776b557b5aa1919076b148 100644 (file)
@@ -56,3 +56,4 @@ ceph_mon_docker_interface: eth0
 #ceph_mon_docker_subnet: # subnet of the ceph_mon_docker_interface\r
 ceph_mon_docker_username: ceph\r
 ceph_mon_docker_imagename: daemon\r
+ceph_mon_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variables\r
index 31afb86328259d7c7f349f4490514882e3fe69b3..74f0d4983f4b815806b13823b25e3b9c2f133279 100644 (file)
@@ -51,7 +51,7 @@
     name="{{ ansible_hostname }}"
     net="host"
     state="running"
-    env="MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }}"
+    env="MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}"
     volumes="/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
 
 - name: push ceph files to the ansible server