Might be better to list the files you want to edit as vars on each of the hosts
in your inventory.
On 25 April 2017 at 14:35, vinod kumar <
vinodkum...@gmail.com> wrote:
> Hi All,
>
> I am writing a play book to add below two lines to a service config file
> under /etc/xinetd.d/. The filename generally starts with oscssd*. As i have
> multiple servers, this file name is getting changed and playbook is not
> working as expected as the filename is getting change.
>
> Please let me know how can i incorporate the regular expression to find the
> correct file name. /etc/xinetd.d/oscssd* is not working with lineinfile
> module.
>
> cat xinetd.yml
> ---
> - name: xined log reduction playbook
> hosts: test-servers
> become: True
> become_method: sudo
> tasks:
> - name: updating with log_on_success value in xinetd oscssd3001
> configuration
> lineinfile:
> name: "/etc/xinetd.d/oscssd3001"
> insertbefore: '^}'
> line: ' log_on_success ='
> ignore_errors: yes
> - name: updating with log_on_failure value in xinetd oscssd3001
> configuration
> lineinfile:
> name: "/etc/xinetd.d/oscssd3001"
> insertbefore: '^}'
> line: ' log_on_failure ='
> ignore_errors: yes
> - name: updating with log_on_success value in xinetd oscssd5001
> configuration
> lineinfile:
> name: "/etc/xinetd.d/oscssd5001"
> insertbefore: '^}'
> line: ' log_on_success ='
> ignore_errors: yes
> - name: updating with log_on_failure value in xinetd oscssd5001
> configuration
> lineinfile:
> name: "/etc/xinetd.d/oscssd5001"
> insertbefore: '^}'
> line: ' log_on_failure ='
> ignore_errors: yes
> - name: Reload of xinetd services
> service:
> name: xinetd
> state: reloaded
>
>
> Thanks in advance.
>
> Regards,
> Vinod.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ansible-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/96f43351-b409-46d1-9bea-b16d2abc58b5%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.