Skip to content

Use hostname diffs for inventory naming in output #8

@Addvilz

Description

@Addvilz

Currently log lines include context for the output that includes current task, active role, and full inventory name. This is problematic with long inventory names because it takes a lot of console real estate.

The solution here would be to replace a part of the inventory name with short placeholders where said hostnames overlap within the current (!!!) role target inventory.

Simplest solution that would cover most cases would probably be to discard the tail of the inventory name till first character difference in the name of the item, and then discard head of the inventory name till first character difference in the name. Replaced parts of the inventory names, if any, should be replaced with asterisks in output.

Exceptions to this:

  • IPv4 and IPV6 addresses are used instead of hostname (IP should always use full output)

Example of current behavior:

[15:38:29]    INFO [deploy] [example] [matiss@e1.c1.g1.nginx.us-east-1.aws.infra.example.com] Changing remote working directory for current context to </tmp>

[15:38:29]    INFO [deploy] [example] [matiss@e2.c1.g1.nginx.us-east-1.aws.infra.example.com] Changing remote working directory for current context to </tmp>

[15:38:29]    INFO [deploy] [example] [matiss@e1.c2.g1.nginx.us-east-1.aws.infra.example.com] Changing remote working directory for current context to </tmp>

Example of new behavior:

[15:38:29]    INFO [deploy] [example] [*e1.c1*] Changing remote working directory for current context to </tmp>

[15:38:29]    INFO [deploy] [example] [*e2.c1*] Changing remote working directory for current context to </tmp>

[15:38:29]    INFO [deploy] [example] [*e1.c2*] Changing remote working directory for current context to </tmp>

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.1.0Affects 1.1.0enhancementNew feature or requestp-valuableValuable features or tasks

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions