Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: db
- remote_user: root
- tasks:
- #- name: "Change Time Zone"
- # command: \cp /usr/share/zoneinfo/America/Toronto /etc/localtime
- - name: "JAVA Deployment"
- yum:
- name: ['java-1.8.0-openjdk', 'java-1.8.0-openjdk-devel']
- state: present
- become: True
- - name: "Create JAVA config file"
- copy:
- dest: "/etc/profile.d/java8.sh"
- content: |
- export JAVA_HOME=$(dirname $(dirname $(readlink $(readlink $(which javac)))))
- export PATH=\$PATH:\$JAVA_HOME/bin
- export CLASSPATH=.:\$JAVA_HOME/jre/lib:\$JAVA_HOME/lib:\$JAVA_HOME/lib/tools.jar
- #- name: "Set JAVA source"
- # command: source /etc/profile.d/java8.sh
- #- name: "Verifyng JAVAversion"
- # command: java -version
- # command: alternatives --list
- # command: alternatives --config java
- - name: "Import repository key"
- ansible.builtin.rpm_key:
- state: present
- key: https://artifacts.elastic.co/GPG-KEY-elasticsearch
- - name: "Create ELK repository file"
- copy:
- dest: "/etc/yum.repos.d/elasticsearch.repo"
- content: |
- [elasticsearch]
- name=Elasticsearch repository for 7.x packages
- baseurl=https://artifacts.elastic.co/packages/7.x/yum
- gpgcheck=1
- gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
- enabled=0
- autorefresh=1
- type=rpm-md
- - name: "YUM updating"
- command: yum update -y
- - name: "Installing ELK stack"
- yum:
- name: ['elasticsearch', 'kibana', 'logstash', 'filebeat']
- state: present
- become: True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement