This commit is contained in:
felixfontein
2025-01-25 21:27:38 +00:00
parent 1998669710
commit c5b95593c2
4 changed files with 4 additions and 4 deletions
@@ -575,7 +575,7 @@ see <a class="reference internal" href="#ansible-collections-community-docker-do
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul class="simple">
<li><p>If you need to evaluate environment variables of the container in <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-community-docker-docker-compose-v2-exec-module-parameter-command"><span class="std std-ref"><span class="pre">command</span></span></a></strong></code> or <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-community-docker-docker-compose-v2-exec-module-parameter-argv"><span class="std std-ref"><span class="pre">argv</span></span></a></strong></code>, you need to pass the command through a shell, like <code class="ansible-option-value docutils literal notranslate"><a class="reference internal" href="#ansible-collections-community-docker-docker-compose-v2-exec-module-parameter-command"><span class="std std-ref"><span class="pre">command=/bin/sh</span> <span class="pre">-c</span> <span class="pre">&quot;echo</span> <span class="pre">$ENV_VARIABLE&quot;</span></span></a></code>.</p></li>
<li><p>If you need to evaluate environment variables of the container in <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-community-docker-docker-compose-v2-exec-module-parameter-command"><span class="std std-ref"><span class="pre">command</span></span></a></strong></code> or <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-community-docker-docker-compose-v2-exec-module-parameter-argv"><span class="std std-ref"><span class="pre">argv</span></span></a></strong></code>, you need to pass the command through a shell, like <code class="ansible-option-value docutils literal notranslate"><a class="reference internal" href="#ansible-collections-community-docker-docker-compose-v2-exec-module-parameter-command"><span class="std std-ref"><span class="pre">command=/bin/sh</span> <span class="pre">-c</span> <span class="pre">&quot;echo</span> <span class="pre">$ENV_VARIABLE&quot;</span></span></a></code>. The same needs to be done in case you want to use glob patterns or other shell features such as redirects.</p></li>
<li><p>The Docker compose CLI plugin has no stable output format (see for example <a class="reference external" href="https://github.com/docker/compose/issues/10872">https://github.com/docker/compose/issues/10872</a>),
and for the main operations also no machine friendly output format. The module tries to accomodate this with various
version-dependent behavior adjustments and with testing older and newer versions of the Docker compose CLI plugin.