Skip to content

sap_vm_provision: Fix adding /etc/hosts for all in play not just itself#160

Merged
marcelmamula merged 1 commit intosap-linuxlab:devfrom
marcelmamula:hosts_fix
Mar 20, 2026
Merged

sap_vm_provision: Fix adding /etc/hosts for all in play not just itself#160
marcelmamula merged 1 commit intosap-linuxlab:devfrom
marcelmamula:hosts_fix

Conversation

@marcelmamula
Copy link
Copy Markdown
Contributor

Changes

I have incorrectly identified intent behind initial updating of /etc/hosts and reworked approach in #155 has not correctly set them. It has resulted on only own entry added because of flag fact.

This changes fixes that, so that all hosts in play are present in /etc/hosts.

FYI: We are not checking if defined because set_fact sets these facts always.

  ansible.builtin.set_fact:
    sap_vm_provision_dynamic_inventory_anydb_primary_ip:
      "{{ hostvars[sap_vm_provision_dynamic_inventory_anydb_primary_hostname].ansible_host | d(none) }}"

@marcelmamula marcelmamula self-assigned this Mar 20, 2026
@marcelmamula marcelmamula added the bug Something isn't working label Mar 20, 2026
Copy link
Copy Markdown
Member

@sean-freeman sean-freeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@marcelmamula marcelmamula merged commit e38a49e into sap-linuxlab:dev Mar 20, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants