Skip to content

Defining vhosts in Hiera #566

@stevelacey

Description

@stevelacey

I am probably just doing Hiera wrong... but this does nothing for me:

hiera/common.yaml:

---
nginx::config::worker_processes: "%{::processorcount}"

nginx::nginx_vhosts:
  "%{::fqdn}":
    www_root: "/var/www/%{::fqdn}"

In my node:

include nginx
include nginx::config

I think the Hiera is at least right my worker_processes gets set, and the following is returned if I run this on the master:

hiera -c /etc/puppet/current/hiera.yaml nginx::nginx_vhosts ::fqdn=test 
=> {"test"=>{"www_root"=>"/var/www/test"}}

Do I need to define something specific to the vhost or vhosts in general in my manifest to trigger it pulling in the vhost settings? nginx::resource::vhost { $::fqdn: } moans about no params passed – i.e. it can't see the www_root.

jennifer-lawrence-shrugging-gif

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