Force C.UTF-8 when dealing with rabbitmq

When we use rabbitmq 3.7 we might hit the following issue when running rabbitmqctl commands inside containers (as puppet does):

  Error: Failed to apply catalog: Cannot parse invalid user line: warning:
  the VM is running with native name encoding of latin1 which may cause
  Elixir to malfunction as it expects utf8. Please ensure your locale is
  set to UTF-8 (which can be verified by running "locale" in your shell)

This is fundamentally the tripleo version of
https://github.com/voxpupuli/puppet-rabbitmq/issues/671

This is a strict requirement coming from Elixir:
https://github.com/elixir-lang/elixir/issues/3548

Since containers do not have UTF-8 as a default we have this problem:
[root@overcloud-controller-0 ~]# podman exec -it rabbitmq-bundle-podman-0 sh
()[root@overcloud-controller-0 /]$ rabbitmqctl -q list_users
warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by ru nning "locale" in your shell) user tags
guest [administrator]
()[root@overcloud-controller-0 /]$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>
Related-Bug: #1822673
Change-Id: I21ef2e7862f3e5e21812d342b1681f8d5f7f005d
This commit is contained in:
Michele Baldessari 2019-04-01 21:38:13 +02:00
parent 1ae79f2a9a
commit a92d1fccc6
2 changed files with 4 additions and 2 deletions

View File

@ -154,7 +154,9 @@ class tripleo::profile::base::rabbitmq (
$rabbitmq_additional_erl_args = "\"${cert_option} ${key_option} ${ciphers_option} ${secure_renegotiate}\""
$environment_real = merge($environment, {
'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS' => $rabbitmq_additional_erl_args,
'RABBITMQ_CTL_ERL_ARGS' => $rabbitmq_additional_erl_args
'RABBITMQ_CTL_ERL_ARGS' => $rabbitmq_additional_erl_args,
'LANG' => 'C.UTF-8',
'LC_ALL' => 'C.UTF-8'
})
# Configure a list of secure transport protocols, unless the
# user explicitly sets one

View File

@ -252,7 +252,7 @@ class tripleo::profile::pacemaker::rabbitmq_bundle (
expression => ['rabbitmq-role eq true'],
},
container_options => 'network=host',
options => '--user=root --log-driver=journald -e KOLLA_CONFIG_STRATEGY=COPY_ALWAYS',
options => '--user=root --log-driver=journald -e KOLLA_CONFIG_STRATEGY=COPY_ALWAYS -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8',
run_command => '/bin/bash /usr/local/bin/kolla_start',
network => "control-port=${rabbitmq_docker_control_port}",
storage_maps => merge($storage_maps, $storage_maps_tls),