From e9fbe8fdcb33c7856a233e6100883b2efdaeac9f Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 2 Sep 2021 01:42:14 +0200 Subject: [PATCH] update ansible for workstation --- .gitmodules | 6 +-- ansible.cfg | 6 +-- ansible/hosts.ini | 4 -- .../{desk_minni.yml => desk_minni.local.yml} | 0 host_vars/{t460p.yml => t460p.local.yml} | 0 host_vars/workstation.local.yml | 27 ++++++++++++ hosts.ini | 5 +++ roles/avahi_daemon | 1 - roles/do1jlr.avahi_daemon | 1 + setup_t460p.yml | 4 +- setup_workstation.yml | 41 +++++++++++++++++++ 11 files changed, 80 insertions(+), 15 deletions(-) delete mode 100644 ansible/hosts.ini rename host_vars/{desk_minni.yml => desk_minni.local.yml} (100%) rename host_vars/{t460p.yml => t460p.local.yml} (100%) create mode 100644 host_vars/workstation.local.yml create mode 100644 hosts.ini delete mode 160000 roles/avahi_daemon create mode 160000 roles/do1jlr.avahi_daemon create mode 100644 setup_workstation.yml diff --git a/.gitmodules b/.gitmodules index 74801f2..b49ca93 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,9 +58,9 @@ [submodule "roles/bat"] path = roles/bat url = https://github.com/gantsign/ansible_role_bat.git -[submodule "roles/avahi_daemon"] - path = roles/avahi_daemon - url = git@git.ccczh.ch:ansible-roles/role-avahi_daemon.git [submodule "roles/amdgpu_firmware"] path = roles/amdgpu_firmware url = https://github.com/DO1JLR/ansible_role_amdgpu_firmware.git +[submodule "roles/do1jlr.avahi"] + path = roles/do1jlr.avahi_daemon + url = https://github.com/roles-ansible/ansible_role_avahi_daemon.git diff --git a/ansible.cfg b/ansible.cfg index 226a2b9..0578235 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,5 +1,5 @@ [defaults] -inventory = ./ansible/hosts.ini +inventory = ./hosts.ini retry_files_enabled = False nocows = True ansible_connection = 'local' @@ -9,7 +9,3 @@ become_method = sudo become_user = root become_ask_pass = False -#[ssh_connection] -#pipelining = True -#control_path = /tmp/ansible-ssh-%%h-%%p-%%r - diff --git a/ansible/hosts.ini b/ansible/hosts.ini deleted file mode 100644 index 03e17e4..0000000 --- a/ansible/hosts.ini +++ /dev/null @@ -1,4 +0,0 @@ -[thinkpad] -t460p ansible_host='localhost' ansible_connection='local' -desk_minni ansible_connection='local' -l14.local ansible_connection='local' diff --git a/host_vars/desk_minni.yml b/host_vars/desk_minni.local.yml similarity index 100% rename from host_vars/desk_minni.yml rename to host_vars/desk_minni.local.yml diff --git a/host_vars/t460p.yml b/host_vars/t460p.local.yml similarity index 100% rename from host_vars/t460p.yml rename to host_vars/t460p.local.yml diff --git a/host_vars/workstation.local.yml b/host_vars/workstation.local.yml new file mode 100644 index 0000000..8fea62e --- /dev/null +++ b/host_vars/workstation.local.yml @@ -0,0 +1,27 @@ +--- +avahi_packages: + - nss-mdns + - avahi + +# local user config: +users: + l3d: + - l3d@derpy.l3d.yt + - l3d@mobile.l3d.yt + - l3d@pinkie.l3d.yt + - l3d@business.wingcon.com + - l3d@backup-rsa.l3d.yt + - l3d@backup.l3d.yt + +admins: + - l3d + +accounts: + - l3d + +akku_user: "l3d" + +copy_to_user: "{{ akku_user }}" + +wine_user: "{{ akku_user }}" +wine_user_home: "/home/{{ akku_user }}" diff --git a/hosts.ini b/hosts.ini new file mode 100644 index 0000000..0892869 --- /dev/null +++ b/hosts.ini @@ -0,0 +1,5 @@ +[thinkpad] +t460p.local ansible_connection='local' +desk_minni.local ansible_connection='local' +l14.local ansible_connection='local' +workstation.local ansible_connection='local' diff --git a/roles/avahi_daemon b/roles/avahi_daemon deleted file mode 160000 index f522c95..0000000 --- a/roles/avahi_daemon +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f522c956f54ac95d1d02c017c24841cc1516bcfd diff --git a/roles/do1jlr.avahi_daemon b/roles/do1jlr.avahi_daemon new file mode 160000 index 0000000..2ccf720 --- /dev/null +++ b/roles/do1jlr.avahi_daemon @@ -0,0 +1 @@ +Subproject commit 2ccf720db227eab67121ff8ed512c62f34452d28 diff --git a/setup_t460p.yml b/setup_t460p.yml index 0ca05b0..1e86001 100644 --- a/setup_t460p.yml +++ b/setup_t460p.yml @@ -15,7 +15,7 @@ - {role: workstation_packages, tags: [base, packages, workstation]} - name: user and ssh(d) setup - hosts: t460.local + hosts: t460p.local roles: - {role: manage_users, tags: [users, base]} - {role: authorized_keys, tags: [auth, base]} @@ -23,7 +23,7 @@ - {role: dotfiles, tags: [dotfiles, base]} - name: fancy schnickschnack - hosts: t460.local + hosts: t460p.local roles: - {role: akku-warning, tags: akku} - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} diff --git a/setup_workstation.yml b/setup_workstation.yml new file mode 100644 index 0000000..7a9af18 --- /dev/null +++ b/setup_workstation.yml @@ -0,0 +1,41 @@ +--- +- name: check if ansible is not to old + hosts: localhost + roles: + - {role: ansible_version, tags: always, gather_facts: false} + +- name: avahi + hosts: workstation.local + roles: + - {role: do1jlr.avahi_daemon, tags: [avahi_daemon, avahi, mdns], become: true} + +- name: base packages setup + hosts: workstation.local + roles: + - {role: workstation_packages, tags: [base, packages, workstation]} + +- name: user and ssh(d) setup + hosts: workstation.local + roles: + - {role: manage_users, tags: [users, base]} + - {role: authorized_keys, tags: [auth, base]} + - {role: sshd, tags: [sshd, base]} + - {role: dotfiles, tags: [dotfiles, base]} + +- name: fancy schnickschnack + hosts: workstation.local + roles: + - {role: akku-warning, tags: akku} + - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} + - {role: networkmanager, tags: networkmanager, when: ansible_os_family == 'Archlinux'} + - {role: openvpn, tags: ovpn} + - {role: nextcloud, tags: nextcloud, when: ansible_os_family == 'Archlinux'} + - {role: bat, tags: bat, when: ansible_os_family == 'Debian'} + - {role: install-firefox, tags: firefox} + - {role: copy_files} + - {role: i3wm, tags: i3wm} + - {role: ntp, tags: ntp} + - {role: xrandr, tags: xrandr} + - {role: arch-fonts, tags: fonts} + - {role: winehq, tags: wine} + - {role: no-sleep, tags: sleep}