From 02a6c6d5a7aff88ee77f9798d07912be16615c49 Mon Sep 17 00:00:00 2001 From: mg Date: Thu, 1 Jul 2021 15:26:45 +0200 Subject: [PATCH] laptop (#138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dotfiles stash pip weg polybar group video defaukts atom timeshift aufgeräumt defaults vivaldi defaults xnview doku xautolock vars playbooks atom aufgeräumt testvm same2 same bugfix alacritty i3: rofi abhängigkeiten Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/138 Co-Authored-By: mg Co-Committed-By: mg --- group_vars/laptop.yml | 9 +++++---- inventory_laptop | 1 + playbooks/3_service/laptop.yml | 13 +++++++------ roles/mgrote.alacritty/tasks/main.yml | 16 +++++----------- roles/mgrote.atom/README.md | 7 +++++++ roles/mgrote.atom/defaults/main.yml | 2 ++ roles/mgrote.atom/tasks/main.yml | 5 +++++ roles/mgrote.dotfiles/tasks/main.yml | 12 ++++++++++++ roles/mgrote.i3/tasks/main.yml | 6 ++++-- roles/mgrote.polybar/tasks/main.yml | 9 ++------- roles/mgrote.timeshift/defaults/main.yml | 3 --- roles/mgrote.timeshift/tasks/main.yml | 2 +- roles/mgrote.vivaldi/defaults/main.yml | 2 ++ roles/mgrote.vivaldi/tasks/main.yml | 22 +--------------------- roles/mgrote.xnview/defaults/main.yml | 2 ++ roles/mgrote.xnview/tasks/main.yml | 2 +- 16 files changed, 57 insertions(+), 56 deletions(-) create mode 100644 roles/mgrote.atom/README.md create mode 100644 roles/mgrote.atom/defaults/main.yml create mode 100644 roles/mgrote.atom/tasks/main.yml delete mode 100644 roles/mgrote.timeshift/defaults/main.yml create mode 100644 roles/mgrote.vivaldi/defaults/main.yml create mode 100644 roles/mgrote.xnview/defaults/main.yml diff --git a/group_vars/laptop.yml b/group_vars/laptop.yml index c85ba10c..47314ea8 100644 --- a/group_vars/laptop.yml +++ b/group_vars/laptop.yml @@ -15,10 +15,15 @@ local_path: "/home/mg/.bash_aliases" - repo_path: "{{ dotfiles_repo_path}}/alacritty/alacritty.yml" local_path: "/home/mg/.config/alacritty/alacritty.yml" + - repo_path: "{{ dotfiles_repo_path}}/.ssh/config" + local_path: "/home/mg/.ssh/config" + - repo_path: "/home/mg/Nextcloud/Rest/ssh-keys/heimserver/private_key" # smylink in .ssh-dir + local_path: "/home/mg/.ssh/private_key_heimserver" dotfiles_dirs: - path: /home/mg/.config/i3 - path: /home/mg/.config/polybar - path: /home/mg/.config/alacritty + - path: /home/mg/.config/.ssh dotfiles_owner: mg ### mgrote.apt_install_packages programs_extra: @@ -32,12 +37,8 @@ - gnome-tweaks - powertop - caja - - x11-xserver-utils # xrandr - arandr - keepassxc - - feh # i3 wallpaper - - yad # polybar popup-calendar - - xdotool # polybar popup-calendar ### mgrote.apt_manage_sources manage_sources_apt_proxy_url: "" ### mgrote.ntp_chrony_server diff --git a/inventory_laptop b/inventory_laptop index aeb620b1..e879d356 100644 --- a/inventory_laptop +++ b/inventory_laptop @@ -3,3 +3,4 @@ all: laptop: hosts: irantu.grote.lan: + mint.grote.lan: diff --git a/playbooks/3_service/laptop.yml b/playbooks/3_service/laptop.yml index d8a0b4ce..35be73fb 100644 --- a/playbooks/3_service/laptop.yml +++ b/playbooks/3_service/laptop.yml @@ -1,9 +1,10 @@ --- - hosts: laptop roles: - - { role: mgrote.i3, tags: "i3", become: true } - - { role: mgrote.polybar, tags: "polybar", become: true } - - { role: mgrote.deactivate_caps, tags: "caps", become: true } - - { role: mgrote.alacritty, tags: "alacritty", become: true } - - { role: mgrote.vivaldi, tags: "vivaldi", become: true } - - { role: mgrote.xnview, tags: "xnview", become: true } + - { role: mgrote.i3, tags: "i3", become: true } + - { role: mgrote.polybar, tags: "polybar", become: true } + - { role: mgrote.deactivate_caps, tags: "caps", become: true } + - { role: mgrote.alacritty, tags: "alacritty", become: true } + - { role: mgrote.vivaldi, tags: "vivaldi", become: true } + - { role: mgrote.xnview, tags: "xnview", become: true } + - { role: mgrote.atom, tags: "atom", become: true } diff --git a/roles/mgrote.alacritty/tasks/main.yml b/roles/mgrote.alacritty/tasks/main.yml index 731b1fb4..0c5fd72c 100644 --- a/roles/mgrote.alacritty/tasks/main.yml +++ b/roles/mgrote.alacritty/tasks/main.yml @@ -1,16 +1,10 @@ --- - name: add ppa - become: yes - ansible.builtin.shell: add-apt-repository ppa:mmstick76/alacritty -y - args: - creates: "/etc/apt/sources.list.d/mmstick76-alacritty-focal.list" - -# - name: add ppa -# ansible.builtin.apt_repository: -# repo: ppa:aslatter/ppa -# state: present -# filename: alacritty -# update_cache: yes + ansible.builtin.apt_repository: + repo: ppa:mmstick76/alacritty + state: present + filename: alacritty + update_cache: yes - name: install packages become: yes diff --git a/roles/mgrote.atom/README.md b/roles/mgrote.atom/README.md new file mode 100644 index 00000000..43bfc9a3 --- /dev/null +++ b/roles/mgrote.atom/README.md @@ -0,0 +1,7 @@ +## mgrote.atom +### Beschreibung +Installiert atom. + + +### Funktioniert auf +- [x] Ubuntu (>=18.04) diff --git a/roles/mgrote.atom/defaults/main.yml b/roles/mgrote.atom/defaults/main.yml new file mode 100644 index 00000000..e32faa62 --- /dev/null +++ b/roles/mgrote.atom/defaults/main.yml @@ -0,0 +1,2 @@ +--- + atom_deb_url: https://github.com/atom/atom/releases/download/v1.57.0/atom-amd64.deb diff --git a/roles/mgrote.atom/tasks/main.yml b/roles/mgrote.atom/tasks/main.yml new file mode 100644 index 00000000..a812c450 --- /dev/null +++ b/roles/mgrote.atom/tasks/main.yml @@ -0,0 +1,5 @@ +--- + - name: download and install atom + become: true + apt: + deb: "{{ atom_deb_url }}" diff --git a/roles/mgrote.dotfiles/tasks/main.yml b/roles/mgrote.dotfiles/tasks/main.yml index 81e342de..69ecd962 100644 --- a/roles/mgrote.dotfiles/tasks/main.yml +++ b/roles/mgrote.dotfiles/tasks/main.yml @@ -5,6 +5,12 @@ name: acl state: present + - name: stash changes + ansible.builtin.shell: git stash + args: + chdir: "{{ dotfiles_repo_path }}" + changed_when: false + - name: Ensure dotfiles repository is cloned locally. git: repo: "{{ dotfiles_repo_url }}" @@ -12,6 +18,12 @@ depth: 1 register: git_clone + - name: pop stashed changes + ansible.builtin.shell: git stash pop + args: + chdir: "{{ dotfiles_repo_path }}" + changed_when: false + - name: set owner recursive for repo file: path: "{{ dotfiles_repo_path }}" diff --git a/roles/mgrote.i3/tasks/main.yml b/roles/mgrote.i3/tasks/main.yml index c33dccce..a1529a50 100644 --- a/roles/mgrote.i3/tasks/main.yml +++ b/roles/mgrote.i3/tasks/main.yml @@ -5,7 +5,9 @@ name: - i3 - i3lock - - x11-xserver-utils - arandr - - feh + - x11-xserver-utils # xrandr + - feh # wallpaper + - rofi + - xautolock #bildschirmsperre nach x min state: present diff --git a/roles/mgrote.polybar/tasks/main.yml b/roles/mgrote.polybar/tasks/main.yml index 17bdca01..86beeafe 100644 --- a/roles/mgrote.polybar/tasks/main.yml +++ b/roles/mgrote.polybar/tasks/main.yml @@ -7,6 +7,8 @@ - lm-sensors - brightnessctl - inotify-tools + - yad # polybar popup-calendar + - xdotool # polybar popup-calendar state: present - name: checkout siji font @@ -42,10 +44,3 @@ become: true ansible.builtin.shell: fc-cache when: gitcheckout.changed - - - name: add user polybar to group video - # https://github.com/polybar/polybar/wiki/Module:-backlight - become: true - ansible.builtin.user: - name: polybar - group: video diff --git a/roles/mgrote.timeshift/defaults/main.yml b/roles/mgrote.timeshift/defaults/main.yml deleted file mode 100644 index 0acfe2a4..00000000 --- a/roles/mgrote.timeshift/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - acng_server_exthreshold: "60" - acng_server_port: 9999 diff --git a/roles/mgrote.timeshift/tasks/main.yml b/roles/mgrote.timeshift/tasks/main.yml index 121791c7..52bd46c6 100644 --- a/roles/mgrote.timeshift/tasks/main.yml +++ b/roles/mgrote.timeshift/tasks/main.yml @@ -13,7 +13,7 @@ src: "timeshift.json" dest: "/etc/timeshift/timeshift.json" - - name: create restic cronjob + - name: create timeshift cronjob become: yes ansible.builtin.cron: name: restic diff --git a/roles/mgrote.vivaldi/defaults/main.yml b/roles/mgrote.vivaldi/defaults/main.yml new file mode 100644 index 00000000..a44ef091 --- /dev/null +++ b/roles/mgrote.vivaldi/defaults/main.yml @@ -0,0 +1,2 @@ +--- + xnview_deb_url: https://downloads.vivaldi.com/stable/vivaldi-stable_4.0.2312.33-1_amd64.deb diff --git a/roles/mgrote.vivaldi/tasks/main.yml b/roles/mgrote.vivaldi/tasks/main.yml index fb6c36b9..0720dd4c 100644 --- a/roles/mgrote.vivaldi/tasks/main.yml +++ b/roles/mgrote.vivaldi/tasks/main.yml @@ -1,25 +1,5 @@ --- -# - name: add repo -# ansible.builtin.apt_repository: -# repo: deb https://repo.vivaldi.com/archive/deb/ stable main -# state: present -# filename: vivaldi - -# - name: add ppa -# become: yes -# ansible.builtin.shell: add-apt-repository deb https://repo.vivaldi.com/archive/deb/ stable main -y - #args: - # creates: "/etc/apt/sources.list.d/mmstick76-alacritty-focal.list" - -# - name: install packages -# become: yes -# ansible.builtin.package: -# name: -# - vivaldi-stable -# state: present - - - name: download and install vivaldi become: true apt: - deb: https://downloads.vivaldi.com/stable/vivaldi-stable_4.0.2312.33-1_amd64.deb + deb: "{{ xnview_deb_url }}" diff --git a/roles/mgrote.xnview/defaults/main.yml b/roles/mgrote.xnview/defaults/main.yml new file mode 100644 index 00000000..136aa1a7 --- /dev/null +++ b/roles/mgrote.xnview/defaults/main.yml @@ -0,0 +1,2 @@ +--- + xnview_deb_url: https://download.xnview.com/XnViewMP-linux-x64.deb diff --git a/roles/mgrote.xnview/tasks/main.yml b/roles/mgrote.xnview/tasks/main.yml index a3d6cefe..5eab3795 100644 --- a/roles/mgrote.xnview/tasks/main.yml +++ b/roles/mgrote.xnview/tasks/main.yml @@ -22,4 +22,4 @@ - name: download and install xnview become: true apt: - deb: https://download.xnview.com/XnViewMP-linux-x64.deb + deb: "{{ xnview_deb_url }}"