diff --git a/tasks/essentials-Archlinux.yml b/tasks/essentials-Archlinux.yml new file mode 100644 index 0000000..2081abe --- /dev/null +++ b/tasks/essentials-Archlinux.yml @@ -0,0 +1,16 @@ +--- +# Common/Essentials: Essential Utilities (git, curl; vim, tmux, zsh) - ArchLinux Version + +- name: essentials - Install essential utilities + become: yes + package: + name: "{{ packages }}" + state: present + vars: + packages: + - git + - curl + - wget + - zsh + - vim + - tmux diff --git a/tasks/essentials-Centos.yml b/tasks/essentials-Centos.yml new file mode 100644 index 0000000..fc65595 --- /dev/null +++ b/tasks/essentials-Centos.yml @@ -0,0 +1,15 @@ +--- +# Common/Essentials: Essential Utilities (git, curl; vim, tmux, zsh) - CentOS Version + +- name: essentials - Install essential utilities + become: yes + yum: + name: "{{ packages }}" + state: present + vars: + packages: + - git + - curl + - zsh + - vim + - tmux diff --git a/tasks/tools-Archlinux.yml b/tasks/tools-Archlinux.yml new file mode 100644 index 0000000..13f80ae --- /dev/null +++ b/tasks/tools-Archlinux.yml @@ -0,0 +1,15 @@ +--- +# Common/Tools: Additional Tools (depending on OS) - ArchLinux Version +# (bind-tools includes dig) + +- name: tools - Install basic utilities + become: yes + package: + name: "{{ packages }}" + state: present + vars: + packages: + - rsync + - bind-tools + - htop + - unzip diff --git a/tasks/tools-Centos.yml b/tasks/tools-Centos.yml new file mode 100644 index 0000000..83096d9 --- /dev/null +++ b/tasks/tools-Centos.yml @@ -0,0 +1,15 @@ +--- +# Common/Tools: Additional Tools (depending on OS) - CentOS Version +# (bind-utils includes dig) + +- name: tools - Install basic utilities + become: yes + yum: + name: "{{ packages }}" + state: present + vars: + packages: + - rsync + - bind-utils + - htop + - unzip diff --git a/tasks/update-Centos.yml b/tasks/update-Centos.yml new file mode 100644 index 0000000..af5a1ca --- /dev/null +++ b/tasks/update-Centos.yml @@ -0,0 +1,9 @@ +--- +# Common/Update: Install All Updates - CentOS Version + +- name: update - Update and upgrade all packages + become: yes + yum: + name: "*" + state: latest + update_cache: yes diff --git a/tasks/update.yml b/tasks/update.yml index 6d6e77e..cbfecdc 100644 --- a/tasks/update.yml +++ b/tasks/update.yml @@ -6,3 +6,4 @@ with_first_found: - "update-{{ ansible_distribution }}.yml" - "update-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml" + ignore_errors: true diff --git a/tasks/usersetup-Archlinux.yml b/tasks/usersetup-Archlinux.yml new file mode 100644 index 0000000..d71ca98 --- /dev/null +++ b/tasks/usersetup-Archlinux.yml @@ -0,0 +1,45 @@ +--- +# Common/Usersetup: Auto-setup a user shell and prepare dotfiles - ArchLinux Version +# Will run once per user, because of lockfile `~/.ansbl-common-usersetup` + +- name: usersetup - Check, if usersetup already ran + stat: + path: .ansbl-common-usersetup + register: common_usersetup + +- name: usersetup - Change login shell to zsh for current user + become: yes + user: + name: "{{ ansible_user_id }}" + shell: /bin/zsh + when: + - common_usersetup.stat.exists == false and usersetup_chsh == true + +# TODO: adapt to ArchLinux systems, if needed +# - name: usersetup - Install locales package +# become: yes +# apt: +# name: locales +# state: present + +# - name: usersetup - Setup locale en_US +# become: yes +# locale_gen: +# name: en_US.UTF-8 +# state: present +# when: +# - common_usersetup.stat.exists == false +# - name: usersetup - Setup locale de_DE +# become: yes +# locale_gen: +# name: de_DE.UTF-8 +# state: present +# when: +# - common_usersetup.stat.exists == false + +- name: usersetup - Create lockfile + file: + path: .ansbl-common-usersetup + state: touch + when: + - common_usersetup.stat.exists == false diff --git a/tasks/usersetup-Centos.yml b/tasks/usersetup-Centos.yml new file mode 100644 index 0000000..2ee1ada --- /dev/null +++ b/tasks/usersetup-Centos.yml @@ -0,0 +1,45 @@ +--- +# Common/Usersetup: Auto-setup a user shell and prepare dotfiles - CentOS Version +# Will run once per user, because of lockfile `~/.ansbl-common-usersetup` + +- name: usersetup - Check, if usersetup already ran + stat: + path: .ansbl-common-usersetup + register: common_usersetup + +- name: usersetup - Change login shell to zsh for current user + become: yes + user: + name: "{{ ansible_user_id }}" + shell: /bin/zsh + when: + - common_usersetup.stat.exists == false and usersetup_chsh == true + +# TODO: adapt to CentOS/ RHEL systems, if needed +# - name: usersetup - Install locales package +# become: yes +# apt: +# name: locales +# state: present + +# - name: usersetup - Setup locale en_US +# become: yes +# locale_gen: +# name: en_US.UTF-8 +# state: present +# when: +# - common_usersetup.stat.exists == false +# - name: usersetup - Setup locale de_DE +# become: yes +# locale_gen: +# name: de_DE.UTF-8 +# state: present +# when: +# - common_usersetup.stat.exists == false + +- name: usersetup - Create lockfile + file: + path: .ansbl-common-usersetup + state: touch + when: + - common_usersetup.stat.exists == false diff --git a/tasks/usertools-Archlinux.yml b/tasks/usertools-Archlinux.yml index 582775c..14715fc 100644 --- a/tasks/usertools-Archlinux.yml +++ b/tasks/usertools-Archlinux.yml @@ -2,6 +2,7 @@ # Common/Usertools: User's Main Machine/ Developer Tools - ArchLinux Version - name: usertools - Install user's working utilities + become: yes package: name: "{{ packages }}" state: present diff --git a/tasks/usertools-Centos.yml b/tasks/usertools-Centos.yml new file mode 100644 index 0000000..8c05fe5 --- /dev/null +++ b/tasks/usertools-Centos.yml @@ -0,0 +1,15 @@ +--- +# Common/Usertools: User's Main Machine/ Developer Tools - CentOS Version + +- name: usertools - Install user's working utilities + become: yes + yum: + name: "{{ packages }}" + state: present + vars: + packages: + - nmap + - rsync + - icdiff + - iftop + - ansible