prototypes: bifrost: Write clouds.yaml file for regular users 29/34429/1
authorMarkos Chandras <mchandras@suse.de>
Mon, 8 May 2017 10:28:50 +0000 (11:28 +0100)
committerMarkos Chandras <mchandras@suse.de>
Mon, 8 May 2017 10:44:47 +0000 (11:44 +0100)
This is similar to commit 6769ae9bcbf6 ("prototypes: bifrost: Add
keystone roles"). In preparation for running the bifrost jobs as normal
user we need to write a clouds.yaml file to users home directory.
This is similar to the bifrost upstream testing playbook.

Change-Id: Iae4bc73906649707667925280a19282ec5c93998

prototypes/bifrost/playbooks/opnfv-virtual.yaml

index 699c966..94de628 100644 (file)
       dib_packages: "{{ lookup('env', 'DIB_OS_PACKAGES') }}"
       when: create_image_via_dib | bool == true and transform_boot_image | bool == false
     - role: bifrost-keystone-client-config
-      # NOTE(hwoarang): This should be ansible_env.SUDO_USER like in the
-      # upstream playbook. However, we run ansible as root (ie with sudo)
-      # so clouds.yaml will be placed in the user's home directory (see
-      # the bifrost-keystone-client-config role) and then ansible will look
-      # for one in /root and fail. As such we hardcode the user to be 'root'.
-      user: "root"
+      user: "{{ ansible_env.SUDO_USER }}"
       clouds:
         bifrost:
           config_username: "{{ ironic.keystone.default_username }}"