/etc/hosts is not populated anymore

Bug #1631975 reported by Ionuț Bîru
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
High
Jesse Pretorius

Bug Description

I have a simple setup all in one installation with the following configuration.

As operating system is Ubuntu 14.04.

I noticed that after setup-hosts /etc/hosts wasn't populated.
I usually use ssh hostname to connect to the containers.

I'm using the branch origin/stable/newton with latest commit being 04605cae23bd84b19efed1fd08358bfce2bb0ddc

root@ubuntu:/etc/openstack_deploy# cat openstack_user_config.yml
# container networks, safe to leave these as defaults
cidr_networks:
  container: 172.29.226.0/22
  tunnel: 172.29.230.0/22
  storage: 172.29.234.0/22

# IPs from your tunnel and container networks that you want to reserve for the hosts
used_ips:
  - 172.29.226.2,172.29.226.255
  - 172.29.230.2,172.29.230.255
  - 172.29.234.2,172.29.234,255

global_overrides:
  internal_lb_vip_address: 172.29.226.2
  # your external VIP you want to use for HAPROXY
  external_lb_vip_address: IP_PUBLIC
  management_bridge: "br-mgmt"
  tunnel_bridge: "br-vxlan"

  provider_networks:
    # container network
    - network:
        group_binds:
          - all_containers
          - hosts
        type: "raw"
        container_bridge: "br-mgmt"
        container_interface: "eth1"
        container_type: "veth"
        ip_from_q: "container"
        is_container_address: true
        is_ssh_address: true
    # vxlan network
    - network:
        group_binds:
          - neutron_linuxbridge_agent
        container_bridge: "br-vxlan"
        container_type: "veth"
        container_interface: "eth10"
        ip_from_q: "tunnel"
        type: "vxlan"
        range: "1:1000"
        net_name: "vxlan"
    - network:
        group_binds:
          - neutron_linuxbridge_agent
        container_bridge: "br-vlan"
        container_type: "veth"
        container_interface: "eth12"
        host_bind_override: "bond1"
        type: "flat"
        net_name: "flat"
    # vlan network
    - network:
        group_binds:
          - neutron_linuxbridge_agent
        container_bridge: "br-vlan"
        container_type: "veth"
        container_interface: "eth11"
        type: "vlan"
        range: "1:1000"
        net_name: "vlan"

shared-infra_hosts:
  ctrl1:
    ip: 192.168.1.2

repo-infra_hosts:
  ctrl1:
    ip: 192.168.1.2

os-infra_hosts:
  ctrl1:
    ip: 192.168.1.2

storage-infra_hosts:
  ctrl1:
    ip: 192.168.1.2

network_hosts:
  ctrl1:
    ip: 192.168.1.2

identity_hosts:
  ctrl1:
    ip: 192.168.1.2

log_hosts:
  ctrl1:
    ip: 192.168.1.2

haproxy_hosts:
  ctrl1:
    ip: 192.168.1.2

compute_hosts:
  ctrl1:
    ip: 192.168.1.2

root@ubuntu:/etc/openstack_deploy# cat user_variables.yml
debug: false
glance_default_store: file
haproxy_keepalived_external_vip_cidr: "{{external_lb_vip_address}}/32"
haproxy_keepalived_internal_vip_cidr: "{{internal_lb_vip_address}}/32"

root@ubuntu:/etc/openstack_deploy/conf.d# cat gnocchi.yml

metrics_hosts:
  ctrl1:
    ip: 192.168.1.2

root@ubuntu:/etc/openstack_deploy/conf.d# cat ceilometer.yml
metering-compute_hosts:
  ctrl1:
    ip: 192.168.1.2

metering-infra_hosts:
  ctrl1:
    ip: 192.168.1.2

Ionuț Bîru (ionut-3)
description: updated
Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

FYI if you have an AIO, there is no need for keepalived. :)

Could you dump your /etc/hosts too?

Revision history for this message
Ionuț Bîru (ionut-3) wrote :

root@ubuntu:~/openstack-ansible/playbooks# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ubuntu

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

Here are the paste from ioni:

inventory https://paste.xinu.at/SUo/
openstack-ansible openstack-hosts-setup https://paste.xinu.at/ofvde8/

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

It looks like:

- include: openstack_update_hosts_file.yml
  static: no
  when: openstack_host_manage_hosts_file | bool

from the openstack_host role was skipped.

The openstack_host_manage_host_file should be True (default of the role, and the group_vars/hosts would not override it to false).

It seems like it's an issue with the static: no

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

Could someone try to reproduce this issue?

Changed in openstack-ansible:
assignee: nobody → Jesse Pretorius (jesse-pretorius)
Changed in openstack-ansible:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

I've reproduced this, and figured out where the problem is. Patch incoming.

Changed in openstack-ansible:
importance: Low → High
status: Confirmed → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)

Fix proposed to branch: master
Review: https://review.openstack.org/385089

Changed in openstack-ansible:
status: Triaged → In Progress
Revision history for this message
Ionuț Bîru (ionut-3) wrote :

Just tested the patch, works now.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.openstack.org/385089
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=ded68dd775f7187bbe4649d2e31346784c21ac69
Submitter: Jenkins
Branch: master

commit ded68dd775f7187bbe4649d2e31346784c21ac69
Author: Jesse Pretorius <email address hidden>
Date: Tue Oct 11 17:50:36 2016 +0100

    Fix value for openstack_host_manage_hosts_file

    The current resulting value for the group var calculation of
    openstack_host_manage_hosts_file is \"True\"\n instead of
    True.

    This results in the conditional failing in the openstack_hosts
    role because the boolean evaluation of this value results in
    False.

    This patch removes the use of continuation so that the
    resulting value is boolean instead of a string.

    Change-Id: I9b240137ab013d5b05d1f154250a77253a913329
    Closes-Bug: #1631975

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/385277

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/newton)

Reviewed: https://review.openstack.org/385277
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=8668096b2e3560d2019ca30d1cb9be50a39524d3
Submitter: Jenkins
Branch: stable/newton

commit 8668096b2e3560d2019ca30d1cb9be50a39524d3
Author: Jesse Pretorius <email address hidden>
Date: Tue Oct 11 17:50:36 2016 +0100

    Fix value for openstack_host_manage_hosts_file

    The current resulting value for the group var calculation of
    openstack_host_manage_hosts_file is \"True\"\n instead of
    True.

    This results in the conditional failing in the openstack_hosts
    role because the boolean evaluation of this value results in
    False.

    This patch removes the use of continuation so that the
    resulting value is boolean instead of a string.

    Change-Id: I9b240137ab013d5b05d1f154250a77253a913329
    Closes-Bug: #1631975
    (cherry picked from commit ded68dd775f7187bbe4649d2e31346784c21ac69)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 14.0.0.0rc3

This issue was fixed in the openstack/openstack-ansible 14.0.0.0rc3 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 15.0.0.0b1

This issue was fixed in the openstack/openstack-ansible 15.0.0.0b1 development milestone.

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.