LWRP上的配置配置

时间:2017-06-01 11:54:15

标签: chef

我正在使用此配置提供程序来配置我的elasticsearch:

elasticsearch_configure 'my_elasticsearch' do
  path_home     "/opt/elasticsearch"
  path_data     data_location
  ...
end

data_location值来自:

data_location = node['living']['elastic']['data_location']

尽管如此,我的当前环境dev未设置此属性:

{
  "living": {
    "elastic": {
      "version": "5.4.0",
      "cluster": "cluster-dev",
      "node": "node1",
      "host": "localhost",
      "port": 9201,
      ...
    }
  }
}

所以,根据data_locationnil是否elasticsearch_configure,我需要在export default class MoviesSearch extends Component { render() { const {movieprop} = this.props; return ( <ul className = "col-md-4 list-group"> { movieprop && movieprop.slice(0,5).map((item ) => <li key={item.id}> <h4>name:{item.title }</h4> <p>release date: {item.release_date}</p> <p>vote: {item.vote_average}</p> <img src="http://image.tmdb.org/t/p/w185{item.backdrop_path}"/> //NOT WORKING </li> ) } </ul> ) } } 上设置...

我绝对不知道如何得到它。有什么想法吗?

1 个答案:

答案 0 :(得分:1)

该值不是必需的,并且只有default value,所以只要您对该默认值感到满意,就不要设置它。