Duplicate dns host-record should not be allowed using bootstrap config

Bug #2051553 reported by Joseph Vazhappilly
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Joseph Vazhappilly

Bug Description

Brief Description
-----------------
Ansible bootstrap allows to create multiple host records with same dns name and ip address successfully without error. Invalid DNS hostnames are getting created in /etc/hosts

Severity
--------
Minor

Steps to Reproduce
------------------
1. Configure user_dns_host_records to have duplicate
user_dns_host_records:
  host1: host,127.0.0.1
  host2: host,127.0.0.1
2. Run ansible bootstrap playbook as below
ansible-playbook /usr/share/ansible/stx-ansible/playbooks/bootstrap.yml
3. Check /etc/hosts file for duplicates

Expected Behavior
------------------
DNS host record with same name and ip should not be allowed.
Invalid host entries should not be allowed.

Actual Behavior
----------------
Creation of duplicate host records

Reproducibility
---------------
100%

System Configuration
--------------------
One node system

Branch/Pull Time/Commit
-----------------------
starlingx/master

Last Pass
---------
NA

Timestamp/Logs
--------------
NA

Test Activity
-------------
Feature Testing

Workaround
----------
NA

Changed in starlingx:
assignee: nobody → Joseph Vazhappilly (jvazhapp)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-playbooks (master)
Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-playbooks (master)

Reviewed: https://review.opendev.org/c/starlingx/ansible-playbooks/+/907071
Committed: https://opendev.org/starlingx/ansible-playbooks/commit/57ba971e6d2b132030b8b052d81187b2fa350111
Submitter: "Zuul (22348)"
Branch: master

commit 57ba971e6d2b132030b8b052d81187b2fa350111
Author: Joseph Vazhappilly <email address hidden>
Date: Mon Jan 29 08:23:00 2024 -0500

    Update host record validation during bootstrap

    Ansible bootstrap playbook is updated to check and fail, if duplicate
    DNS host records or invalid hostnames are specified in the
    `user_dns_host_records` parameter.

    Closes-bug: 2051553

    Test Plan:
    PASS: Verify bootstrap playbook with duplicate host records
    PASS: Verify bootstrap playbook with valid & invalid hostname

    Change-Id: Icdfa1bb2b1866020964ef22efe5fbced10618ff8
    Signed-off-by: Joseph Vazhappilly <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.9.0 stx.config
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.