laptop eingebaut (#105)
inv vm-test2 bugfix reboot invfentory vim polybar gruppe polybar i3 vim extra programme eigenes playbook inventar Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#105 Co-Authored-By: mg <mg@noreply.git.mgrote.net> Co-Committed-By: mg <mg@noreply.git.mgrote.net>
This commit is contained in:
parent
c0e0f8cfc7
commit
0df8312cfc
11 changed files with 136 additions and 9 deletions
|
@ -17,3 +17,12 @@
|
|||
- path: /home/mg/.config/i3
|
||||
- path: /home/mg/.config/polybar
|
||||
dotfiles_owner: mg
|
||||
### mgrote.apt_install_packages
|
||||
programs_extra:
|
||||
- ifupdown2
|
||||
- bmon
|
||||
- hddtemp
|
||||
- s-tui
|
||||
- smartmontools
|
||||
- lm-sensors
|
||||
- ethtool
|
||||
|
|
|
@ -4,6 +4,9 @@ all:
|
|||
hosts:
|
||||
dokuwiki2.grote.lan:
|
||||
dokuwiki-test.grote.lan:
|
||||
laptop:
|
||||
hosts:
|
||||
irantu.grote.lan:
|
||||
fileserver:
|
||||
hosts:
|
||||
fileserver2.grote.lan:
|
||||
|
@ -77,7 +80,7 @@ all:
|
|||
acng-test.grote.lan:
|
||||
ansible-test.grote.lan:
|
||||
docker-test.grote.lan:
|
||||
vm-test.grote.lan:
|
||||
vm-test2.grote.lan:
|
||||
pve2-test.grote.lan:
|
||||
pve3-test.grote.lan:
|
||||
pve4-test.grote.lan:
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
- import_playbook: 90_tmux.yml
|
||||
- import_playbook: 91_motd.yml
|
||||
- import_playbook: 92_dotfiles.yml
|
||||
- import_playbook: 83_vim.yml
|
||||
- import_playbook: 93_postfix.yml
|
||||
- import_playbook: 94_ufw.yml
|
||||
- import_playbook: 95_ssh_pass_login.yml
|
||||
|
|
|
@ -11,6 +11,13 @@
|
|||
become: true
|
||||
reboot:
|
||||
reboot_timeout: 120
|
||||
- name: Change user password
|
||||
become: true
|
||||
user:
|
||||
name: mg
|
||||
update_password: always
|
||||
password: "{{ lookup('keepass', 'mg_linux_password_hash', 'password') }}"
|
||||
|
||||
vars:
|
||||
### reobertdebock.bootstrap
|
||||
bootstrap_user: mg
|
||||
|
@ -22,12 +29,6 @@
|
|||
ansible_become_password: hallowelt
|
||||
ansible_ssh_common_args: "'-o StrictHostKeyChecking=no'"
|
||||
|
||||
tasks:
|
||||
- name: Change user password
|
||||
become: true
|
||||
user:
|
||||
name: mg
|
||||
update_password: always
|
||||
password: "{{ lookup('keepass', 'mg_linux_password_hash', 'password') }}"
|
||||
|
||||
|
||||
# Nach dem ersten durchlaufen ist keine Anmeldung mehr per Passwort & ssh möglich. Damit scheitert auch der Versuch das Playbook ein zweites mal durchlaufen zu lassen.
|
||||
|
|
4
playbooks/base/83_vim.yml
Normal file
4
playbooks/base/83_vim.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- hosts: all
|
||||
roles:
|
||||
- { role: mgrote.vim, tags: "vim", become: true }
|
16
playbooks/laptop/0_master.yml
Normal file
16
playbooks/laptop/0_master.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
- hosts: laptop
|
||||
gather_facts: false
|
||||
- import_playbook: ../base/85_install_packages.yml
|
||||
- import_playbook: ../base/88_restic.yml
|
||||
- import_playbook: ../base/89_users.yml
|
||||
- import_playbook: ../base/90_tmux.yml
|
||||
- import_playbook: ../base/91_motd.yml
|
||||
- import_playbook: ../base/92_dotfiles.yml
|
||||
- import_playbook: ../base/93_postfix.yml
|
||||
- import_playbook: ../base/94_ufw.yml
|
||||
- import_playbook: ../base/95_ssh_pass_login.yml
|
||||
- import_playbook: ../base/96_f2b.yml
|
||||
- import_playbook: ../base/83_vim.yml
|
||||
- import_playbook: i3.yml
|
||||
- import_playbook: polybar.yml
|
4
playbooks/laptop/i3.yml
Normal file
4
playbooks/laptop/i3.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- hosts: laptop
|
||||
roles:
|
||||
- { role: mgrote.i3, tags: "i3" }
|
4
playbooks/laptop/polybar.yml
Normal file
4
playbooks/laptop/polybar.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- hosts: laptop
|
||||
roles:
|
||||
- { role: mgrote.polybar, tags: "polybar" }
|
10
roles/mgrote.i3/tasks/main.yml
Normal file
10
roles/mgrote.i3/tasks/main.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: install packages
|
||||
become: yes
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- i3
|
||||
- i3lock
|
||||
- xrandr
|
||||
- arandr
|
||||
state: present
|
41
roles/mgrote.polybar/tasks/main.yml
Normal file
41
roles/mgrote.polybar/tasks/main.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
- name: install packages
|
||||
become: yes
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- polybar
|
||||
state: present
|
||||
|
||||
- name: checkout siji font
|
||||
ansible.builtin.git:
|
||||
repo: https://github.com/stark/siji
|
||||
dest: /home/mg/siji
|
||||
register: gitcheckout
|
||||
|
||||
- name: install siji-font
|
||||
ansible.builtin.shell: /home/mg/siji/install.sh -d /home/mg/.fonts
|
||||
args:
|
||||
creates: /home/mg/.fonts
|
||||
when: gitcheckout.changed
|
||||
|
||||
- name: remove bitmap-file
|
||||
ansible.builtin.file:
|
||||
path: /etc/fonts/conf.d/70-no-bitmaps.conf
|
||||
state: absent
|
||||
when: gitcheckout.changed
|
||||
register: rmbitmap
|
||||
|
||||
- name: update fc-cache
|
||||
ansible.builtin.shell: fc-cache
|
||||
when: gitcheckout.rmbitmap
|
||||
|
||||
- name: add user polybar to group video
|
||||
# https://github.com/polybar/polybar/wiki/Module:-backlight
|
||||
ansible.builtin.user:
|
||||
name: polybar
|
||||
group: video
|
||||
|
||||
- name: change permission for /sys/class/backlight/
|
||||
ansible.builtin.file:
|
||||
path: /sys/class/backlight/
|
||||
mode: '0666'
|
34
roles/mgrote.vim/tasks/main.yml
Normal file
34
roles/mgrote.vim/tasks/main.yml
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
- name: install packages
|
||||
become: yes
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- vim
|
||||
- ripgrep
|
||||
state: present
|
||||
|
||||
- name: check if vundle is installed - folder
|
||||
become: yes
|
||||
stat:
|
||||
path: "/home/mg/.vim/bundle/Vundle.vim"
|
||||
register: folder_exists
|
||||
|
||||
- name: Ensure repository is cloned locally.
|
||||
git:
|
||||
repo: https://github.com/VundleVim/Vundle.vim.git
|
||||
dest: /home/mg/.vim/bundle/Vundle.vim
|
||||
depth: 1
|
||||
|
||||
- name: set owner recursive for repo
|
||||
file:
|
||||
path: /home/mg/.vim
|
||||
owner: mg
|
||||
group: mg
|
||||
recurse: yes
|
||||
|
||||
- name: Vundle - PluginInstall
|
||||
ansible.builtin.shell: yes | vim -c PluginInstall -c qall
|
||||
args:
|
||||
chdir: /home/mg
|
||||
become_user: mg
|
||||
# when: (folder_exists.stat.exists == False)
|
Loading…
Reference in a new issue