Majic Projects
Majic Ansible Roles
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png Majic Ansible Roles / Closed Task MAR-243 Remove use of inventory_hostname and inventory_hostname_short Ansible variables
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue basics
  • Type of issue
    Task
  • Category
    General
  • Targetted for
    9.0.0
  • Status
    Closed
  • Progress
  • Priority
    Normal
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
  • Estimated time
    6 hours
  • Time spent
    3 hours
    Click here to see time logged against this issue
Issue details
  • Resolution
    RESOLVED
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description

Many roles deploy configuration and other files that are in some shape or form dependent on the name of the server or service. In most cases it makes sense to pick names which are unique and which are also used externally for access. This is usually hostnames and FQDNs. These names are normally discovered by Ansible during setup, and exposed in the form of ansible_hostname and ansible_fqdn variables.

Most of the roles are already using these two variables where appropriate, but there are some leftovers, possibly from older iterations, where this is not the case. Notably, a couple of roles, as well as many tests still seem to be relying on the inventory_hostname and inventory_hostname_short variables. The problem with these variables is that they may not necessarily match up with the actual hostname of the managed machine, which can result in some issues, particularly when pointing to paths in configuration files.

In order to improve consistency of the roles, all such uses of inventory_hostname and inventory_hostname_short variables should be dropped and replaced with their fact discovery equivalents if possible.

The following should be done:

  • Drop all uses of inventory_hostname and inventory_hostname_short variables from role implementations.
  • Attempt to do the same in all tests.
  • Make sure that all tests are still passing after the changes have bee made.
  • Update role reference documentation.
  • Update usage instructions.
  • Update release notes.
Todos (0 / 0)
There are no comments