delete file on deb install

25 views
Skip to first unread message

Mark Olliver

unread,
Aug 27, 2014, 12:08:36 PM8/27/14
to ansible-project
Hi,

We use a custom config file for redis sentinel, Is there a way with to say that when i have installed the redis package, to remove the file /etc/redis/sentinel.conf. But it should only remove it the once. Later in the run i check if the file is missing and if it is then I add the correct file, the file however is not updated on subsequent runs as it is managed by redis directly.

Thanks

Mark

--
MARK OLLIVER
HEAD OF IT OPERATIONS
 
T. +44(0) 20 7775 5628
 
Infectious Media
3-7 Herbal Hill / London / EC1R 5EJ
www.infectiousmedia.com
 
Infectious Media  
Facebook Twitter LinkedIn Youtube  
 
 
 
This email and any attachments are confidential and may also be
privileged. If you are not the intended recipient, please notify the sender
immediately, and do not disclose the contents to another person, use it for
any purpose, or store, or copy the information in any medium. Please also
destroy and delete the message from your computer.
 


Michael DeHaan

unread,
Aug 27, 2014, 3:05:52 PM8/27/14
to ansible...@googlegroups.com
Yes:

tasks:

    - apt: name=redis state=installed
      notify:
         - remove sentinel

    # if you wish to remove it immediately don't do this, and see below

handlers:

    - name: remove sentinel
      file: path=foo state=absent

If you wish to remove it immediately, instead:

tasks:

  - apt: name=redis state=installed
    register: redis
  - file: path=foo state=absent
    when: redis.changed

etc



--
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/CALKPxXi%2BEG72eG%2BtMQ16qYVeRWMdHk%2BpA5VQWyG_xWAgLkCQ4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages