Browse Source

Upload files to ''

master
cse47122 4 years ago
parent
commit
4efbcea3d0
  1. 5
      Makefile
  2. 44
      fluentd-test-mongo-free.yml
  3. 15
      fluentd-test-mongo-free.yml.sh
  4. 15
      fluentd-test-mongo.yml.sh
  5. 4
      inventory.yml

5
Makefile

@ -0,0 +1,5 @@
all:
./fluentd.yml.sh
./fluentd-config-update.yml.sh

44
fluentd-test-mongo-free.yml

@ -0,0 +1,44 @@
---
- hosts: service
remote_user: docker
gather_facts: no
vars:
user: "docker"
tasks:
# --------------------------------------------------------------------------------------
# --------------------- create test dir
# --------------------------------------------------------------------------------------
# ------------------------
# test dir
# -------------------------
- name: make dir for test
become: true
file:
path: "/var/log-in/test"
state: directory
owner: docker
group: docker
mode: '0755'
# --------------------------------------------------------------------------------------
# --------------------- kill and save ps tp tmp
# --------------------------------------------------------------------------------------
- name: find fluentd
#shell: free -h >> /var/log-in/test/test
shell: free -h
#shell: "ps efw -opid,cmd -Cfluentd | pgrep -o fluentd"
register: fluentddate
- name: ls fluentddate
debug: var=fluentddate.stdout_lines
- name: write to /var/log-in/test/test2
shell: "echo {{ item }} >> /var/log-in/test/test2"
with_items: "{{ fluentddate.stdout_lines }}"

15
fluentd-test-mongo-free.yml.sh

@ -0,0 +1,15 @@
#!/bin/sh
ip4=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
ip6=$(/sbin/ip -o -6 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
echo "[service]" > /project/courses/fluentd/inventory.yml
/project/bin/swarmlab-nmap >> /project/courses/fluentd/inventory.yml
# include master or not
echo $ip4 >> /project/courses/fluentd/inventory.yml
ansible-playbook -u docker -i inventory.yml fluentd-test-mongo-free.yml -f 5 --ask-pass --ask-become-pass

15
fluentd-test-mongo.yml.sh

@ -0,0 +1,15 @@
#!/bin/sh
ip4=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
ip6=$(/sbin/ip -o -6 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
echo "[service]" > /project/courses/fluentd/inventory.yml
/project/bin/swarmlab-nmap >> /project/courses/fluentd/inventory.yml
# include master or not
echo $ip4 >> /project/courses/fluentd/inventory.yml
ansible-playbook -u docker -i inventory.yml fluentd-test-mongo.yml -f 5 --ask-pass --ask-become-pass

4
inventory.yml

@ -0,0 +1,4 @@
[service]
172.24.0.3
172.24.0.4
172.24.0.2
Loading…
Cancel
Save