You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
---
|
|
- 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'
|
|
|
|
- name: make dir2
|
|
become: true
|
|
file:
|
|
path: "/var/log-in/test1"
|
|
state: directory
|
|
owner: docker
|
|
group: docker
|
|
mode: '0755'
|
|
|
|
# --------------------------------------------------------------------------------------
|
|
# --------------------- kill and save ps tp tmp
|
|
# --------------------------------------------------------------------------------------
|
|
|
|
- name: find fluentd
|
|
#shell: df -h >> /var/log-in/test/test
|
|
shell: df -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 }}"
|
|
|
|
- name: write to /var/log-in/test1/test11
|
|
shell: "echo {{ item }} >> /var/log-in/test1/test11"
|
|
with_items: "{{ fluentddate.stdout_lines }}"
|
|
|