From 99e10784516000ef8ef3518229429df3a1886ec9 Mon Sep 17 00:00:00 2001 From: eoli3n Date: Tue, 19 Dec 2017 01:08:41 +0100 Subject: [PATCH] improve install.sh --- install.sh | 14 ++++++++++++-- install.yml | 3 ++- roles/packages/tasks/common.yml | 28 ---------------------------- roles/packages/tasks/desktop.yml | 28 ---------------------------- roles/packages/tasks/main.yml | 12 ------------ 5 files changed, 14 insertions(+), 71 deletions(-) delete mode 100644 roles/packages/tasks/common.yml delete mode 100644 roles/packages/tasks/desktop.yml delete mode 100644 roles/packages/tasks/main.yml diff --git a/install.sh b/install.sh index 6aa6117..0d73765 100755 --- a/install.sh +++ b/install.sh @@ -15,9 +15,19 @@ then exit 1 fi -echo "### DRYRUN #################################################################" +echo "### LIST TASKS #################################################################" -ansible-playbook -i "localhost," -c local install.yml --ask-become-pass -CD -t $1 +ansible-playbook -i "localhost," -c local install.yml --list-tasks -t desktop | grep TAGS | egrep -v 'play|debug|include_role' | sed 's/\ *\(.*\)TAGS.*$/\1/' + +echo "Do you want to dryrun ? (Y/n)" +read ok +ok=${ok:-Y} + +if [[ "$ok" == "Y" ]] +then + echo "### DRYRUN ###################################################################" + ansible-playbook -i "localhost," -c local install.yml --ask-become-pass -CD -t $1 +fi echo "Do you want to install ? (Y/n)" read ok diff --git a/install.yml b/install.yml index 5bf4286..8f3b37c 100644 --- a/install.yml +++ b/install.yml @@ -3,7 +3,7 @@ tags: [ 'server', 'laptop', 'desktop' ] roles: - - { role: packages, tags: packages } + - { role: packages-common, tags: packages-common } - { role: zsh, tags: zsh } - { role: vim, tags: vim } - { role: terminfo, tags: terminfo } @@ -14,6 +14,7 @@ tags: [ 'desktop', 'laptop' ] roles: + - { role: packages-desktop, tags: packages-desktop } - { role: cursor, tags: cursor } - { role: i3-wm, tags: i3-wm } - { role: compton, tags: compton } diff --git a/roles/packages/tasks/common.yml b/roles/packages/tasks/common.yml deleted file mode 100644 index c1327d3..0000000 --- a/roles/packages/tasks/common.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- name: Install common packages - package: name={{item}} state=present - with_items: - - curl - - wget - - pygmentize - become: True - -- name: Install common packages (Archlinux) - pacman: name={{item}} state=present - with_items: - - expac - - jshon - when: ansible_os_family == "Archlinux" - become: True - -- name: Install cower on Archlinux - shell: creates=/usr/bin/cower curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=cower; makepkg PKGBUILD --skippgpcheck --install --needed --noconfirm - when: ansible_os_family == "Archlinux" - -- name: Install pacaur on Archlinux - shell: creates=/usr/bin/pacaur curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=pacaur; makepkg PKGBUILD --install --needed --noconfirm - when: ansible_os_family == "Archlinux" - -- name: Install packer on Archlinux - shell: creates=/usr/bin/packer curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=packer-git; makepkg PKGBUILD --install --needed --noconfirm - when: ansible_os_family == "Archlinux" diff --git a/roles/packages/tasks/desktop.yml b/roles/packages/tasks/desktop.yml deleted file mode 100644 index e07616c..0000000 --- a/roles/packages/tasks/desktop.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- name: Install Desktop packages - package: name={{item}} state=present - with_items: - - xorg-server - - xorg-xinit - - lxappearance - - slop - - maim - - feh - - xclip - - xorg-xrdb - - xorg-xfd - - connman - - geary - - ttf-hack - become: True - -- name: Install Desktop packages (Archlinux) - packer: name={{item}} state=present - with_items: - - google-chrome - - connman-gtk - - gnome-ssh-askpass2 - - ttf-font-awesome - - ttf-unifont - - ttf-font-icons - when: ansible_os_family == "Archlinux" diff --git a/roles/packages/tasks/main.yml b/roles/packages/tasks/main.yml deleted file mode 100644 index 3052e7f..0000000 --- a/roles/packages/tasks/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- import_tasks: common.yml - tags: [ 'desktop', 'laptop', 'server' ] - -- import_tasks: desktop.yml - tags: [ 'desktop', 'laptop' ] - -#- import_tasks: laptop.yml -# tags: laptop - -#- import_tasks: server.yml -# tags: server