From 4dd4aeaeeea85326f0232ab86c94276f819ef595 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Mon, 19 Mar 2018 22:26:06 -0400 Subject: [PATCH] Set ansible galaxy roles path for builder Change-Id: I2f7700dbb9d7e05b77e8dbb393837dbc29d5a2b1 Signed-off-by: Thanh Ha --- templates/builder.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/builder.json b/templates/builder.json index 4b1c949..7c4ce3f 100644 --- a/templates/builder.json +++ b/templates/builder.json @@ -1,5 +1,6 @@ { "variables": { + "ansible_roles_path": ".galaxy", "base_image": null, "distro": null, "cloud_auth_url": null, @@ -44,13 +45,17 @@ ], "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi" }, + { + "type": "shell-local", + "command": "./common-packer/ansible-galaxy.sh {{user `ansible_roles_path`}}" + }, { "type": "ansible", "playbook_file": "provision/local-builder.yaml", "ansible_env_vars": [ "ANSIBLE_NOCOWS=1", "ANSIBLE_PIPELINING=True", - "ANSIBLE_ROLES_PATH=../lf-ansible/roles", + "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}", "ANSIBLE_CALLBACK_WHITELIST=profile_tasks", "ANSIBLE_STDOUT_CALLBACK=debug" ] -- 2.16.6