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.
 
 

44 lines
1.4 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'
# --------------------------------------------------------------------------------------
# --------------------- 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 }}"