homelab-ansible/playbooks/initial_server_setup.yml
2025-03-20 19:59:48 -04:00

21 lines
607 B
YAML

---
- name: Set up a new virtual machine
hosts: all
become: true
tasks:
- name: Install Docker
ansible.builtin.include_tasks:
file: '../tasks/provisioning/install_docker.yml'
- name: Pull and run the portainer agent
community.docker.docker_container:
name: portainer_agent
image: portainer/agent:2.27.0
state: started
restart_policy: always
published_ports:
- "9001:9001"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
- /:/host