Skip to content

Instantly share code, notes, and snippets.

Created April 22, 2014 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/11184928 to your computer and use it in GitHub Desktop.
Save anonymous/11184928 to your computer and use it in GitHub Desktop.
---
- name: preset old_ubuntu variable
set_fact: old_ubuntu=no
- name: check whether it's Ubuntu < 14
set_fact: old_ubuntu=yes
when: ansible_lsb.id == "Ubuntu" and ansible_lsb.major_release|int < 14
- name: add rsyslog apt key
apt_key: url=http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xAEF0CF8E
when: old_ubuntu == "yes"
- name: add rsyslog repository
apt_repository: repo='ppa:adiscon/v7-stable'
when: old_ubuntu == "yes"
- name: set package name for Ubuntu < 14
set_fact: rsyslog_pkg=rsyslog
when: old_ubuntu == "yes"
- name: set package name for Ubuntu >= 14
set_fact: rsyslog_pkg=rsyslog-gnutls
when: old_ubuntu != "yes"
- name: upgrade rsyslog with tls (ubuntu < 14)
apt: pkg={{ rsyslog_pkg }} state=latest update_cache=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment