From 576b301e9c4b0441f19e9d237553e709f8f147db Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 18 Sep 2019 23:14:11 +0200 Subject: [PATCH 1/5] adaptation roles syteme debian --- defaults/main.yml | 32 +++++++++++++++++++++++++++++++- tasks/base_software.yml | 11 ++++++++++- tasks/depot_debian.yml | 6 ++++++ tasks/main.yml | 6 +++++- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 tasks/depot_debian.yml diff --git a/defaults/main.yml b/defaults/main.yml index 646ee2d..6f6c30b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,7 +11,7 @@ time: hwclock: UTC timezone: Europe/Paris -system_base_softwares: +system_base_softwares_arch: - 'zsh' - 'stow' - 'wol' @@ -41,3 +41,33 @@ system_base_softwares: - 'unzip' - 'unrar' - 'git-lfs' + +system_base_softwares_debian: + - 'zsh' + - 'stow' + #- 'wol' + - 'nmap' + #- 'bind-tools' + - 'rsync' + #- 'awesome-terminal-fonts' + - 'wget' + #- 'bat' + #- 'diff-so-fancy' + - 'git' + - 'htop' + - 'thefuck' + - 'tldr' + - 'ntfs-3g' + - 'python-lxml' + - 'tmux' + - 'vim' + - 'zsh-theme-powerlevel9k' + - 'python-pip' + - 'yarn' + - 'npm' + - 'nethogs' + - 'iftop' + - 'zip' + - 'unzip' + - 'unrar' + - 'git-lfs' \ No newline at end of file diff --git a/tasks/base_software.yml b/tasks/base_software.yml index 65f90c0..1720c85 100644 --- a/tasks/base_software.yml +++ b/tasks/base_software.yml @@ -19,8 +19,17 @@ - name: launch base install software pacman: state: present # not required. choices: absent;latest;present. Desired state of the package. - name: "{{system_base_softwares}}" + name: "{{system_base_softwares_arch}}" become: yes + when: ansible_facts['os_family'] == "Archlinux" + + +- name: launch base install software + apt: + state: present # not required. choices: absent;latest;present. Desired state of the package. + name: "{{system_base_softwares_debian}}" + become: yes + when: ansible_facts['os_family'] == "Debian" - name: install powerline status via pip pip: diff --git a/tasks/depot_debian.yml b/tasks/depot_debian.yml new file mode 100644 index 0000000..dc30576 --- /dev/null +++ b/tasks/depot_debian.yml @@ -0,0 +1,6 @@ +- name: add repo main contrib + apt_repository: + repo: deb http://ftp.fr.debian.org/debian/ stable main contrib non-free + state: present # not required. choices: absent;present. A source string state. + update_cache: yes # not required. Run the equivalent of C(apt-get update) when a change occurs. Cache updates are run after making changes. + become: yes \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index bbd5ba2..34bbfaa 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,11 @@ ---- - include_tasks: hostname.yml - include_tasks: locales.yml - include_tasks: time.yml - include_tasks: pacman.yml + when: ansible_facts['os_family'] == "Archlinux" +- include_tasks: depot_debian.yml + when: ansible_facts['os_family'] == "Debian" - include_tasks: AUR_builder.yml + when: ansible_facts['os_family'] == "Archlinux" + - include_tasks: base_software.yml \ No newline at end of file From dbd597e1dfde9eba2b7e63e917039aba1000bbef Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 22 Sep 2019 12:49:16 +0200 Subject: [PATCH 2/5] implement bat instalaiton for debian --- defaults/main.yml | 6 ++++-- tasks/base_software.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6f6c30b..3e4a2d5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -45,7 +45,7 @@ system_base_softwares_arch: system_base_softwares_debian: - 'zsh' - 'stow' - #- 'wol' + - 'wakeonlan' - 'nmap' #- 'bind-tools' - 'rsync' @@ -70,4 +70,6 @@ system_base_softwares_debian: - 'zip' - 'unzip' - 'unrar' - - 'git-lfs' \ No newline at end of file + - 'git-lfs' + + diff --git a/tasks/base_software.yml b/tasks/base_software.yml index 1720c85..28733ce 100644 --- a/tasks/base_software.yml +++ b/tasks/base_software.yml @@ -35,3 +35,32 @@ pip: name: powerline-status # not required. The name of a Python library to install or the url(bzr+,hg+,git+,svn+) of the remote package.,This can be a list (since 2.2) and contain version specifiers (since 2.7). extra_args: --user + + +- name: GITHUB | Get current version of bat + shell: > + warn=False + curl --silent https://github.com/sharkdp/bat/releases/latest | + grep 'tag' | + sed -E 's/.*v([0-9].[0-9][0-9].[0-9]).*/\1/' + register: command_result + failed_when: > + command_result.rc != 0 or + not command_result.stdout|regex_search('\w+\.\w+\.\w+') + when: ansible_facts['os_family'] == "Debian" + +- name: GITHUB | Set latest version of bat + set_fact: + bat_version: "{{ command_result.stdout }}" + when: ansible_facts['os_family'] == "Debian" + +- name: DEBIAN | Set URL to download bins + set_fact: + debian_url: "https://github.com/sharkdp/bat/releases/download/v{{ bat_version }}/bat_{{ bat_version }}_amd64.deb" + when: ansible_facts['os_family'] == "Debian" + +- name: DEBIAN | Install deb from github + become: true + apt: + deb: "{{debian_url}}" + when: ansible_facts['os_family'] == "Debian" \ No newline at end of file From 26f8a4203f9f6126c46596273ddadc9368d9ca98 Mon Sep 17 00:00:00 2001 From: vincent Date: Thu, 3 Oct 2019 21:22:20 +0200 Subject: [PATCH 3/5] check bat version --- tasks/base_software.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tasks/base_software.yml b/tasks/base_software.yml index 28733ce..2acae9b 100644 --- a/tasks/base_software.yml +++ b/tasks/base_software.yml @@ -43,20 +43,16 @@ curl --silent https://github.com/sharkdp/bat/releases/latest | grep 'tag' | sed -E 's/.*v([0-9].[0-9][0-9].[0-9]).*/\1/' - register: command_result + register: bat_version failed_when: > - command_result.rc != 0 or - not command_result.stdout|regex_search('\w+\.\w+\.\w+') + bat_version.rc != 0 or + not bat_version.stdout|regex_search('\w+\.\w+\.\w+') when: ansible_facts['os_family'] == "Debian" -- name: GITHUB | Set latest version of bat - set_fact: - bat_version: "{{ command_result.stdout }}" - when: ansible_facts['os_family'] == "Debian" - name: DEBIAN | Set URL to download bins set_fact: - debian_url: "https://github.com/sharkdp/bat/releases/download/v{{ bat_version }}/bat_{{ bat_version }}_amd64.deb" + debian_url: "https://github.com/sharkdp/bat/releases/download/v{{ bat_version.stdout }}/bat_{{ bat_version.stdout }}_amd64.deb" when: ansible_facts['os_family'] == "Debian" - name: DEBIAN | Install deb from github From bc701ffdd62f58cb569f5bb96154463e59603b48 Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 24 Nov 2019 14:46:38 +0100 Subject: [PATCH 4/5] finalize compatibility debian autoFS syncthing --- defaults/main.yml | 2 +- tasks/base_software.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3e4a2d5..4bbb930 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -47,7 +47,7 @@ system_base_softwares_debian: - 'stow' - 'wakeonlan' - 'nmap' - #- 'bind-tools' + - 'dnsutils' - 'rsync' #- 'awesome-terminal-fonts' - 'wget' diff --git a/tasks/base_software.yml b/tasks/base_software.yml index 2acae9b..5fa30fc 100644 --- a/tasks/base_software.yml +++ b/tasks/base_software.yml @@ -28,6 +28,7 @@ apt: state: present # not required. choices: absent;latest;present. Desired state of the package. name: "{{system_base_softwares_debian}}" + update_cache: yes become: yes when: ansible_facts['os_family'] == "Debian" From fb8586485f41ce177d9f66140561272103119403 Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 24 Nov 2019 15:11:29 +0100 Subject: [PATCH 5/5] add compat --- defaults/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7898407..eaba2f6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -42,7 +42,6 @@ system_base_softwares_arch: - 'unrar' - 'git-lfs' -<<<<<<< HEAD system_base_softwares_debian: - 'zsh' - 'stow' @@ -73,8 +72,4 @@ system_base_softwares_debian: - 'unrar' - 'git-lfs' - -======= - system_upgrade: false ->>>>>>> master