added docker/dotfiles/fixed stuff

This commit is contained in:
opal
2023-06-26 22:21:44 -07:00
parent 2b7dd33129
commit c490c1ae80
8 changed files with 107 additions and 16 deletions

View File

@@ -1 +0,0 @@
0 3 * * * root PATH=$PATH:/usr/bin:/usr/local/bin /usr/local/bin/borgmatic --verbosity -1 --syslog-verbosity 1 -c /home/opal/projects/backup-config/config.yaml

View File

@@ -1,21 +0,0 @@
---
- name: Pull Backup Repository
git:
repo: "{{ backup_repo }}"
dest: "{{ backup_repo_dir }}"
update: no
- name: Ensure correct file/dir ownership
file:
path: "{{ backup_repo_dir }}"
recurse: True
owner: opal
group: opal
- name: Copy Borgmatic Cronjob
copy:
src: borgmatic-cron
dest: /etc/cron.d/borgmatic
mode: u+x
owner: root
group: root

View File

@@ -1,4 +0,0 @@
---
backup_repo: git@codeberg.org:opalvaults/backup.git
backup_repo_dir: /home/opal/projects/backup-config

View File

@@ -1,10 +1,55 @@
---
- name: Enable Docker systemd unit
service:
enabled: yes
name: docker
- name: Update apt package index
apt:
update_cache: yes
- name: Start Docker systemd unit
service:
state: started
name: docker
- name: Install required system packages
apt:
name:
- ca-certificates
- curl
- gnupg
- gnupg2
state: present
- name: Create /etc/apt/keyrings directory
file:
path: /etc/apt/keyrings
state: directory
mode: '0755'
- name: Download Docker's official GPG key
get_url:
url: https://download.docker.com/linux/debian/gpg
dest: /tmp/docker.gpg
- name: Install Docker's official GPG key
shell: gpg --dearmor -o /etc/apt/keyrings/docker.gpg /tmp/docker.gpg
- name: Get the architecture
command: dpkg --print-architecture
register: dpkg_architecture
changed_when: False
- name: Set up the stable Docker repository
copy:
content: |
deb [arch={{ dpkg_architecture.stdout }} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
dest: /etc/apt/sources.list.d/docker.list
owner: root
group: root
mode: '0644'
- name: Update apt package index
apt:
update_cache: yes
- name: Install Docker CE and associated components
apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present

View File

@@ -0,0 +1,20 @@
---
- name: Clone dotfiles repository
git:
repo: "{{ dotfiles_remote }}"
dest: "{{ dotfiles_git_dir }}"
update: yes
- name: Create symlinks to dotfiles in .config
file:
src: "{{ dotfiles_git_dir }}/.config/{{ item }}"
dest: "{{ home }}/.config/{{ item }}"
state: link
loop: "{{ config_dotfiles }}"
- name: Create symlinks to dotfiles in $HOME
file:
src: "{{ dotfiles_git_dir }}/{{ item }}"
dest: "{{ home }}/.{{ item }}"
state: link
loop: "{{ home_dotfiles }}"

View File

@@ -0,0 +1,24 @@
---
home: /home/opal
dotfiles_remote: git@codeberg.org:opalvaults/opalfiles.git
dotfiles_git_dir: /home/opal/code/opalfiles
config_dotfiles:
- alacritty
- beets
- doom
- dunst
- newsboat
- sway
- qutebrowser
- swaylock
- sway
- swaynag
- user-dirs.dirs
- wallpapers
- waybar
- xmodmap
home_dotfiles:
- .bashrc
- .bash_profile

View File

@@ -1,12 +1,4 @@
---
- name: Pull Dotfiles Repository
become: yes
become_user: opal
git:
repo: "{{ dotfiles_repo }}"
dest: "{{ dotfiles_dest }}"
update: no
- name: Pull Cookbook Repository
become: yes
become_user: opal