ansible-logrotate icon indicating copy to clipboard operation
ansible-logrotate copied to clipboard

Add an option to skip logrotate installation

Open bobrik opened this issue 9 years ago • 4 comments

Some people run on weird systems without apt (like Gentoo), but still want to use configuration management tools. I can come up with PR that allows to skip logrotate installation. What do you think?

bobrik avatar Mar 17 '15 18:03 bobrik

I'm not very familiar with Gentoo but it sounds like whatever other management tool you're using relies on or can use the /etc/logrotate configuration, is that correct? What would be the typical setup steps then? Sorry for the delayed reply, this didn't make it to my inbox for some reason.

nickhammond avatar Apr 29 '15 20:04 nickhammond

This one fails:

- name: nickhammond.logrotate | Install logrotate
  action: "{{ansible_pkg_mgr}} pkg=logrotate state=present"

In Gentoo ansible_pkg_mgr resolves to portage: http://docs.ansible.com/portage_module.html

Error: msg: unsupported parameter for module: pkg

I think we could change task to this:

    - name: nickhammond.logrotate | Install logrotate
      action: "{{ansible_pkg_mgr}} pkg=logrotate state=present"
      when: logrotate_install_package

With default value of logrotate_install_package set to true. This way it would be backwards-compatible and usable by people whose package management module does not work like apt.

What do you think?

bobrik avatar Apr 30 '15 07:04 bobrik

That makes sense to me, let me know if you still want to submit a PR or I can work on it too.

nickhammond avatar Feb 06 '16 02:02 nickhammond

I had a need for this flag so I made PR #43.

rcuza avatar Oct 18 '18 03:10 rcuza