laptop (#129)
doku bash alias als dotfile entfernt rg als standard dotfiles source timeshift aufgeräumt tasks wip timeshift snapd temp aus tasks Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#129 Co-Authored-By: mg <mg@noreply.git.mgrote.net> Co-Committed-By: mg <mg@noreply.git.mgrote.net>
This commit is contained in:
parent
7b331bc7d9
commit
0d17626c8f
10 changed files with 91 additions and 36 deletions
|
@ -53,8 +53,6 @@
|
|||
local_path: "/home/mg/.tmux.conf"
|
||||
- repo_path: "{{ dotfiles_repo_path}}/.gitconfig"
|
||||
local_path: "/home/mg/.gitconfig"
|
||||
- repo_path: "{{ dotfiles_repo_path}}/.bash_aliases"
|
||||
local_path: "/home/mg/.bash_aliases"
|
||||
dotfiles_dirs:
|
||||
- path: /home/mg/.config/i3
|
||||
- path: /home/mg/.config/polybar
|
||||
|
@ -193,6 +191,7 @@
|
|||
- vim
|
||||
- rsync
|
||||
- at
|
||||
- rg
|
||||
programs_only_physical:
|
||||
- hddtemp
|
||||
- ipmitool
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
roles:
|
||||
- { role: mgrote.i3, tags: "i3", become: true }
|
||||
- { role: mgrote.polybar, tags: "polybar", become: true }
|
||||
- { role: mgrote.remove_snapd, become: true, tags: "snapd" }
|
||||
- { role: mgrote.deactivate_caps, tags: "caps", become: true }
|
||||
|
|
|
@ -35,3 +35,15 @@
|
|||
owner: "{{ dotfiles_owner }}"
|
||||
group: "{{ dotfiles_owner }}"
|
||||
with_items: "{{ dotfiles_files }}"
|
||||
|
||||
- name: add .bash_alias to .bashrc
|
||||
ansible.builtin.lineinfile:
|
||||
path: /home/{{ dotfiles_owner }}/.bashrc
|
||||
line: "source {{ dotfiles_repo_path }}/.bash_aliases"
|
||||
state: present
|
||||
|
||||
- name: add .bash_functions to .bashrc
|
||||
ansible.builtin.lineinfile:
|
||||
path: /home/{{ dotfiles_owner }}/.bashrc
|
||||
line: "source {{ dotfiles_repo_path }}/.bash_functions"
|
||||
state: present
|
||||
|
|
|
@ -40,8 +40,3 @@
|
|||
name: polybar
|
||||
group: video
|
||||
|
||||
- name: change permission for /sys/class/backlight/
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /sys/class/backlight/
|
||||
mode: '0666'
|
||||
|
|
10
roles/mgrote.timeshift/README.md
Normal file
10
roles/mgrote.timeshift/README.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
## mgrote.timeshift
|
||||
|
||||
### Beschreibung
|
||||
Installiert und konfiguriert timeshift.
|
||||
|
||||
### Funktioniert auf
|
||||
- [X] Ubuntu (>=18.04)
|
||||
|
||||
### Variablen + Defaults
|
||||
see [defaults](./defaults/main.yml)
|
3
roles/mgrote.timeshift/defaults/main.yml
Normal file
3
roles/mgrote.timeshift/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
acng_server_exthreshold: "60"
|
||||
acng_server_port: 9999
|
4
roles/mgrote.timeshift/handlers/main.yml
Normal file
4
roles/mgrote.timeshift/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- name: create snapshot
|
||||
become: yes
|
||||
ansible.builtin.shell: "/usr/bin/timeshift --scripted --create"
|
23
roles/mgrote.timeshift/tasks/main.yml
Normal file
23
roles/mgrote.timeshift/tasks/main.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
- name: install packages
|
||||
become: yes
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- timeshift
|
||||
state: present
|
||||
notify: create snapshot
|
||||
|
||||
- name: copy timeshift config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: "timeshift.json"
|
||||
dest: "/etc/timeshift/timeshift.json"
|
||||
|
||||
- name: create restic cronjob
|
||||
become: yes
|
||||
ansible.builtin.cron:
|
||||
name: restic
|
||||
state: present
|
||||
job: "/usr/bin/timeshift --scripted --create"
|
||||
minute: "7"
|
||||
hour: "*/4"
|
30
roles/mgrote.timeshift/templates/timeshift.json
Normal file
30
roles/mgrote.timeshift/templates/timeshift.json
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"backup_device_uuid" : "9b924961-0fd4-423f-b440-f2f3d1fa46d8",
|
||||
"parent_device_uuid" : "",
|
||||
"do_first_run" : "false",
|
||||
"btrfs_mode" : "false",
|
||||
"include_btrfs_home_for_backup" : "false",
|
||||
"include_btrfs_home_for_restore" : "false",
|
||||
"stop_cron_emails" : "false",
|
||||
"btrfs_use_qgroup" : "false",
|
||||
"schedule_monthly" : "false",
|
||||
"schedule_weekly" : "false",
|
||||
"schedule_daily" : "false",
|
||||
"schedule_hourly" : "false",
|
||||
"schedule_boot" : "false",
|
||||
"count_monthly" : "2",
|
||||
"count_weekly" : "3",
|
||||
"count_daily" : "7",
|
||||
"count_hourly" : "6",
|
||||
"count_boot" : "5",
|
||||
"snapshot_size" : "7515627384",
|
||||
"snapshot_count" : "254372",
|
||||
"date_format" : "%Y-%m-%d %H:%M:%S",
|
||||
"exclude" : [
|
||||
"/root/**",
|
||||
"/home/polybar/**",
|
||||
"/home/ansible-user/**",
|
||||
"/home/mg/**"
|
||||
],
|
||||
"exclude-apps" : []
|
||||
}
|
|
@ -3,36 +3,14 @@
|
|||
become: yes
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- vim
|
||||
- ripgrep
|
||||
- timeshift
|
||||
- timeshift-gtk
|
||||
state: present
|
||||
|
||||
- name: check if vundle is installed - folder
|
||||
- name: templating timeshift config
|
||||
become: yes
|
||||
stat:
|
||||
path: "{{ vim_vundle_path }}"
|
||||
register: folder_exists
|
||||
ansible.builtin.template:
|
||||
src: "timeshift.json"
|
||||
dest: "/etc/timeshift/timeshift.json"
|
||||
mode: 0664
|
||||
|
||||
- name: Ensure repository is cloned locally.
|
||||
git:
|
||||
repo: "{{ vim_vundle_repo_url }}"
|
||||
dest: "{{ vim_vundle_path }}"
|
||||
depth: 1
|
||||
register: repo_cloned
|
||||
|
||||
- name: set owner recursive for repo
|
||||
file:
|
||||
path: "{{ vim_homedir }}"
|
||||
owner: mg
|
||||
group: mg
|
||||
recurse: yes
|
||||
when: repo_cloned.changed == true
|
||||
|
||||
- name: Vundle - PluginInstall
|
||||
ansible.builtin.shell: yes | vim -c PluginInstall -c qall
|
||||
args:
|
||||
chdir: /home/mg
|
||||
when:
|
||||
- (folder_exists.stat.exists == False) and ("ansible_facts['distribution'] == 'Ubuntu'")
|
||||
become: yes
|
||||
become_user: mg
|
||||
|
|
Loading…
Reference in a new issue