Skip to content

Commit 292da96

Browse files
author
Dmitriy Rabotyagov
committed
Ensure locale is always set for Ansible
In some cases, environment from the operator localhost can be passed to the deploy host, uncluding used locales. With that, not always the selected locale will be present on the deploy host, and LC_ALL can be not defined either, for example on Debian 13. Adding default LC_ALL env var for bootstrap and runtime of openstack-ansible ensures that locale is set correcttly. Otherwise, Ansible may fail with "unsupported locale setting". Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/965798 Change-Id: I388263019c035744517374fdec2aa5f84408fbf4 Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
1 parent 57fcf40 commit 292da96

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

scripts/bootstrap-ansible.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export ANSIBLE_CONFIG="none-ansible.cfg"
218218
export ANSIBLE_COLLECTIONS_PATH="/etc/ansible"
219219
export ANSIBLE_TRANSPORT="smart"
220220
export ANSIBLE_STRATEGY="linear"
221+
export LC_ALL="${LC_ALL:-C.UTF-8}"
221222

222223
pushd scripts
223224
if ([ -f "${ANSIBLE_COLLECTION_FILE}" ] || [ -f "${USER_COLLECTION_FILE}" ]) && [[ -z "${SKIP_OSA_COLLECTION_CLONE+defined}" ]]; then

scripts/openstack-ansible.rc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
export LC_ALL="${LC_ALL:-C.UTF-8}"
16+
1517
export OSA_CONFIG_DIR="${OSA_CONFIG_DIR:-/etc/openstack_deploy}"
1618

1719
export ANSIBLE_RETRY_FILES_ENABLED="${ANSIBLE_RETRY_FILES_ENABLED:-False}"

0 commit comments

Comments
 (0)