| # |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| - name: "enable epel yum repo" |
| yum: name=epel-release state=present |
| - name: "install packages" |
| yum: |
| name: |
| - vim |
| - git |
| - wget |
| - gcc-c++ |
| - collectd |
| - screen |
| - patch |
| - "{{ java_package }}" |
| state: present |
| - name: "configure node shutdown" |
| shell: shutdown +{{ shutdown_delay_minutes }} &> {{ user_home }}/.shutdown creates={{ user_home }}/.shutdown |
| when: shutdown_delay_minutes > 0 |
| - name: "create install directory on all hosts" |
| file: path={{ install_dir }} state=directory owner={{ cluster_user }} group={{ cluster_group }} |
| - name: "install maven" |
| unarchive: src={{ tarballs_dir }}/{{ maven_tarball }} dest={{ install_dir }} creates={{ maven_home }} |
| - name: "chown maven home" |
| file: path={{ maven_home }} recurse=yes owner={{ cluster_user }} group={{ cluster_group}} |
| - name: "install hub" |
| unarchive: src={{ tarballs_dir }}/{{ hub_tarball }} dest={{ install_dir }} creates={{ hub_home }} |
| when: install_hub |
| - name: "chown hub home" |
| file: path={{ hub_home }} recurse=yes owner={{ cluster_user }} group={{ cluster_group}} |
| when: install_hub |
| - name: "configure collectd" |
| template: src=collectd.conf dest=/etc/collectd.conf |
| when: "'metrics' in groups" |
| notify: |
| - restart collectd |
| - name: "ensure collectd is running (and enable it at boot)" |
| service: name=collectd state=started enabled=yes |
| when: "'metrics' in groups" |