personal-servers/provision-pinky/server.yml
2024-06-26 13:58:25 -03:00

44 lines
1016 B
YAML

# Setup basic server stuff
- name: Basic Server Setup
hosts: servers
become_method: ansible.builtin.sudo
tasks:
- name: Install some packages
become: true
ansible.builtin.package:
name:
- docker
- docker-compose
- btrfs-progs
state: present
- name: Start and enable service docker
become: true
ansible.builtin.service:
name: docker
state: started
enabled: true
- name: Add ralsina to docker group
become: true
ansible.builtin.user:
name: ralsina
groups: docker
append: true
- name: Configure Docker
become: true
ansible.builtin.copy:
dest: /etc/docker/daemon.json
mode: '0644'
content: |
{
"data-root": "/data/docker"
}
notify:
- Restart Docker
handlers:
- name: Restart Docker
become: true
ansible.builtin.service:
name: docker
state: restarted