Skip to content

hyphen in hostname causes error #4893

Description

@richardhenwood-dell

Describe the bug
If Omnia is given a host name with a hyphen ansible-playbook prepare_oim task fails.

To Reproduce
Steps to reproduce the behavior:

  1. During configuration or by editing: /opt/omnia/.data/oim_metadata.yml...
  2. ... set a hostname with a hypen in it.
  3. run ansible-playbook ./prepare_oim.yml
  4. See error:
TASK [deploy_containers/openchami : Check ochami bss status] ******************************************************************
skipping: [oim]

TASK [deploy_containers/openchami : Display bss status] ***********************************************************************
skipping: [oim]

TASK [deploy_containers/openchami : Verify ochami dependencies] ***************************************************************
fatal: [oim]: FAILED! => {"changed": false, "module_stderr": "Shared connection to localhost closed.\r\n", "module_stdout": "bash: TEST-OIM_ACCESS_TOKEN=aabbccddeeff....

Expected behavior
No error.

Additional context

Occasionally Omnia builds environment variables using the ansible variable oim_node_name. oim_node_name is in-turn set to $(hostname). If hostname has a hyphen, an environment variable is created and named that includes a hyphen. Hyphens are not supported in environment variables in most common shells:

https://github.com/dell/omnia/blob/main/common/vars/openchami_vars.yml#L16

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions