From f05af2d7723230c6d379066a5eba8f7bc91657dd Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Thu, 26 Mar 2020 12:21:20 +0000 Subject: [PATCH] Add default value for user_role_file when cloning git repos This change allows scripts/get-ansible-role-requirements.yml playbook to be used as a standalone tool for cloning all OSA repos referenced in ansible-role-requirements.yml into a user defined workspace. This is useful for automatically bootstrapping a development environment with all of the OSA ansible roles cloned outside /etc/ansible/roles. Example: ansible-playbook scripts/get-ansible-role-requirements.yml -e role_path_default=/path/to/workspace Change-Id: I207853206435f0ec5faca95c69c25230e0c6b50c --- scripts/get-ansible-role-requirements.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/get-ansible-role-requirements.yml b/scripts/get-ansible-role-requirements.yml index 81d3988984..8db74005fd 100644 --- a/scripts/get-ansible-role-requirements.yml +++ b/scripts/get-ansible-role-requirements.yml @@ -17,6 +17,7 @@ hosts: localhost connection: local user: root + gather_facts: false tasks: - name: Remove target directory if required file: @@ -135,6 +136,6 @@ role_file: "{{ playbook_dir }}/../ansible-role-requirements.yml" role_path_default: '/etc/ansible/roles' user_roles: "{{ lookup('file', user_role_path, errors='ignore')|default([], true) | from_yaml }}" - user_role_path: "{{ lookup('env', 'OSA_CONFIG_DIR')|default('/etc/openstack_deploy') ~ '/' ~ user_role_file }}" + user_role_path: "{{ lookup('env', 'OSA_CONFIG_DIR')|default('/etc/openstack_deploy') ~ '/' ~ (user_role_file|default('')) }}" git_clone_retries: 2 git_clone_retry_delay: 5