From 3ab687d2790238974f33e4b48b457705924de9da Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 14 Nov 2018 11:46:29 +0100 Subject: [PATCH] Add some rules for fedora/dnf based systems --- README.md | 9 +++++++- defaults/main.yml | 32 ++++++++++++++++++++++++++ tasks/main.yml | 58 ++++++++++++++++++++++++----------------------- 3 files changed, 70 insertions(+), 29 deletions(-) create mode 100644 defaults/main.yml diff --git a/README.md b/README.md index bdf82f8..66a782f 100644 --- a/README.md +++ b/README.md @@ -1 +1,8 @@ -# role-base_packages + role-base_packages +--------------------- + +Base packages auf den gängigsten Linux Systemen installieren + +**Achtung:** +*Nur gestestet unter Debian 9 und Fedora 29!* + diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..a049de9 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,32 @@ +--- +base_packages: + - tmux + - sudo + - htop + - iftop + - iotop + - sysstat + - ethtool + - ethstatus + - nethogs + - nload + - ncdu + - atop + - vim + - nmap + - python3 + - wget + - git + - bash-completion + - unzip + - python3-pip + #- rng-tools + +debian_packages: + - molly-guard + - mtr-tiny + - knot-dnsutils + +fedora_packages: + - mtr + diff --git a/tasks/main.yml b/tasks/main.yml index 8b330c3..fcd4c9f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,34 +1,36 @@ --- -- name: Install common base packages + +- name: Install common base packages [Debian] apt: - package: - - tmux - - sudo - - molly-guard - - htop - - iftop - - iotop - - sysstat - - ethtool - - ethstatus - - nethogs - - nload - - ncdu - - mtr-tiny - - knot-dnsutils - - atop - - vim - - nmap - - python3 - - wget - - git - - bash-completion - - unzip - - python3-pip - #- rng-tools + package: "{{ base_packages }}" state: latest update_cache: yes cache_valid_time: 43200 + when: + ansible_distribution == 'Debian' + +- name: Install common base packages [Debian] + apt: + package: "{{ debian_packages }}" + state: latest + update_cache: yes + cache_valid_time: 43200 + when: + ansible_distribution == 'Debian' + +- name: Install common base packages [Fedora] + package: + name: "{{ base_packages }}" + state: latest + when: + ansible_distribution != 'Debian' + +- name: Install common base packages [Fedora] + package: + name: "{{ fedora_packages }}" + state: latest + when: + ansible_distribution != 'Debian' - name: Install some common Debian specific packages apt: @@ -42,8 +44,8 @@ - name: Remove rpcbind, nfs-common - apt: - pkg: + package: + name: - rpcbind - nfs-common state: absent