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,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

View File

@@ -1,6 +1,7 @@
---
- name: Workstation setup
hosts: workstation
gather_facts: true
roles:
- role: base
tags: base_tag
@@ -8,6 +9,15 @@
- role: packages
tags: packages_tag
- role: docker
tags: docker_tag
- role: dotfiles
tags: dotfiles_tag
become: yes
become_user: opal
become_method: su
- role: git
tags: git_tag
become: yes