Snort in Debian 8 Jessie

DEbian Jessie doesn’t have a package for Snort so I’ve at least two options, compile from source and take it from testing. I don’t want to have broken packages so I won’t add testing to my sources list directly and I will only use it for specific packages, in this case snort.
It works and nothing is broken.

vim /etc/apt/apt.conf.d/99defaultrelease:


  APT::Default-Release "stable";

vim /etc/apt/sources.list.d/stable.list


  deb     http://ftp.de.debian.org/debian/    stable main contrib non-free
  deb-src http://ftp.de.debian.org/debian/    stable main contrib non-free

  deb     http://security.debian.org/         stable/updates  main contrib non-free

vim /etc/apt/sources.list.d/testing.list


  deb     http://ftp.de.debian.org/debian/    testing main contrib non-free
  deb-src http://ftp.de.debian.org/debian/    testing main contrib non-free

  deb     http://security.debian.org/         testing/updates  main contrib non-free

apt-get update

apt-cache -t testing search snort

  ...
  snort - flexible Network Intrusion Detection System
  snort-common - flexible Network Intrusion Detection System - common files
  snort-common-libraries - flexible Network Intrusion Detection System - libraries
  snort-doc - flexible Network Intrusion Detection System - documentation
  snort-rules-default - flexible Network Intrusion Detection System - ruleset
  ...

apt-get -t testing install snort

Source:
http://serverfault.com/questions/22414/how-can-i-run-debian-stable-but-install-some-packages-from-testing

Now my Ansible code


- hosts: 
    somehost
  gather_facts: yes

  tasks:

  - name: Copy defaultrelease for apt
    copy: 
      src: files/99defaultrelease
      dest: "/etc/apt/apt.conf.d/99defaultrelease"

  - file: dest=/etc/apt/sources.list.d/ state=directory

  - name: Copy stable and testing sources
    copy: 
      src: "files/{{ item }}"
      dest: "/etc/apt/sources.list.d/"
    with_items:
      - stable.list
      - testing.list

  - name: Update apt cache if needed.
    apt: update_cache=yes

  - name: Install Snort
    apt: 
      name={{ item }} 
      state=present 
      default_release=testing
    with_items:
      - snort
      - snort-common
      - snort-rules-default 

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s