From e2151d4cdd1191b348afd9b03f0aae167fddc440 Mon Sep 17 00:00:00 2001 From: Samuel ORTION Date: Sat, 25 Mar 2023 21:52:21 +0100 Subject: [PATCH] Add .dotfiles automated configuration --- README.md | 19 ++++++ ansible.cfg | 7 +++ hosts | 1 + myfedora.yml | 7 +++ myvars.yml | 0 roles/bootstrap/tasks/main.yml | 85 ++++++++++++++++++++++++++ roles/config/tasks/main.yml | 25 ++++++++ roles/softwares/tasks/main.yml | 106 +++++++++++++++++++++++++++++++++ 8 files changed, 250 insertions(+) create mode 100644 README.md create mode 100644 ansible.cfg create mode 100644 hosts create mode 100644 myfedora.yml create mode 100644 myvars.yml create mode 100644 roles/bootstrap/tasks/main.yml create mode 100644 roles/config/tasks/main.yml create mode 100644 roles/softwares/tasks/main.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..efaff92 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# My Fedora Ansible Post Install + +## Quick Setup + +1. Install `ansible` + +```{bash} +sudo dnf install ansible +``` + +2. Run the playbooks + +```{bash} +ansible-playbook +``` + +## References + +Some playbooks forked from CC By Jacques-Philippe JUBENOT. \ No newline at end of file diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..a376fca --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,7 @@ +[defaults] +inventory = ./hosts +retry_files_enabled = False +command_warnings=False +deprecation_warnings=False +host_key_checking = False +private_key_file = ~/.ssh/id_ecdsa \ No newline at end of file diff --git a/hosts b/hosts new file mode 100644 index 0000000..05614f6 --- /dev/null +++ b/hosts @@ -0,0 +1 @@ +localhost ansible_connection=local \ No newline at end of file diff --git a/myfedora.yml b/myfedora.yml new file mode 100644 index 0000000..91ad156 --- /dev/null +++ b/myfedora.yml @@ -0,0 +1,7 @@ +--- +- hosts: localhost + remote_user: root + roles: + - bootstrap + - softwares + - config diff --git a/myvars.yml b/myvars.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/bootstrap/tasks/main.yml b/roles/bootstrap/tasks/main.yml new file mode 100644 index 0000000..ec2e827 --- /dev/null +++ b/roles/bootstrap/tasks/main.yml @@ -0,0 +1,85 @@ +--- +# +# Copyright (c) 2017 Jacques-Philippe JUBENOT +# Licensed under CC BY 3.0. All rights reserved. +# + +# Role Default + +# Add Repository RPM Fusion FREE +- name: Verify if RPM Fusion FREE Repository exist + stat: path=/etc/yum.repos.d/rpmfusion-free.repo + register: fusionfrepo + tags: + - repofusion + - basicinst + +- name: Add Repository RPM Fusion FREE + ansible.builtin.dnf: + name: https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ ansible_distribution_major_version }}.noarch.rpm + disable_gpg_check: true + state: present + when: fusionfrepo.stat.exists == False + tags: + - repofusion + - basicinst + +# Add Repository RPM Fusion Non-FREE +- name: Verify if RPM Fusion Non-FREE Repository exist + stat: path=/etc/yum.repos.d/rpmfusion-nonfree.repo + register: fusionnfrepo + tags: + - repofusion + - basicinst + +- name: Add Repository RPM Fusion Non-FREE + ansible.builtin.dnf: + name: https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-{{ ansible_distribution_major_version }}.noarch.rpm + disable_gpg_check: true + state: present + when: fusionnfrepo.stat.exists == False + tags: + - repofusion + - basicinst + +# Add Repository Oracle VirtualBox +- name: Verify if Oracle VirtualBox Repository exist + stat: path=/etc/yum.repos.d/virtualbox.repo + register: repooracle + tags: + - repooracle + +# Add Repository VScode +- name: Verify if VScode Repository exist + stat: path=/etc/yum.repos.d/vscode.repo + register: vscoderepo + tags: + - repovscode + - basicinst + +- name: VScode enable Repository + ansible.builtin.yum_repository: + name: vscode + description: VSCode + baseurl: https://packages.microsoft.com/yumrepos/vscode + gpgkey: https://packages.microsoft.com/keys/microsoft.asc + enabled: yes + gpgcheck: yes + when: vscoderepo.stat.exists == False + tags: + - repovscode + - basicinst + +# Fast Mirror Option for DNF +- name: Fast Mirror Option for DNF + lineinfile: dest=/etc/dnf/dnf.conf line="fastestmirror=true" + tags: + - fastdnf + - basicinst + +# Parallel Download for DNF +- name: Parallel Download for DNF + lineinfile: dest=/etc/dnf/dnf.conf line="max_parallel_downloads=10" + tags: + - fastdnf + - basicinst \ No newline at end of file diff --git a/roles/config/tasks/main.yml b/roles/config/tasks/main.yml new file mode 100644 index 0000000..9eccc8e --- /dev/null +++ b/roles/config/tasks/main.yml @@ -0,0 +1,25 @@ +--- + +- name: Set up zsh as default shell + user: + name: sortion + shell: /bin/zsh + +- name: Git Status Check + stat: + path: /usr/bin/git + register: git + +- name: Dotfiles Clone Repository + # Check if git is installed + + when: git.stat.exists + # Clone dotfiles + git: + repo: ssh://gitea@forge.chapril.org:222/UncleSamulus/.dotfiles.git + dest: /home/sortion/.dotfiles + +- name: Dotfiles Install + make: + chdir: /home/sortion/.dotfiles + target: install \ No newline at end of file diff --git a/roles/softwares/tasks/main.yml b/roles/softwares/tasks/main.yml new file mode 100644 index 0000000..6bf6c56 --- /dev/null +++ b/roles/softwares/tasks/main.yml @@ -0,0 +1,106 @@ +--- +# +# Copyright (c) 2017 Jacques-Philippe JUBENOT +# Licensed under CC BY 3.0. All rights reserved. +# + +# Role Softwares + +# Clean DNF +- name: Clean DNF before Install list + command: dnf clean all + tags: + - minimum + +# Install Default Softwares +- name: Install Different Packages + ansible.builtin.dnf: + name: + - audacity + - autoconf + - automake + - calibre # Ebook and numuric book software + - clamd # ClamAV Anti-Virus daemon + - clamav # ClamAV Anti-Virus + - clamav-update # ClamAV Anti-Virus definition updater + - code # Visual Studio Code + - dconf-editor # Gnome Shell DConf-Editor + - dmidecode + - dnf-plugin-system-upgrade + - easytag # Audio tagging tool and adding image in MP3 audio file + - etckeeper # Etc versionning software + - etckeeper-dnf # Etc versionning software DNF tool + - filezilla # Ftp software + - gcc # Compiliation software + - gimp + - git + - gitg + - glances # CLI System MOnitoring + - glib2 + - glib2-devel + - glibc-devel + - gnome-battery-bench + - gnome-extensions-app + - gnome-nettool # Gnome Network graphical tool + - gnome-tweak-tool # Tweak Gnome shell + - gnome-sudoku # Sudoku game + - gparted # Disks and partitions manager + - gstreamer-ffmpeg # Video Codec tool + - gstreamer1-libav # Video Codec tool + - gstreamer-plugins-ugly # Video Codec tool + - gstreamer1-plugins-ugly # Video Codec tool + - gtk-murrine-engine # GTK2 engine + - gtk2-devel + - hdparm + - help2man + - htop # Monitoring tool like "top" + - iftop # Network tool - View bandwidth + - inxi # Hardware components informations + - iperf3 # Network tool - Bandwidth test + - kernel-devel + - kernel-headers + - lame # MP3 Encoder tool + - libreoffice-langpack-fr # Libreoffice language pack French + - libsass # Library for sassc CSS pre-processor language + - libselinux-python3 + - libX11-devel + - lsb-core-noarch + - lynis # Security Tool - Very interesting + - lzop # Compression Tool + - mediawriter + - mkvtoolnix # MKV Codec Tools + - nano # Text editor + - nautilus-dropbox # Dropbox in Nautilus -- Legacy package + - neofetch + - nethogs # Network tool + - obs-studio # Software for video recording and live streaming + - p7zip # Compression Tool + - perl + - perl-LWP-Protocol-https + - python-dnf + - python3-dnf-plugin-snapper # Snapper Features + - rpi-imager # Raspberry card/disk imager + - sassc # CSS pre-processor language + - snapper # Snapper Features + - stacer # Monitoring and Tweaking graphic tool + - tar # Archiving tool + - tcptrack # Network tool + - tmux # Terminal Multiplexer + - vim # Text editor + - vlc # VideoLAN player + - wget + - wine + - x264-devel # Codec Dev Library + - x265-devel # Codec Dev Library + - xine-lib-extras-freeworld # Codec files Xine Library + - thunderbird + - darktable + - rawtherapee + - inkscape + - pandoc + - emacs + - texlive-scheme-full + - zsh + state: present + tags: + - instsoft \ No newline at end of file