Added playbook for setting up Docker + other usefull services on the NCAFSA VM template.

This commit is contained in:
Vlad R
2023-07-12 14:50:56 +00:00
parent a83635f4bf
commit da543234a1
4 changed files with 95 additions and 26 deletions
@@ -0,0 +1,47 @@
---
- name: Install aptitude
ansible.builtin.apt:
name: aptitude
state: latest
update_cache: true
- name: Install required packages
ansible.builtin.apt:
pkg:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- python3-pip
- virtualenv
- python3-setuptools
state: latest
update_cache: true
- name: Add Docker GPG apt Key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
ansible.builtin.apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable
state: present
- name: Update apt and install docker-ce
ansible.builtin.apt:
name: docker-ce
state: latest
update_cache: true
- name: Run default container to test Docker install
community.docker.docker_container:
name: test_container
image: hello-world
state: present
- name: Add users to Docker group (allows running Docker commands without sudo)
ansible.builtin.user:
name: "{{ item.key }}"
groups: "sudo, docker"
loop: "{{ lookup('dict', users) }}"