Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup multiple modules, restructrue and improve lint #30

Merged
merged 2 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 2 additions & 30 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ i3_run_on_startup:
# - nextcloud
- sudo nm-applet

htop__compile: true

# roles/do1jlr.base
l3d_pkgs__install_advanced: true
l3d_pkgs__install_python: true
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
2 changes: 1 addition & 1 deletion roles/amdgpu_firmware
1 change: 0 additions & 1 deletion roles/arch-fonts
Submodule arch-fonts deleted from ed8178
2 changes: 0 additions & 2 deletions roles/copy_files/defaults/main.yml

This file was deleted.

11 changes: 0 additions & 11 deletions roles/copy_files/tasks/main.yml

This file was deleted.

1 change: 0 additions & 1 deletion roles/install-firefox
Submodule install-firefox deleted from 6b7d8d
2 changes: 1 addition & 1 deletion roles/l3d.etesync_dav
3 changes: 0 additions & 3 deletions roles/networkmanager/defaults/main.yml

This file was deleted.

46 changes: 0 additions & 46 deletions roles/networkmanager/tasks/main.yml

This file was deleted.

46 changes: 0 additions & 46 deletions roles/networkmanager/tasks/versioncheck.yml

This file was deleted.

3 changes: 0 additions & 3 deletions roles/networkmanager/vars/main.yml

This file was deleted.

1 change: 0 additions & 1 deletion roles/nextcloud
Submodule nextcloud deleted from 7fdf73
4 changes: 4 additions & 0 deletions roles/openvpn/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
collections:
- name: 'community.general'
version: ">=7.5.0,<=8.0.0"
24 changes: 24 additions & 0 deletions roles/openvpn/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -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'
48 changes: 9 additions & 39 deletions roles/openvpn/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 12 additions & 0 deletions roles/openvpn/tasks/modprobe.yml
Original file line number Diff line number Diff line change
@@ -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'
29 changes: 16 additions & 13 deletions roles/openvpn/tasks/versioncheck.yml
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion roles/polybar
Submodule polybar deleted from 711bb8
1 change: 0 additions & 1 deletion roles/pulseaudio
Submodule pulseaudio deleted from 0612c0
20 changes: 0 additions & 20 deletions roles/steam/defaults/main.yml

This file was deleted.

9 changes: 0 additions & 9 deletions roles/steam/tasks/main.yml

This file was deleted.

1 change: 0 additions & 1 deletion roles/winehq
Submodule winehq deleted from 04bcf0
Loading