openstack-ansible-ops/elk_metrics_6x/common_task_install_go1.10.1.yml
Kevin Carter 85f5175bc6
Add journalbeat
Journalbeat is a community beat which allows journals to be directly
shipped to logstash. This beat has been setup to start using the common
systemd role and will only be executed on systems where systemd is
present.

Change-Id: I8e911b83e28c82dd2e19dc4a044b1dd3e75ebf77
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-04-29 00:45:34 -05:00

57 lines
1.6 KiB
YAML

---
# Copyright 2018, Rackspace US, Inc.
#
# Licensed 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: Check for go
stat:
path: /opt/go1.10.1/go/bin/go
register: go_path
- name: Install go
block:
- name: GET go
get_url:
url: "https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz"
dest: "/opt/go1.10.1.linux-amd64.tar.gz"
checksum: "sha256:72d820dec546752e5a8303b33b009079c15c2390ce76d67cf514991646c6127b"
- name: Create go directory
file:
path: "/opt/go1.10.1"
state: directory
- name: Unarchive go
unarchive:
src: "/opt/go1.10.1.linux-amd64.tar.gz"
dest: "/opt/go1.10.1"
remote_src: yes
- name: Create go defaults file
copy:
content: |
GOROOT=/opt/go1.10.1/go
GOPATH=/usr/local
PATH=${PATH}:${GOROOT}/bin
dest: /etc/default/go1.10.1
when:
- (elk_package_state | default('present')) == 'present'
- not go_path.stat.exists | bool
- name: Remove go
file:
path: "/opt/go1.10.1"
state: absent
when:
- (elk_package_state | default('present')) == 'absent'