aboutsummaryrefslogtreecommitdiffstats
path: root/tasks/security/dvwa.yml
blob: 7dfcceea2dbd5d84657816bbd789cc92a9b12a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# This playbook install the Damn Vulnerable Web Application (DVWA) 
# (http://www.dvwa.co.uk/).
#
# Copyright (c) 2013 Fabian Affolter <fabian@affolter-engineering.ch>
#
# Licensed under CC BY 3.0. All rights reserved.
#
---
- name: downloads the archive
  get_url: url=http://dvwa.googlecode.com/files/DVWA-$dvwa_version.zip
           dest=/usr/share/webapps/dvwa-$dvwa_version.zip
           mode=0440

- name: unpack the archive
  command: /usr/bin/unzip -o /usr/share/webapps/dvwa-$dvwa_version.zip -d /usr/share/webapps/

- name: delete the archive
  command: /bin/rm /usr/share/webapps/dvwa-$dvwa_version.zip

- name: set the permissions
  file: path=/usr/share/webapps/
        mode=0777
        state=directory

- name: install a default configuration file
  template: src=files/dvwa.j2
            dest=/usr/share/webapps/dvwa/config/config.inc.php
            owner=root
            group=root
            mode=0755
            backup=yes

- name: create a symlink to the webserver root
  file: src=/usr/share/webapps/dvwa/
        dest=/var/www/localhost/htdocs/dvwa
        owner=root
        group=root
        state=link