system/tasks/base_software.yml
2022-02-13 09:42:01 +01:00

79 lines
2.1 KiB
YAML

- name: upgrade arch-keyring
pacman:
state: latest # noqa package-latest
name: archlinux-keyring
force: true
update_cache: false
become: true
when: system_upgrade and ansible_facts['os_family'] == "Archlinux"
- name: upgrade system
pacman:
state: latest # noqa package-latest
upgrade: true
force: true
update_cache: false
become: true
when: system_upgrade and ansible_facts['os_family'] == "Archlinux"
register: upgrade
- name: Reboot updates to apply
reboot:
reboot_timeout: 3600
when: upgrade.changed and "linux" in upgrade.packages and system_upgrade and ansible_facts['os_family'] == "Archlinux"
become: true
- name: launch arch base install software
pacman:
state: present
name: "{{ system_base_softwares_arch }}"
become: true
when: ansible_facts['os_family'] == "Archlinux"
- name: install aur workstation soft
aur:
name: "{{ system_base_aur_soft }}"
state: present
become: true
become_user: aur_builder
when: ansible_facts['os_family'] == "Archlinux" and system_base_aur_soft
- name: launch debian base install software
apt:
state: present
name: "{{ system_base_softwares_debian }}"
update_cache: true
become: true
when: ansible_facts['os_family'] == "Debian"
- name: GITHUB | Get current version of bat
shell: >
set -o pipefail
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: bat_version
failed_when: >
bat_version.rc != 0 or
not bat_version.stdout|regex_search('\w+\.\w+\.\w+')
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.stdout }}/bat_{{ bat_version.stdout }}_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"
- name: pass user shell to zsh
user:
name: "{{ user.name }}"
shell: /bin/zsh
state: present
become: true