aboutsummaryrefslogtreecommitdiffstats
path: root/tasks/phpinfo.yml
blob: e662294627589c1eae4e2fe66c910e97faff0906 (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
39
40
41
42
43
44
45
# This playbook install a simple file for displaying details about the PHP
# installation.
#
# Copyright (c) 2013-2018 Fabian Affolter <fabian@affolter-engineering.ch>
#
# Licensed under CC BY 3.0. All rights reserved.
#
---
- name: create the needed directory
  file:
    path: /usr/share/webapps/phpinfo
    owner: root
    group: root
    mode: 0755
    state: directory

- name: create a new file with lineinfile
  lineinfile:
    dest: /usr/share/webapps/phpinfo/index.php
    regexp: '^'
    line: ''
    state: present
    create: True

- name: add a multiline string to the file and delete the string from before
  lineinfile:
    dest: /usr/share/webapps/phpinfo/index.php
    regexp: '^'
    line: '<?php\nphpinfo();\n?>'
    state: present

- name: set the permissions
  file:
    path: /var/www/lighttpd/
    mode: 0777
    state: directory

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