mirror of
https://github.com/DO1JLR/ansible_linux_desktop_setup.git
synced 2024-09-14 19:54:51 +02:00
Merge pull request #30 from DO1JLR/c
cleanup multiple modules, restructrue and improve lint
This commit is contained in:
commit
c3e20027b9
29 changed files with 82 additions and 248 deletions
32
.gitmodules
vendored
32
.gitmodules
vendored
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 1c127375958550a7eefe1056aa466bf5f6b61d88
|
||||
Subproject commit a8b5881aa7939e18eadb9c324a6653f22c2e9064
|
|
@ -1 +1 @@
|
|||
Subproject commit 311e600f078c04007aecd37e7e2233d3f5e86a90
|
||||
Subproject commit 645553cbb763ac541adef9d8373027f3b7dfaa0d
|
|
@ -1 +0,0 @@
|
|||
Subproject commit ed81782a5afa614e648b79b3fd1b1c53d1e86961
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
copy_to_user: "{{ ansible_user_id }}"
|
|
@ -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' }
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 46a2dde4efe40245f461cac542c0b3993a833850
|
||||
Subproject commit 3cb26476bb2aeb486ee44c48d149401aef15e7cf
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 6b7d8d470f81f46a067f9ed05a2b69d6d7c7784c
|
|
@ -1 +1 @@
|
|||
Subproject commit ee8044a7be41599fbf340fade4e4f4342413e456
|
||||
Subproject commit 242529420b856b5923529e50652a9b2e553e1aca
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
# version management with this role?
|
||||
submodules_versioncheck: true
|
|
@ -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
|
|
@ -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
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
playbook_version_number: 9001 # should be over ninethousand
|
||||
playbook_version_path: 'role-networkmanager_roles-ansible_github.com.version'
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 7fdf73f58b81c3b49aa8dff4578b0ca2a4da81d7
|
|
@ -1 +1 @@
|
|||
Subproject commit ef21e1c1dda6b65f120ce5df1cf4c2b375d18baa
|
||||
Subproject commit 04b2945454d98e6e917a5e1fcdb7d6d7158840e1
|
4
roles/openvpn/requirements.yml
Normal file
4
roles/openvpn/requirements.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
collections:
|
||||
- name: 'community.general'
|
||||
version: ">=7.5.0,<=8.0.0"
|
24
roles/openvpn/tasks/install.yml
Normal file
24
roles/openvpn/tasks/install.yml
Normal file
|
@ -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'
|
|
@ -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'
|
||||
|
|
12
roles/openvpn/tasks/modprobe.yml
Normal file
12
roles/openvpn/tasks/modprobe.yml
Normal file
|
@ -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'
|
|
@ -1,41 +1,44 @@
|
|||
---
|
||||
# Copyright (c) 2021 L3D <l3d@c3woc.de>
|
||||
# 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
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 711bb864d2cbc36ef4e5dd19acb1452f7660efe0
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 0612c0ee9dab907864bb5b286ff1003553367c65
|
|
@ -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
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
---
|
||||
|
||||
- name: Install steam on arch
|
||||
pacman:
|
||||
name: "{{ steam_default_packages }}"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
become: yes
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 04bcf054df11e1e999db8648e08fb38be5043fa5
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 99bcb120fe5020e257c4dddad20f04d215b1eed7
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 445e76ea5ced8b265b3ce3a9720cb65c6378136f
|
18
site.yml
18
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}
|
||||
|
|
Loading…
Reference in a new issue