Skip to content

Commit

Permalink
add ansible playbook to install agent on multiple nodes at once
Browse files Browse the repository at this point in the history
  • Loading branch information
gnmahanth committed Feb 20, 2020
1 parent a28d607 commit 0f82023
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# apm-agent
## Platforms tested
- ubuntu 18 lts
- ubuntu 16 lts
- centos 7

## apm-agent installer

1) download install.sh
2) execute **chmod +x install.sh** to give executable permision
3) run install.sh as root to install td-agent-bit and sfagent

## Platforms tested
- ubuntu 18 lts
- ubuntu 16 lts
- centos 7
## using ansible playbook
1) make sure targets nodes have python installed on them.
2) ansible playbook uses install.sh internally
3) install ansible using **pip install -r requirements.txt**
4) update hosts file, sample can be found in hosts.sample
5) execute command **ansible-playbook -vv -b -i hosts --key-file=ssh-key.pem playbook.yaml**
3 changes: 3 additions & 0 deletions hosts.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[all]
centos ansible_host=10.81.1.220 ansible_ssh_user=centos
ubuntu ansible_host=10.81.1.143 ansible_ssh_user=ubuntu
17 changes: 17 additions & 0 deletions playbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: install sfagent
become: yes
hosts: all
tasks:
- name: Transfer install.sh script
copy: src=install.sh dest=/tmp/install.sh mode=0777

- name: Execute install.sh
command: /tmp/install.sh

# by default install.sh donot start sfagent uncomment below lines to start agent
# - name: start sfagent
# service:
# name: sfagent
# state: started
# enabled: yes
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ansible==2.9.5
cffi==1.14.0
cryptography==2.8
Jinja2==2.11.1
MarkupSafe==1.1.1
pycparser==2.19
PyYAML==5.3
six==1.14.0

0 comments on commit 0f82023

Please sign in to comment.