Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

node[:fqdn] is blank for knife ec2 bootstrap #30

@fletchowns

Description

@fletchowns

OS is RHEL6. This hostname cookbook is the first recipe in my chef run. I have set_fqdn = "*.mydomain.com" in my attributes and I'm trying to do a knife ec2 server create --node-name nexus and the run fails because the the nexus cookbook (https://github.com/RiotGames/nexus-cookbook) uses node[:fqdn] in the nginx config. The config becomes malformed as a result, nginx fails to start, and the run fails.

From the output of the hostname portion, it looks like everything should work fine. hostname -f after the failed run returns the correct value (mynode.mydomain.com). What would cause node[:fqdn] to be blank on the bootstrap run?

Recipe: hostname::default
  * ruby_block[Update /etc/sysconfig/network] action run
    - execute the ruby block Update /etc/sysconfig/network
  * ohai[reload] action reload
    - re-run ohai and merge results into node attributes
  * ruby_block[Update /etc/sysctl.conf] action run
    - execute the ruby block Update /etc/sysctl.conf
  * ohai[reload] action reload
    - re-run ohai and merge results into node attributes
  * execute[hostname nexus] action run
    - execute hostname nexus
  * ohai[reload] action reload
    - re-run ohai and merge results into node attributes
  * service[network] action restart
    - restart service service[network]
  * hostsfile_entry[localhost] action append
  Recipe: <Dynamically Defined Resource>
    * file[/etc/hosts] action create
      - update content in file /etc/hosts from 498f49 to cc06b0
      --- /etc/hosts    2010-01-12 08:28:22.000000000 -0500
      +++ /tmp/.hosts20140924-1366-k5b3cu   2014-09-24 20:15:17.823261121 -0400
      @@ -1,3 +1,12 @@
      -127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
      -::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
      +#
      +# This file is managed by Chef, using the hostsfile cookbook.
      +# Editing this file by hand is highly discouraged!
      +#
      +# Comments containing an @ sign should not be modified or else
      +# hostsfile will be unable to guarantee relative priority in
      +# future Chef runs!
      +#
      +
      +127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
      +::1  localhost localhost.localdomain localhost6 localhost6.localdomain6
      - restore selinux security context
    - Append hostsfile_entry[localhost]
Recipe: hostname::default
  * hostsfile_entry[set hostname] action create
  Recipe: <Dynamically Defined Resource>
    * file[/etc/hosts] action create
      - update content in file /etc/hosts from cc06b0 to db56ba
      --- /etc/hosts    2014-09-24 20:15:17.823261121 -0400
      +++ /tmp/.hosts20140924-1366-y8dngg   2014-09-24 20:15:18.262261122 -0400
      @@ -8,5 +8,6 @@
       #

       127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
      +127.0.1.1    nexus.mydomain.com nexus
       ::1  localhost localhost.localdomain localhost6 localhost6.localdomain6
      - restore selinux security context
    - Create hostsfile_entry[set hostname]
Recipe: hostname::default
  * ohai[reload] action reload
    - re-run ohai and merge results into node attributes
  * ohai[reload] action nothing (skipped due to action :nothing)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions