Problem using default(omit) in docker environment variable

I am trying to use the | default(omit) filter in the environment variable declaration of my docker role, for example:

  • name: start container
    docker:
    name: foo
    image: foo
    state: reloaded
    pull: always
    restart_policy: always
    env:
    COMMAND: ‘{{ command|default(omit) }}’

net: default

Then I’m using the role in the playbook without specifying the command variable, which I would expect would omit any value from being set to the environment variable. Instead, this is what is in the environment when the container is started:

COMMAND=__omit_place_holder__4aee0541e67c9db52882aecb3a955196572ae0f8

any ideas what I could be doing wrong?

omit won't work for subkeys. You can omit env, but not entries inside it.

Thanks Brian. Sorry for redundant post, I found a previous group post mentioning this.