system/tasks/base_software.yml

91 lines
2.4 KiB
YAML
Raw Normal View History

2020-01-07 19:50:03 +00:00
- name: upgrade arch-keyring
pacman:
2022-02-13 08:40:15 +00:00
state: latest # noqa package-latest
name: archlinux-keyring
2022-02-13 08:40:15 +00:00
force: true
update_cache: false
2022-02-13 08:40:15 +00:00
become: true
2020-01-13 19:04:49 +00:00
when: system_upgrade and ansible_facts['os_family'] == "Archlinux"
2019-10-24 19:16:17 +00:00
- name: upgrade system
pacman:
2022-02-13 08:40:15 +00:00
state: latest # noqa package-latest
upgrade: true
force: true
update_cache: false
2022-02-13 08:40:15 +00:00
become: true
2020-01-13 19:04:49 +00:00
when: system_upgrade and ansible_facts['os_family'] == "Archlinux"
2019-10-24 19:16:17 +00:00
register: upgrade
- name: Reboot updates to apply
reboot:
reboot_timeout: 3600
2020-01-13 19:04:49 +00:00
when: upgrade.changed and "linux" in upgrade.packages and system_upgrade and ansible_facts['os_family'] == "Archlinux"
2022-02-13 08:40:15 +00:00
become: true
2020-01-07 19:44:20 +00:00
2020-01-07 19:50:03 +00:00
- name: launch arch base install software
2020-01-07 19:44:20 +00:00
pacman:
2022-02-13 08:40:15 +00:00
state: present
2022-05-29 16:39:41 +00:00
name: "{{ system_base_softwares }}"
2022-02-13 08:40:15 +00:00
become: true
2019-09-18 21:14:11 +00:00
when: ansible_facts['os_family'] == "Archlinux"
- name: install aur workstation soft
2021-04-20 18:22:49 +00:00
aur:
name: "{{ system_base_aur_soft }}"
state: present
2022-02-13 08:40:15 +00:00
become: true
2021-04-20 18:22:49 +00:00
become_user: aur_builder
2022-02-12 09:41:14 +00:00
when: ansible_facts['os_family'] == "Archlinux" and system_base_aur_soft
2019-09-18 21:14:11 +00:00
2020-01-07 19:50:03 +00:00
- name: launch debian base install software
2019-09-18 21:14:11 +00:00
apt:
2022-02-13 08:40:15 +00:00
state: present
2022-05-29 16:39:41 +00:00
name: "{{ system_base_softwares }}"
2022-02-13 08:40:15 +00:00
update_cache: true
become: true
2019-09-18 21:14:11 +00:00
when: ansible_facts['os_family'] == "Debian"
2020-01-07 19:44:20 +00:00
2022-05-29 16:39:41 +00:00
- name: launch redhat base install software
dnf:
state: present
name: "{{ system_base_softwares }}"
update_cache: true
become: true
when: ansible_facts['os_family'] == "RedHat"
2019-09-22 10:49:16 +00:00
- name: GITHUB | Get current version of bat
shell: >
warn=False
2022-10-23 13:44:19 +00:00
set -o pipefail
2022-10-09 19:59:30 +00:00
curl -L --silent https://api.github.com/repos/sharkdp/bat/releases/latest |
grep '"tag_name":' |
sed -E 's/.*"([^"]+)".*/\1/'|sed 's/v//'
2019-10-03 19:22:20 +00:00
register: bat_version
2022-10-09 19:59:30 +00:00
changed_when: false
2019-09-22 10:49:16 +00:00
failed_when: >
2019-10-03 19:22:20 +00:00
bat_version.rc != 0 or
not bat_version.stdout|regex_search('\w+\.\w+\.\w+')
2019-09-22 10:49:16 +00:00
when: ansible_facts['os_family'] == "Debian"
- name: DEBIAN | Set URL to download bins
set_fact:
2019-10-03 19:22:20 +00:00
debian_url: "https://github.com/sharkdp/bat/releases/download/v{{ bat_version.stdout }}/bat_{{ bat_version.stdout }}_amd64.deb"
2019-09-22 10:49:16 +00:00
when: ansible_facts['os_family'] == "Debian"
- name: DEBIAN | Install deb from github
become: true
apt:
2022-02-13 08:40:15 +00:00
deb: "{{ debian_url }}"
2019-11-24 13:49:14 +00:00
when: ansible_facts['os_family'] == "Debian"
2019-10-24 19:16:17 +00:00
2022-05-31 12:12:32 +00:00
#- name: pass user shell to zsh
# user:
# name: "{{ user.name }}"
# shell: /bin/zsh
# state: present
# when: ansible_facts['os_family'] != "RedHat"
# become: true