Document why a separate task is needed for ansible_env.HOME 30/68430/2
authorFatih Degirmenci <fdegir@gmail.com>
Mon, 2 Sep 2019 10:57:30 +0000 (12:57 +0200)
committerFatih Degirmenci <fdegir@gmail.com>
Mon, 2 Sep 2019 11:37:15 +0000 (13:37 +0200)
installer-type:kubespray
deploy-scenario:k8-calico-nofeature

Change-Id: Ic76b6407d1f0ddf8fde6dd3400c0576c8ce8692e
Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
xci/installer/kubespray/playbooks/configure-installer.yml
xci/installer/osh/playbooks/configure-installer.yml

index 1f3b3d6..d88ee55 100644 (file)
         - { regexp: "kube_basic_auth:.*", line: "kube_basic_auth: true" }
         - { regexp: "dashboard_enabled:.*", line: "dashboard_enabled: true" }
 
+# NOTE(fdegir): the reason for this task to be separate from the task which uses lineinfile
+# module is that escaping curly braces does not work with with_items. what happens is that
+# ansible tries to resolve {{ ansible_env.HOME }} which we don't want since it should point
+# to home folder of the user executing this task at runtime.
     - name: update kubespray artifacts_dir
       lineinfile:
         path: "{{ xci_path }}/.cache/repos/kubespray/inventory/opnfv/group_vars/k8s-cluster/k8s-cluster.yml"
index 905777d..383f55f 100644 (file)
         - { regexp: "kube_basic_auth:.*", line: "kube_basic_auth: true" }
         - { regexp: "dashboard_enabled:.*", line: "dashboard_enabled: true" }
 
+# NOTE(fdegir): the reason for this task to be separate from the task which uses lineinfile
+# module is that escaping curly braces does not work with with_items. what happens is that
+# ansible tries to resolve {{ ansible_env.HOME }} which we don't want since it should point
+# to home folder of the user executing this task at runtime.
     - name: update kubespray artifacts_dir
       lineinfile:
         path: "{{ xci_path }}/.cache/repos/kubespray/inventory/opnfv/group_vars/k8s-cluster/k8s-cluster.yml"