diff --git a/.gitmodules b/.gitmodules index a93a9ad..7319ab7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,7 @@ -[submodule "roles/workstation_packages"] - path = roles/workstation_packages - url = https://github.com/chaos-bodensee/role_install_workstaton_packages.git - branch = master [submodule "roles/dotfiles"] path = roles/dotfiles url = https://github.com/roles-ansible/ansible_role_dotfiles.git branch = main -[submodule "roles/pulseaudio"] - path = roles/pulseaudio - url = https://github.com/chaos-bodensee/role_pulseaudio_archlinux.git - branch = master [submodule "roles/authorized_keys"] path = roles/do1jlr.auth url = https://github.com/roles-ansible/ansible_role_auth.git @@ -22,34 +14,14 @@ path = roles/do1jlr.sshd url = https://github.com/roles-ansible/ansible_role_sshd.git branch = main -[submodule "roles/nextcloud"] - path = roles/nextcloud - url = https://github.com/DO1JLR/role_nextcloud_client.git - branch = master -[submodule "roles/arch-fonts"] - path = roles/arch-fonts - url = https://github.com/chaos-bodensee/role-arch-fonts.git - branch = master [submodule "roles/akku-warning"] path = roles/akku-warning url = https://github.com/roles-ansible/role_akku_warning.git branch = main -[submodule "roles/install-firefox"] - path = roles/install-firefox - url = https://github.com/roles-ansible/ansible_role_install_firefox.git - branch = main -[submodule "roles/xrandr"] - path = roles/xrandr - url = https://github.com/roles-ansible/ansible_role_xrandr_help.git - branch = main -[submodule "roles/winehq"] - path = roles/winehq - url = https://github.com/ekultails/ansible_role_wine.git - branch = master [submodule "roles/no-sleep"] path = roles/no-sleep - url = https://github.com/chaos-bodensee/role_disable_sleep.git - branch = master + url = https://github.com/roles-ansible/ansible_role_disable_sleep.git + branch = main [submodule "roles/manage_users"] path = roles/do1jlr.users url = https://github.com/roles-ansible/ansible_role_users.git diff --git a/group_vars/all.yml b/group_vars/all.yml index 87c4fc0..dce855e 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -68,8 +68,6 @@ i3_run_on_startup: # - nextcloud - sudo nm-applet -htop__compile: true - # roles/do1jlr.base l3d_pkgs__install_advanced: true l3d_pkgs__install_python: true @@ -77,5 +75,8 @@ l3d_pkgs__install_cli: true l3d_pkgs__install_extra_packages: - keychain +# roles/do1jlr.htop +htop__compile: true + # globaly enably simple versionscheck - if available submodules_versioncheck: true diff --git a/roles/akku-warning b/roles/akku-warning index 1c12737..a8b5881 160000 --- a/roles/akku-warning +++ b/roles/akku-warning @@ -1 +1 @@ -Subproject commit 1c127375958550a7eefe1056aa466bf5f6b61d88 +Subproject commit a8b5881aa7939e18eadb9c324a6653f22c2e9064 diff --git a/roles/amdgpu_firmware b/roles/amdgpu_firmware index 311e600..645553c 160000 --- a/roles/amdgpu_firmware +++ b/roles/amdgpu_firmware @@ -1 +1 @@ -Subproject commit 311e600f078c04007aecd37e7e2233d3f5e86a90 +Subproject commit 645553cbb763ac541adef9d8373027f3b7dfaa0d diff --git a/roles/arch-fonts b/roles/arch-fonts deleted file mode 160000 index ed81782..0000000 --- a/roles/arch-fonts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ed81782a5afa614e648b79b3fd1b1c53d1e86961 diff --git a/roles/copy_files/defaults/main.yml b/roles/copy_files/defaults/main.yml deleted file mode 100644 index 732b813..0000000 --- a/roles/copy_files/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -copy_to_user: "{{ ansible_user_id }}" diff --git a/roles/copy_files/tasks/main.yml b/roles/copy_files/tasks/main.yml deleted file mode 100644 index 44c1d7c..0000000 --- a/roles/copy_files/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -- name: copy files - copy: - src: "{{ item.src }}" - dest: "{{ item.dest }}" - with_items: - - { src: 'files/background.png', dest: "/home/{{ copy_to_user }}/.config/background.png" } - - { src: 'files/lockscreen.png', dest: '/home/{{ copy_to_user }}/.config/lockscreen.png' } - - { src: 'files/xinitrc', dest: '/home/{{ copy_to_user }}/.xinitrc' } - diff --git a/roles/do1jlr.htop b/roles/do1jlr.htop index 46a2dde..3cb2647 160000 --- a/roles/do1jlr.htop +++ b/roles/do1jlr.htop @@ -1 +1 @@ -Subproject commit 46a2dde4efe40245f461cac542c0b3993a833850 +Subproject commit 3cb26476bb2aeb486ee44c48d149401aef15e7cf diff --git a/roles/install-firefox b/roles/install-firefox deleted file mode 160000 index 6b7d8d4..0000000 --- a/roles/install-firefox +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6b7d8d470f81f46a067f9ed05a2b69d6d7c7784c diff --git a/roles/l3d.etesync_dav b/roles/l3d.etesync_dav index ee8044a..2425294 160000 --- a/roles/l3d.etesync_dav +++ b/roles/l3d.etesync_dav @@ -1 +1 @@ -Subproject commit ee8044a7be41599fbf340fade4e4f4342413e456 +Subproject commit 242529420b856b5923529e50652a9b2e553e1aca diff --git a/roles/networkmanager/defaults/main.yml b/roles/networkmanager/defaults/main.yml deleted file mode 100644 index bb6c5db..0000000 --- a/roles/networkmanager/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# version management with this role? -submodules_versioncheck: true diff --git a/roles/networkmanager/tasks/main.yml b/roles/networkmanager/tasks/main.yml deleted file mode 100644 index fec5330..0000000 --- a/roles/networkmanager/tasks/main.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- include_tasks: versioncheck.yml - when: submodules_versioncheck|bool - -- name: install needed packages on arch - become: yes - community.general.pacman: - name: - - wireless_tools - - iw - - crda - - networkmanager - - dnsutils - - mtr - state: latest - when: ansible_distribution == 'Archlinux' - -- name: install Networkmanager - become: yes - ansible.builtin.dnf: - name: NetworkManager - state: present - when: ansible_distribution == 'Fedora' - -- name: install NetworkManager - become: yes - ansible.builtin.apt: - name: networkmanager - state: present - when: ansible_os_family == 'Debian' - -- name: install needed packages for NetworkManager - become: yes - ansible.builtin.package: - name: - - dialog - - wpa_supplicant - - network-manager-applet - - nm-connection-editor - state: present - -- name: enable networkmanager - become: yes - ansible.builtin.systemd: - name: NetworkManager.service - enabled: yes diff --git a/roles/networkmanager/tasks/versioncheck.yml b/roles/networkmanager/tasks/versioncheck.yml deleted file mode 100644 index 7977e52..0000000 --- a/roles/networkmanager/tasks/versioncheck.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- name: Create directory for versionscheck - become: true - file: - path: '/etc/.ansible-version' - state: directory - mode: 0755 - when: submodules_versioncheck|bool - -- name: check playbook version - become: true - slurp: - src: "/etc/.ansible-version/{{ playbook_version_path }}" - register: playbook_version - when: submodules_versioncheck|bool - ignore_errors: yes - failed_when: false - -- name: Print remote role version - debug: - msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" - when: submodules_versioncheck|bool - -- name: Print locale role version - debug: - msg: "Local role version: '{{ playbook_version_number|string }}'." - when: submodules_versioncheck|bool - -- name: Check if your version is outdated - fail: - msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!" - when: - - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool - -- name: check if '/etc/ansible-version/' is empty - find: - paths: '/etc/ansible-version/' - register: filesFound - -- name: write new version to remote disk - become: true - copy: - content: "{{ playbook_version_number }}" - dest: "/etc/.ansible-version/{{ playbook_version_path }}" - mode: 0644 - when: submodules_versioncheck|bool diff --git a/roles/networkmanager/vars/main.yml b/roles/networkmanager/vars/main.yml deleted file mode 100644 index d8c2a33..0000000 --- a/roles/networkmanager/vars/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -playbook_version_number: 9001 # should be over ninethousand -playbook_version_path: 'role-networkmanager_roles-ansible_github.com.version' diff --git a/roles/nextcloud b/roles/nextcloud deleted file mode 160000 index 7fdf73f..0000000 --- a/roles/nextcloud +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7fdf73f58b81c3b49aa8dff4578b0ca2a4da81d7 diff --git a/roles/no-sleep b/roles/no-sleep index ef21e1c..04b2945 160000 --- a/roles/no-sleep +++ b/roles/no-sleep @@ -1 +1 @@ -Subproject commit ef21e1c1dda6b65f120ce5df1cf4c2b375d18baa +Subproject commit 04b2945454d98e6e917a5e1fcdb7d6d7158840e1 diff --git a/roles/openvpn/requirements.yml b/roles/openvpn/requirements.yml new file mode 100644 index 0000000..a5a1e10 --- /dev/null +++ b/roles/openvpn/requirements.yml @@ -0,0 +1,4 @@ +--- +collections: + - name: 'community.general' + version: ">=7.5.0,<=8.0.0" diff --git a/roles/openvpn/tasks/install.yml b/roles/openvpn/tasks/install.yml new file mode 100644 index 0000000..9d0f853 --- /dev/null +++ b/roles/openvpn/tasks/install.yml @@ -0,0 +1,24 @@ +--- +- name: Run the equivalent of "pacman -Sy" as a separate step # noqa: H1901 + become: true + community.general.pacman: + update_cache: true + when: ansible_os_family == 'Archlinux' + +- name: Update Debian apt cache + become: true + ansible.builtin.apt: + cache_valid_time: 3600 + update_cache: true + when: + - ansible_pkg_mgr == "apt" + +- name: Install OpenVPN all + become: true + ansible.builtin.package: + name: "{{ item }}" + state: 'present' + loop: + - 'openvpn' + - 'bridge-utils' + - 'easy-rsa' diff --git a/roles/openvpn/tasks/main.yml b/roles/openvpn/tasks/main.yml index 061b523..a76d07e 100644 --- a/roles/openvpn/tasks/main.yml +++ b/roles/openvpn/tasks/main.yml @@ -1,42 +1,12 @@ --- -- name: perform versionscheck - ansible.builtin.include_tasks: versioncheck.yml +- name: Perform versionscheck + ansible.builtin.include_tasks: + file: 'versioncheck.yml' -- name: Run the equivalent of "pacman -Syu" as a separate step - become: true - ansible.builtin.pacman: - update_cache: true - upgrade: true - when: ansible_os_family == 'Archlinux' +- name: Install openvpn packages + ansible.builtin.include_tasks: + file: 'install.yml' -- name: Install OpenVPN for ArchLinux - become: true - ansible.builtin.pacman: - name: - - openvpn - - bridge-utils - - easy-rsa - state: present - when: ansible_os_family == 'Archlinux' - -- name: Install OpenVPN all - become: true - ansible.builtin.package: - name: - - openvpn - - bridge-utils - - easy-rsa - state: present - when: ansible_os_family != 'Archlinux' - -- name: Add the tun module - become: true - community.general.modprobe: - name: tun - state: present - -- name: Add the bridge module - become: true - community.general.modprobe: - name: bridge - state: present +- name: Make sure openvpn modules are present + ansible.builtin.include_tasks: + file: 'modprobe.yml' diff --git a/roles/openvpn/tasks/modprobe.yml b/roles/openvpn/tasks/modprobe.yml new file mode 100644 index 0000000..f059cc6 --- /dev/null +++ b/roles/openvpn/tasks/modprobe.yml @@ -0,0 +1,12 @@ +--- +- name: Add the tun module # noqa: H1901 + become: true + community.general.modprobe: + name: 'tun' + state: 'present' + +- name: Add the bridge module # noqa: H1901 + become: true + community.general.modprobe: + name: 'bridge' + state: 'present' diff --git a/roles/openvpn/tasks/versioncheck.yml b/roles/openvpn/tasks/versioncheck.yml index 0806f2c..7dd80c5 100644 --- a/roles/openvpn/tasks/versioncheck.yml +++ b/roles/openvpn/tasks/versioncheck.yml @@ -1,41 +1,44 @@ --- +# Copyright (c) 2021 L3D +# this file is released with the MIT license. +# License: https://github.com/roles-ansible/ansible_role_template/blob/main/LICENSE - name: Create directory for versionscheck become: true ansible.builtin.file: path: '/etc/.ansible-version' state: directory - mode: 0755 + mode: '0755' + when: submodules_versioncheck | bool -- name: check playbook version +- name: Check playbook version become: true ansible.builtin.slurp: src: "/etc/.ansible-version/{{ playbook_version_path }}" register: playbook_version - ignore_errors: true + when: submodules_versioncheck | bool failed_when: false -- name: Print remote role version +- name: Print remote role version # noqa: H500 ansible.builtin.debug: msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" + when: submodules_versioncheck | bool -- name: Print locale role version +- name: Print locale role version # noqa: H500 ansible.builtin.debug: - msg: "Local role version: '{{ playbook_version_number|string }}'." + msg: "Local role version: '{{ playbook_version_number | string }}'." + when: submodules_versioncheck | bool - name: Check if your version is outdated ansible.builtin.fail: msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!" when: - - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool + - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck | bool -- name: check if '/etc/ansible-version/' is empty - ansible.builtin.find: - paths: '/etc/ansible-version/' - register: filesFound - -- name: write new version to remote disk +- name: Write new version to remote disk become: true ansible.builtin.copy: content: "{{ playbook_version_number }}" dest: "/etc/.ansible-version/{{ playbook_version_path }}" mode: '0644' + when: submodules_versioncheck | bool + tags: skip_ansible_lint_template-instead-of-copy diff --git a/roles/polybar b/roles/polybar deleted file mode 160000 index 711bb86..0000000 --- a/roles/polybar +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 711bb864d2cbc36ef4e5dd19acb1452f7660efe0 diff --git a/roles/pulseaudio b/roles/pulseaudio deleted file mode 160000 index 0612c0e..0000000 --- a/roles/pulseaudio +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0612c0ee9dab907864bb5b286ff1003553367c65 diff --git a/roles/steam/defaults/main.yml b/roles/steam/defaults/main.yml deleted file mode 100644 index ae24f4b..0000000 --- a/roles/steam/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ - -steam_default_packages: - - steam - - steam-native-runtime - - lib32-keyutils - - lib32-harfbuzz - - lib32-freetype2 - - lib32-krb5 - - vkd3d - - lib32-vkd3d - - lib32-vulkan-validation-layers - - lib32-vulkan-intel - - libretro-shaders-slang - - vulkan-validation-layers - - vulkan-trace - - vulkan-tools - - vulkan-intel - - vulkan-headers - - vulkan-extra-layers - diff --git a/roles/steam/tasks/main.yml b/roles/steam/tasks/main.yml deleted file mode 100644 index 4b869b0..0000000 --- a/roles/steam/tasks/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- - -- name: Install steam on arch - pacman: - name: "{{ steam_default_packages }}" - state: latest - update_cache: yes - become: yes - diff --git a/roles/winehq b/roles/winehq deleted file mode 160000 index 04bcf05..0000000 --- a/roles/winehq +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 04bcf054df11e1e999db8648e08fb38be5043fa5 diff --git a/roles/workstation_packages b/roles/workstation_packages deleted file mode 160000 index 99bcb12..0000000 --- a/roles/workstation_packages +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 99bcb120fe5020e257c4dddad20f04d215b1eed7 diff --git a/roles/xrandr b/roles/xrandr deleted file mode 160000 index 445e76e..0000000 --- a/roles/xrandr +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 445e76ea5ced8b265b3ce3a9720cb65c6378136f diff --git a/site.yml b/site.yml index a895352..ce283c8 100644 --- a/site.yml +++ b/site.yml @@ -8,15 +8,15 @@ hosts: all roles: - {role: l3d.packages, tags: [packages, apt]} - # - {role: workstation_packages, tags: [default, workstation_packages, packages, setup]} - {role: l3d.ntp, tags: ntp} - {role: l3d.avahi.client, tags: avahi} - {role: l3d.avahi.daemon, tags: avahi} - {role: l3d.etesync_dav, tags: [etebase, etesync, dav]} - {role: gantsign.bat, tags: bat} - # - {role: arch-fonts, tags: [font, fonts, arch-fonts]} - {role: l3d.gopass, tags: gopass} - {role: do1jlr.i3wm, tags: i3wm} + - {role: amdgpu_firmware, tags: firmware} + - {role: do1jlr.htop, tags: htop} # - name: user specific setup # hosts: private @@ -26,13 +26,9 @@ # - {role: authorized_keys, tags: [ssh, auth, authorized_keys]} # - {role: sshd, tags: [ssh, sshd]} # - {role: akku-warning, tags: [akku, akku_warning, akku-warning]} -# - {role: pulseaudio, tags: pulseaudio} -# - {role: networkmanager, tags: [nm, networkmanager]} -# - {role: copy_files} -# - {role: do1jlr.i3wm, tags: i3wm} -# - {role: xrandr, tags: xrandr} -# - {role: install-firefox, tags: firefox} -# - {role: nextcloud, tags: nextcloud} -# - {role: openvpn, tags: openvpn} -# - {role: winehq, tags: [wine, winehq]} # - {role: no-sleep, tags: no_sleep} + +- name: Setup business specific stuff + hosts: work + roles: + - {role: openvpn, tags: openvpn}