From 01e5c0577677fb8ff8fcf53c8c3ab8c4589bd219 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Wed, 17 Feb 2016 01:05:02 +0100 Subject: [PATCH] Add conditions everywhere. --- defaults/main.yml | 5 ++++- tasks/desktop.yml | 1 + tasks/development.yml | 31 +++++++++++++++++++++++-------- tasks/main.yml | 27 +++------------------------ tasks/multimedia.yml | 14 +++++++++++--- tasks/network.yml | 12 +++++++++--- tasks/office.yml | 4 ++++ tasks/security.yml | 22 +++++++++++++++------- tasks/shell.yml | 2 ++ tasks/shopping.yml | 2 +- tasks/system.yml | 1 + 11 files changed, 74 insertions(+), 47 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 9cad3bb..280eaec 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,10 @@ --- # defaults file for glenux.basesystem +# basesystem_role: [workstation|server|laptop] basesystem_role: workstation + +# basesystem_arch: [i386|amd64|powerpc] basesystem_arch: null -basesystem_gui: false basesystem_task_desktop: false basesystem_task_development: false @@ -13,4 +15,5 @@ basesystem_task_security: false basesystem_task_shell: false basesystem_task_shopping: false basesystem_task_system: false +basesystem_task_shell: false diff --git a/tasks/desktop.yml b/tasks/desktop.yml index 744aa4a..aa5a05a 100644 --- a/tasks/desktop.yml +++ b/tasks/desktop.yml @@ -10,4 +10,5 @@ - x2goclient - kde-plasma-desktop - xserver-xorg-core + when: basesystem_task_desktop == true diff --git a/tasks/development.yml b/tasks/development.yml index b009f4a..1f5d0b7 100644 --- a/tasks/development.yml +++ b/tasks/development.yml @@ -1,10 +1,11 @@ --- -- name: "Installing development utils" +- name: "Installing system development utils" apt: > name="{{item}}" state=present with_items: - - autoconf + - manpages-dev + - autoconf - automake - build-essential - cmake @@ -21,12 +22,6 @@ - subversion - tmux - vim - - vim-gtk - - kate - - kdevelop - - umbrello - - umlet - - xutils - curl - mercurial - make @@ -35,7 +30,20 @@ - gcc-5 - gcc-5-multilib - clang-3.8 + when: basesystem_task_development == true +- name: "Installing desktop development utils" + apt: > + name="{{item}}" + state=present + with_items: + - umbrello + - umlet + - kdevelop + - vim-gtk + - kate + - xutils + when: basesystem_task_development == true && basesystem_task_desktop == true - name: "Installing Haskell language" apt: > @@ -63,6 +71,7 @@ - libghc-safe-dev - libghc-uri-dev - libghc-url-dev + when: basesystem_task_development == true - name: "Installing Ruby language" apt: > @@ -70,6 +79,7 @@ state=present with_items: - gem2deb + when: basesystem_task_development == true - name: "Installing php5 language" apt: > @@ -77,6 +87,7 @@ state=present with_items: - virtualenv + when: basesystem_task_development == true - name: "Installing Rust language" apt: > @@ -87,6 +98,7 @@ - rust-doc - rust-gdb - cargo + when: basesystem_task_development == true - name: "Installing Go language" apt: > @@ -94,6 +106,7 @@ state=present with_items: - golang + when: basesystem_task_development == true - name: "Installing PHP language" apt: > @@ -112,6 +125,7 @@ - php5-readline - php5-tidy - php5-xsl + when: basesystem_task_development == true - name: "Installing development libraries" apt: > @@ -129,4 +143,5 @@ - xutils-dev - libsqlite3-dev - libsqlite0-dev + when: basesystem_task_development == true diff --git a/tasks/main.yml b/tasks/main.yml index 5812be2..3219da4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,20 +1,5 @@ --- -# Force yes no matter the value -- set_fact: basesystem_task_desktop=true - when: basesystem_role == 'workstation' -- set_fact: basesystem_task_multimedia=true - when: basesystem_role == 'workstation' -- set_fact: basesystem_task_office=true - when: basesystem_role == 'workstation' -- set_fact: basesystem_task_shopping=true - when: basesystem_role == 'workstation' - -- set_fact: basesystem_task_development=false - when: basesystem_role == 'server' -- set_fact: basesystem_task_security=true - when: basesystem_role == 'server' - - template: src=apt_conf_glenuxnet_base.j2 dest=/etc/apt/apt.conf.d/00glenuxnet_base @@ -32,6 +17,9 @@ - apt_repository: repo='deb http://ftp.fr.debian.org/debian/ unstable main contrib non-free' state=present - apt_repository: repo='deb-src http://ftp.fr.debian.org/debian/ unstable main contrib non-free' state=present +- apt_repository: repo='deb http://ftp.fr.debian.org/debian/ experimental main contrib non-free' state=present +- apt_repository: repo='deb-src http://ftp.fr.debian.org/debian/ experimental main contrib non-free' state=present + # Debian security - apt_repository: repo='deb http://security.debian.org/ stable/updates main contrib non-free' state=present - apt_repository: repo='deb-src http://security.debian.org/ stable/updates main contrib non-free' state=present @@ -45,19 +33,10 @@ - include: system.yml - include: desktop.yml - when: basesystem_task_desktop == true - include: shopping.yml - when: basesystem_task_shopping == true - include: multimedia.yml - when: basesystem_task_multimedia == true - include: development.yml - when: basesystem_task_development == true - include: network.yml - when: basesystem_task_network == true -- include: office.yml - when: basesystem_task_office == true - include: security.yml - when: basesystem_task_security == true - include: shell.yml - when: basesystem_task_shell == true diff --git a/tasks/multimedia.yml b/tasks/multimedia.yml index e072846..08b7181 100644 --- a/tasks/multimedia.yml +++ b/tasks/multimedia.yml @@ -1,5 +1,14 @@ --- -- name: "Installing multimedia tools" +- name: "Installing desktop multimedia tools" + apt: > + name="{{item}}" + state=present + with_items: + - transcode + - ffmpeg + when: basesystem_task_multimedia == true + +- name: "Installing desktop multimedia tools" apt: > name="{{item}}" state=present @@ -7,8 +16,7 @@ - mpv - mplayer - vlc - - transcode - - ffmpeg - flashplugin-nonfree - pepperflashplugin-nonfree + when: basesystem_task_multimedia == true && basesystem_task_desktop == true diff --git a/tasks/network.yml b/tasks/network.yml index 0b9831e..60fbc1c 100644 --- a/tasks/network.yml +++ b/tasks/network.yml @@ -1,11 +1,17 @@ --- -- name: "Installing network tools" +- name: "Installing system network tools" apt: > name="{{item}}" state=present with_items: - nmap - - wireshark - - manpages-dev - vlan + when: basesystem_task_network == true +- name: "Installing desktop tools" + apt: > + name="{{item}}" + state=present + with_items: + - wireshark + when: basesystem_task_network == true && basesystem_task_desktop == true diff --git a/tasks/office.yml b/tasks/office.yml index 9e4b0d8..60fcdc1 100644 --- a/tasks/office.yml +++ b/tasks/office.yml @@ -8,6 +8,7 @@ - libreoffice - lyx - ttf-mscorefonts-installer + when: basesystem_task_desktop == true && basesystem_task_office == true - name: "Installing office/image utils" apt: > @@ -18,6 +19,8 @@ - geeqie - gwenview - inkscape + - okular + when: basesystem_task_desktop == true && basesystem_task_office == true - name: "Installing office/communication tools" apt: > @@ -29,4 +32,5 @@ - chromium - psi-plus - mutt + when: basesystem_task_desktop == true && basesystem_task_office == true diff --git a/tasks/security.yml b/tasks/security.yml index 49a3df6..ff47700 100644 --- a/tasks/security.yml +++ b/tasks/security.yml @@ -1,5 +1,5 @@ --- -- name: "Installing security tools" +- name: "Installing system security tools" apt: > name="{{item}}" state=present @@ -7,15 +7,23 @@ - bruteforce-luks # system & security - encfs # system & security - encfs # system & security - - cryptkeeper # desktop & security - - cryptmount # desktop & security - cryptsetup # system & security - cryptsetup-bin # system & security - libpam-encfs # system & security - - keepassx # desktop & security - - kpcli # ?? & security - - pwgen # ?? & security - openvpn # system or desktop and security - - network-manager-openvpn # desktop & security - easy-rsa # system & security + when: basesystem_task_security == true + +- name: "Installing desktop security tools" + apt: > + name="{{item}}" + state=present + with_items: + - cryptkeeper # desktop & security + - cryptmount # desktop & security + - network-manager-openvpn # desktop & security + - keepassx # desktop & security + - kpcli # desktop ?? & security + - pwgen # desktop & security + when: basesystem_task_desktop == true && basesystem_task_security == true diff --git a/tasks/shell.yml b/tasks/shell.yml index ed9dc4e..6a9b6b7 100644 --- a/tasks/shell.yml +++ b/tasks/shell.yml @@ -4,9 +4,11 @@ repo=https://github.com/clvv/fasd.git dest=/usr/local/fasd version=master + when: basesystem_task_shell == true - command: make install args: chdir: /usr/local/fasd #creates: + when: basesystem_task_shell == true diff --git a/tasks/shopping.yml b/tasks/shopping.yml index 80f19b5..fd2b1ec 100644 --- a/tasks/shopping.yml +++ b/tasks/shopping.yml @@ -5,4 +5,4 @@ state=present with_items: - esniper - + when: basesystem_task_shopping == true diff --git a/tasks/system.yml b/tasks/system.yml index 3eb8080..a85e8ee 100644 --- a/tasks/system.yml +++ b/tasks/system.yml @@ -8,5 +8,6 @@ - lshw - slay - unrar + - p7zip-full