From cc66d9fda93fa0be93a877dad18e61a6840102fb Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 29 May 2022 18:39:41 +0200 Subject: [PATCH] adapt for rocky --- tasks/base_software.yml | 14 +++++++++++-- tasks/depot_redhat.yml | 6 ++++++ tasks/main.yml | 12 ++++++++++- vars/Archlinux.yml | 44 +++++++++++++++++++++++++++++++++++++++++ vars/Debian.yml | 38 +++++++++++++++++++++++++++++++++++ vars/RedHat.yml | 44 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 155 insertions(+), 3 deletions(-) create mode 100644 tasks/depot_redhat.yml create mode 100644 vars/Archlinux.yml create mode 100644 vars/Debian.yml create mode 100644 vars/RedHat.yml diff --git a/tasks/base_software.yml b/tasks/base_software.yml index f536b88..f27051b 100644 --- a/tasks/base_software.yml +++ b/tasks/base_software.yml @@ -26,7 +26,7 @@ - name: launch arch base install software pacman: state: present - name: "{{ system_base_softwares_arch }}" + name: "{{ system_base_softwares }}" become: true when: ansible_facts['os_family'] == "Archlinux" @@ -41,11 +41,20 @@ - name: launch debian base install software apt: state: present - name: "{{ system_base_softwares_debian }}" + name: "{{ system_base_softwares }}" update_cache: true become: true when: ansible_facts['os_family'] == "Debian" +- name: launch redhat base install software + dnf: + state: present + name: "{{ system_base_softwares }}" + update_cache: true + become: true + when: ansible_facts['os_family'] == "RedHat" + + - name: GITHUB | Get current version of bat shell: > set -o pipefail @@ -75,4 +84,5 @@ name: "{{ user.name }}" shell: /bin/zsh state: present + when: ansible_facts['os_family'] != "RedHat" become: true diff --git a/tasks/depot_redhat.yml b/tasks/depot_redhat.yml new file mode 100644 index 0000000..077a90e --- /dev/null +++ b/tasks/depot_redhat.yml @@ -0,0 +1,6 @@ +- name: add repo main contrib + dnf: + name: epel-release + state: latest + update_cache: true + become: true diff --git a/tasks/main.yml b/tasks/main.yml index a331171..6ca1b2c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,9 +1,17 @@ +- name: gather os specific variables + include_vars: "{{ item }}" + with_first_found: + - "{{ ansible_os_family }}-{{ ansible_distribution_major_version}}.yml" + - "{{ ansible_os_family }}.yml" + tags: vars + - include_tasks: hostname.yml - include_tasks: hosts.yml - include_tasks: tasks.sysctl.yml - include_tasks: dhcpcd.yml -- include_tasks: hostname.yml + when: ansible_os_family == "Archlinux" - include_tasks: locales.yml + when: ansible_os_family == "Archlinux" - include_tasks: time.yml - include_tasks: usergroup.yml - include_tasks: ssh.yml @@ -11,6 +19,8 @@ when: ansible_facts['os_family'] == "Archlinux" - include_tasks: depot_debian.yml when: ansible_facts['os_family'] == "Debian" +- include_tasks: depot_redhat.yml + when: ansible_os_family == "RedHat" - include_tasks: AUR_builder.yml when: ansible_facts['os_family'] == "Archlinux" - include_tasks: base_software.yml diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml new file mode 100644 index 0000000..5877656 --- /dev/null +++ b/vars/Archlinux.yml @@ -0,0 +1,44 @@ +system_base_softwares: + - "zsh" + - "stow" + - "wol" + - "nmap" + - "bind" + - "rsync" + - "awesome-terminal-fonts" + - "wget" + - "bat" + - "diff-so-fancy" + - "git" + - "htop" + - "thefuck" + - "tldr" + - "ntfs-3g" + - "python-lxml" + - "tmux" + - "vim" + - "python-pip" + - "pacman-contrib" + - "yarn" + - "npm" + - "nethogs" + - "iftop" + - "zip" + - "unzip" + - "unrar" + - "git-lfs" + - "httpie" + - "lsof" + - "glances" + - "ethtool" + - "gnu-netcat" + - "netctl" + - "logrotate" + - "otf-cascadia-code" + - "neovim" + - "python-pynvim" + - "yamllint" + - "prettier" + - "fd" + - "fzf" + - "kitty-terminfo" diff --git a/vars/Debian.yml b/vars/Debian.yml new file mode 100644 index 0000000..2c17b19 --- /dev/null +++ b/vars/Debian.yml @@ -0,0 +1,38 @@ +system_base_softwares: + - "zsh" + - "lsof" + - "glances" + - "stow" + - "wakeonlan" + - "nmap" + - "dnsutils" + - "rsync" + # - 'awesome-terminal-fonts' + - "wget" + # - 'bat' + # - 'diff-so-fancy' + - "git" + - "htop" + - "thefuck" + - "tldr" + - "ntfs-3g" + - "python-lxml" + - "tmux" + - "neovim" + - "python3-neovim" + - "python3-pip" + - "yarn" + - "npm" + - "nethogs" + - "iftop" + - "zip" + - "unzip" + - "unrar" + - "git-lfs" + - "httpie" + - "ethtool" + - "traceroute" + - "fonts-cascadia-code" + - "fd-find" + - "fzf" + - "xterm-kitty" diff --git a/vars/RedHat.yml b/vars/RedHat.yml new file mode 100644 index 0000000..570b5f9 --- /dev/null +++ b/vars/RedHat.yml @@ -0,0 +1,44 @@ +system_base_softwares: + - "zsh" + - "stow" + - "wol" + - "nmap" + - "bind" + - "rsync" + #- "awesome-terminal-fonts" + - "wget" + # - "bat" + #- "diff-so-fancy" + - "git" + - "htop" + #- "thefuck" + - "tldr" + - "ntfs-3g" + - "python3-lxml" + - "tmux" + - "vim" + - "python3-pip" + #- "pacman-contrib" + #- "yarn" + - "npm" + - "nethogs" + - "iftop" + - "zip" + - "unzip" + - "unrar" + - "git-lfs" + - "httpie" + - "lsof" + - "glances" + - "ethtool" + - "netcat" + #- "netctl" + - "logrotate" + #- "otf-cascadia-code" + - "neovim" + - "python3-neovim" + - "yamllint" + #- "prettier" + #- "fd" + #- "fzf" + - "kitty-terminfo"