HOW TO ADD A LINE WITH ANSIBLE WITH TAB SPACE IN A FILE




-bash-4.2# vi add_line_syslog.yml
---
- name: script in order to add in the server list below with TAB spaces a Line in the SYSLOG CONF
  hosts: oraking
  tasks:
    - name: Add a Line  in /etc/syslog.conf in order to delivery that information to another server
      lineinfile:
        path: /etc/syslog.conf
        line: "*.err;auth.notice;auth.info;local0.info\t\t@10.10.10.200"
        insertbefore: '\*.alert;kern.err;daemon.err'

    - name: Restart system-log
      command: /usr/sbin/svcadm restart svc:/system/system-log:default




Comments