From 7ba58e15fd795488bfd116609fa5daf81526f410 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Wed, 30 Aug 2023 18:02:21 +0100 Subject: [PATCH] Add default name for user collections file The get-ansible-collection-requirements playbook cannot be used standalone without passing an extra var for the name of the user collections file. This patch allows the playbook to be run standalone and the default name will be used automatically, still allowing an override to be used as currently happens in scripts/bootstrap-ansible.sh Sonetimes it is desireable to have a simple way to update the installed collections without running other parts of bootstrap-ansible, or look up flags to disable other side-effects. Change-Id: I27131ecaa3bc0ef459d2c353be9531608dd9d9ab --- scripts/get-ansible-collection-requirements.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/get-ansible-collection-requirements.yml b/scripts/get-ansible-collection-requirements.yml index 70b9bd6a0a..83ab191428 100644 --- a/scripts/get-ansible-collection-requirements.yml +++ b/scripts/get-ansible-collection-requirements.yml @@ -100,5 +100,6 @@ collection_file: "{{ playbook_dir }}/../ansible-collection-requirements.yml" required_collections: "{{ lookup('file', collection_file) | from_yaml }}" collection_path_default: '/etc/ansible/' + user_collection_file: 'user-collection-requirements.yml' user_collections: "{{ lookup('file', user_collections_path, errors='ignore')|default([], true) | from_yaml }}" - user_collections_path: "{{ lookup('env', 'OSA_CONFIG_DIR') | default('/etc/openstack_deploy', true) ~ '/' ~ (user_collection_file|default('')) }}" + user_collections_path: "{{ lookup('env', 'OSA_CONFIG_DIR') | default('/etc/openstack_deploy', true) ~ '/' ~ user_collection_file }}"