File tree Expand file tree Collapse file tree 3 files changed +35
-31
lines changed
Expand file tree Collapse file tree 3 files changed +35
-31
lines changed Original file line number Diff line number Diff line change 1616# See the License for the specific language governing permissions and
1717# limitations under the License.
1818#
19-
20- include_recipe "git"
21-
2219unless Chef ::Config [ :solo ]
2320 es_server_results = search ( :node , "roles:#{ node [ 'grafana' ] [ 'es_role' ] } AND chef_environment:#{ node . chef_environment } " )
2421 unless es_server_results . empty?
4845
4946case node [ 'grafana' ] [ 'install_type' ]
5047 when "git"
51- git "#{ node [ 'grafana' ] [ 'install_dir' ] } /#{ node [ 'grafana' ] [ 'git' ] [ 'branch' ] } " do
52- repository node [ 'grafana' ] [ 'git' ] [ 'url' ]
53- reference node [ 'grafana' ] [ 'git' ] [ 'branch' ]
54- case node [ 'grafana' ] [ 'git' ] [ 'type' ]
55- when "checkout"
56- action :checkout
57- when "sync"
58- action :sync
59- end
60- user grafana_user
61- end
62- link "#{ node [ 'grafana' ] [ 'install_dir' ] } /current" do
63- to "#{ node [ 'grafana' ] [ 'install_dir' ] } /#{ node [ 'grafana' ] [ 'git' ] [ 'branch' ] } "
64- end
65- node . set [ 'grafana' ] [ 'web_dir' ] = "#{ node [ 'grafana' ] [ 'install_dir' ] } /current/src"
48+ include_recipe 'grafana::install_git'
6649 when "file"
67- case node [ 'grafana' ] [ 'file' ] [ 'type' ]
68- when "zip"
69- include_recipe 'ark::default'
70- ark 'grafana' do
71- url node [ 'grafana' ] [ 'file' ] [ 'url' ]
72- path node [ 'grafana' ] [ 'install_path' ]
73- checksum node [ 'grafana' ] [ 'file' ] [ 'checksum' ]
74- owner grafana_user
75- strip_leading_dir false
76- action :put
77- end
78- node . set [ 'grafana' ] [ 'web_dir' ] = node [ 'grafana' ] [ 'install_dir' ]
79- end
50+ include_recipe 'grafana::install_file'
8051end
8152
8253template "#{ node [ 'grafana' ] [ 'web_dir' ] } /config.js" do
Original file line number Diff line number Diff line change 1+ case node [ 'grafana' ] [ 'file' ] [ 'type' ]
2+ when "zip"
3+ include_recipe 'ark::default'
4+ ark 'grafana' do
5+ url node [ 'grafana' ] [ 'file' ] [ 'url' ]
6+ path node [ 'grafana' ] [ 'install_path' ]
7+ checksum node [ 'grafana' ] [ 'file' ] [ 'checksum' ]
8+ owner grafana_user
9+ strip_leading_dir false
10+ action :put
11+ end
12+ node . set [ 'grafana' ] [ 'web_dir' ] = node [ 'grafana' ] [ 'install_dir' ]
13+ end
Original file line number Diff line number Diff line change 1+
2+ include_recipe "git"
3+
4+ git "#{ node [ 'grafana' ] [ 'install_dir' ] } /#{ node [ 'grafana' ] [ 'git' ] [ 'branch' ] } " do
5+ repository node [ 'grafana' ] [ 'git' ] [ 'url' ]
6+ reference node [ 'grafana' ] [ 'git' ] [ 'branch' ]
7+ case node [ 'grafana' ] [ 'git' ] [ 'type' ]
8+ when "checkout"
9+ action :checkout
10+ when "sync"
11+ action :sync
12+ end
13+ user grafana_user
14+ end
15+
16+ link "#{ node [ 'grafana' ] [ 'install_dir' ] } /current" do
17+ to "#{ node [ 'grafana' ] [ 'install_dir' ] } /#{ node [ 'grafana' ] [ 'git' ] [ 'branch' ] } "
18+ end
19+
20+ node . set [ 'grafana' ] [ 'web_dir' ] = "#{ node [ 'grafana' ] [ 'install_dir' ] } /current/src"
You can’t perform that action at this time.
0 commit comments