diff --git a/Makefile b/Makefile index 2a7c838ee5ec2869a988d6d5671097b9bdd9c975..507ed38452f08a84534ef27dff474a88bc15f33d 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ -EDITOR = geany +help: # Print help on Makefile + @grep '^[^.#]\+:\s\+.*#' Makefile | \ + sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\e[1;33;4;40m"`\1`printf "\033[0m"` \3/" | \ + expand -t20 -clean: - # Remove files not in source control - find . -type f -name "*.retry" -delete +clean: # Remove files not tracked in source control find . -type f -name "*.orig" -delete -open_all: +open_all: # Open all projects files ${EDITOR} .gitignore inv* Makefile README.md ${EDITOR} tasks/*.yml ${EDITOR} tasks/files/sshd_config @@ -18,5 +19,5 @@ open_all: ${EDITOR} tasks/user_cfg/vars/*.yml ${EDITOR} tasks/vars/*.yml -inventory_generation: +gen_invent: # Generate base inventory cp inventory.sample inventory && ${EDITOR} inventory diff --git a/README.md b/README.md index 8e4249013c4224d47bf0917976671ea7449f2d5f..d002fd3477f145c63fb4c68666dda34c413f7c8f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,6 @@ Suitable for server and workstation. ------------- 1. Setup your `inventory` file from [`inventory.sample`](inventory.sample) : - - `make inventory_generation` + - `make gen_invent` 1. Run `host_info` playbook to `<group_foo>` & `<group_bar>` : - `ansible-playbook tasks/host_info.yml -i inventory -e host_list=<group_foo>:<group_bar>` diff --git a/tasks/apt.yml b/tasks/apt.yml index cf7feedece9e1b44bfb958beeb70bf422400fa10..336aced23e427bc26463742dbff01f44b96da5c5 100644 --- a/tasks/apt.yml +++ b/tasks/apt.yml @@ -18,10 +18,10 @@ when: "'mate' in group_names" ansible.builtin.include_vars: "Mate.yml" - - name: Remove snap packages - when: snap_uninstall_pkg is defined - community.general.snap: - name: "{{ snap_uninstall_pkg }}" + - name: APT | uninstall packages + when: inventory_hostname not in groups.workstat + ansible.builtin.apt: + pkg: "{{ lookup('flattened', base_uninstall_pkg, os_uninstall_pkg) }}" state: absent - name: APT | install base & os packages @@ -32,19 +32,25 @@ state: present update_cache: true - - name: SIGNAL | add key to keyring + - name: SNAP  | remove snap packages + when: snap_uninstall_pkg is defined + community.general.snap: + name: "{{ snap_uninstall_pkg }}" + state: absent + + - name: FLATPAK | add remote when: inventory_hostname in groups.station - ansible.builtin.apt_key: - url: https://updates.signal.org/desktop/apt/keys.asc - keyring: /usr/share/keyrings/signal-desktop-keyring.gpg + community.general.flatpak_remote: + name: flathub + flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo state: present - - name: SIGNAL | add apt repository + - name: FLATPAK | add packages when: inventory_hostname in groups.station - ansible.builtin.apt_repository: - filename: signal-desktop - repo: deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main + community.general.flatpak: + name: com.brave.Browser state: present + remote: flathub - name: APT | install workstation packages when: inventory_hostname in groups.station @@ -55,21 +61,42 @@ state: present update_cache: true - - name: APT | uninstall packages + - name: APT | install develstation packages + when: inventory_hostname in groups.workstat ansible.builtin.apt: - pkg: "{{ lookup('flattened', base_uninstall_pkg, os_uninstall_pkg) }}" - state: absent + cache_valid_time: 3600 + force_apt_get: yes + pkg: "{{ lookup('flattened', workstat_pkg, workstat_os_pkg, workstat_wm_pkg) }}" + state: present + update_cache: true + + - name: APT | add SIGNAL key to keyring + when: inventory_hostname in groups.station + ansible.builtin.apt_key: + url: https://updates.signal.org/desktop/apt/keys.asc + keyring: /usr/share/keyrings/signal-desktop-keyring.gpg + state: present + + - name: APT | add SIGNAL apt repository + when: inventory_hostname in groups.station + ansible.builtin.apt_repository: + filename: signal-desktop + repo: deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main + state: present + + - name: APT | install .deb packages + when: inventory_hostname in groups.station + ansible.builtin.apt: deb={{item}} + with_items: + - https://zoom.us/client/latest/zoom_amd64.deb + - https://flavio.tordini.org/files/minitube/minitube.deb + - https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.deb - name: APT | upgrade all packages to the latest version ansible.builtin.apt: force_apt_get: yes upgrade: safe - - name: APT | install zoom client - when: inventory_hostname in groups.station - ansible.builtin.apt: - deb: https://zoom.us/client/latest/zoom_amd64.deb - - name: APT | remove useless packages from the cache ansible.builtin.apt: force_apt_get: yes diff --git a/tasks/user_cfg/files/dotfiles/vimrc b/tasks/user_cfg/files/dotfiles/vimrc index 086b5543282a8ba75dfa5b1c4046ed0322d74110..84f8cfb8b378ec8df903273c0fcf9c1c4a8da180 100644 --- a/tasks/user_cfg/files/dotfiles/vimrc +++ b/tasks/user_cfg/files/dotfiles/vimrc @@ -98,4 +98,4 @@ set incsearch "set hlsearch " Décommentez la ligne suivante si vous voulez afficher les numéros de ligne -set number relativenumber +set relativenumber number diff --git a/tasks/user_cfg/vars/git.yml b/tasks/user_cfg/vars/git.yml index 1a744a9e387237bdb8bbacfeb196b1209e31e076..4ea4668abbd42e8b3f693fa365799e6c7c9130f0 100644 --- a/tasks/user_cfg/vars/git.yml +++ b/tasks/user_cfg/vars/git.yml @@ -9,7 +9,7 @@ git_repositories: - {local_name: "forga-emb", url_https: "https://gitlab.com/forga/process/fr/embarquement.git"} - {local_name: "forga-glio", url_https: "https://gitlab.com/forga/forga.gitlab.io.git"} - {local_name: "forga-man", url_https: "https://gitlab.com/forga/process/fr/manuel.git"} - - {local_name: "forga-tool-debian", url_https: "https://lab.frogg.it/fcode/ansible/debian.git"} + - {local_name: "forga-tool-debian", url_https: "https://lab.frogg.it/freezed/ansible-debian.git"} - {local_name: "freezed.gl.io", url_https: "https://gitlab.com/free_zed/free_zed.gitlab.io.git"} - {local_name: "ftalk-gitlab", url_https: "https://gitlab.com/ftalk/2020-gitlab.git"} - {local_name: "geostrapy", url_https: "https://lab.frogg.it/fcode/geostrapy.git"} diff --git a/tasks/vars/Debian.yml b/tasks/vars/Debian.yml index 109b270a49cae8193b685e32cbcfebdf1e8828cd..047627b93ee498484ca391ae65ea06120faec1d8 100644 --- a/tasks/vars/Debian.yml +++ b/tasks/vars/Debian.yml @@ -4,6 +4,7 @@ os_pkg: [] os_uninstall_pkg: [] +workstat_os_pkg: [] + station_os_pkg: - - chromium-l10n - firefox-esr-l10n-fr diff --git a/tasks/vars/Gnome.yml b/tasks/vars/Gnome.yml index 3717a48cc6c55fc9656de2c76f3d7e586f5bd3c2..0e3de01b6dc679e2e6c5892ed11e45599ea28f08 100644 --- a/tasks/vars/Gnome.yml +++ b/tasks/vars/Gnome.yml @@ -2,4 +2,7 @@ station_wm_pkg: - gnome-tweaks + - nautilus-image-converter - nautilus-nextcloud + +workstat_wm_pkg: [] diff --git a/tasks/vars/Mate.yml b/tasks/vars/Mate.yml index 4fb645d86a7bdc8db81e652c2ee44408ff418a59..a92478929fbf88db229cb3b5cdc9e0009564b17a 100644 --- a/tasks/vars/Mate.yml +++ b/tasks/vars/Mate.yml @@ -3,3 +3,5 @@ station_wm_pkg: - mate-tweak - caja-nextcloud + +workstat_wm_pkg: [] diff --git a/tasks/vars/Ubuntu.yml b/tasks/vars/Ubuntu.yml index dcc7ea95a93350e4e6f09806c7d3c001c1b7157c..ac55928d0d23e0442ebc535494eb5417b05f8c6b 100644 --- a/tasks/vars/Ubuntu.yml +++ b/tasks/vars/Ubuntu.yml @@ -4,11 +4,11 @@ os_pkg: [] os_uninstall_pkg: - thunderbird + - chromium-browser-l10n + +workstat_os_pkg: [] snap_uninstall_pkg: [] station_os_pkg: - - chromium-browser-l10n - - firefox-locale-fr - - firefox - - nautilus-image-converter + - solaar diff --git a/tasks/vars/main.yml b/tasks/vars/main.yml index 916fc96d01803f7dfb2dd5040d5eaa8062c4fefd..51109d44b5ba232df2d7542d64d7ee369faad248 100644 --- a/tasks/vars/main.yml +++ b/tasks/vars/main.yml @@ -1,34 +1,40 @@ --- base_pkg: + - detox + - git - htop - keychain - locales - lynx - progress - python3-apt + - python3-venv - rsync - screen - sudo - - tmux - unattended-upgrades + - unrar-free - unzip - vim - wget - xkcdpass + - xz-utils - zsh base_uninstall_pkg: - - geany-plugin-shiftcolumn - - jq - - httpie + - ansible + - geany + - make + - meld + - mhwaveedit + - pandoc + - sshpass + - torbrowser-launcher + - tmux -station_pkg: +workstat_pkg: - ansible - - cheese - - easytag - - evolution - - evolution-plugins - geany-plugin-addons - geany-plugin-extrasel - geany-plugin-git-changebar @@ -37,24 +43,28 @@ station_pkg: - geany-plugin-spellcheck - geany-plugin-workbench - geany-plugin-xmlsnippets + - make + - meld + - mhwaveedit + - pandoc + +station_pkg: + - cheese + - evolution + - evolution-plugins + - flatpak - gimp - git - gnome-disk-utility + - gnome-software-plugin-flatpak - gpsprune - hplip - jhead - keepassx - - make - - meld - - mhwaveedit - network-manager-gnome - nextcloud-desktop - - pandoc - pdftk - photocollage - - python3-venv - - sshpass - - tree - signal-desktop - simple-scan - soundconverter