Docker Install

---
- name: InstallDVWA
  hosts: webservers
  become: true
  tasks:

  - name: Uninstall apache httpd
    apt:
       name: apache2
       state: absent

  - name: docker.io
    apt:
       update_cache: yes
       name: docker.io
       state: present

  - name: Install pip3
    apt:
       name: python3-pip
       state: present

  - name: Install docker
    pip:
       name: docker
       state: present

  - name: Install DVWA docker container
    docker_container:
       name: dvwa
       image: cyberxsecurity/dvwa
       published_ports: 80:80
       restart_policy: unless-stopped
       state: started


  - name: Start Docker
    systemd:
       enabled: yes
       name: docker

Revision #1
Created 2025-11-25 18:23:11 UTC by David Rizzo
Updated 2025-11-25 18:23:20 UTC by David Rizzo