Support BackupPC

pull/14/head
Emilien Mantel 2015-12-23 17:37:58 +01:00
parent e0bb5e2752
commit c703a4fba8
3 changed files with 44 additions and 0 deletions

View File

@ -76,6 +76,7 @@ You can see many examples in: [tests/test.yml](tests/test.yml).
#### Templates #### Templates
- `_base`: static template - `_base`: static template
- `_backuppc`: access to [BackupPC](http://backuppc.sourceforge.net/) (be careful: you need to install [fcgiwrap](https://packages.debian.org/jessie/fcgiwrap))
- `_dokuwiki` - `_dokuwiki`
- `_redirect`: should not be called explicitly - `_redirect`: should not be called explicitly
- `_phalcon`: Phalcon PHP Framework - `_phalcon`: Phalcon PHP Framework

View File

@ -0,0 +1,33 @@
{% extends "_base.j2" %}
{% block root %}
root /usr/share/backuppc/cgi-bin;
{% endblock %}
{% block template_try_files %}
{% endblock %}
{% block template_index %}
index index.cgi;
{% endblock %}
{% block template_local_content %}
location ~ /\.ht {
deny all;
}
location /backuppc/image {
alias /usr/share/backuppc/image;
expires 60d;
}
{% endblock %}
{% block template_upstream_location %}
location ~ \.cgi$ {
gzip off;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index BackupPC_Admin;
fastcgi_param SCRIPT_FILENAME /usr/share/backuppc/cgi-bin$fastcgi_script_name;
}
{% endblock %}

View File

@ -6,6 +6,7 @@
with_items: with_items:
- php5-fpm - php5-fpm
- curl - curl
- fcgiwrap
vars: vars:
nginx_php: true nginx_php: true
nginx_upstreams: nginx_upstreams:
@ -77,9 +78,13 @@
delete: true delete: true
- name: 'redirect-to.local' - name: 'redirect-to.local'
redirect_to: 'http://test.local' redirect_to: 'http://test.local'
- name: 'backuppc.local'
template: '_backuppc'
htpasswd: 'hello'
roles: roles:
- ../../ - ../../
post_tasks: post_tasks:
- apt: pkg=backuppc state=present
- name: -- Add PHP file -- - name: -- Add PHP file --
copy: dest="{{ nginx_root }}/{{ item }}/public/index.php" content="<?php phpinfo();" copy: dest="{{ nginx_root }}/{{ item }}/public/index.php" content="<?php phpinfo();"
with_items: ['test-php.local', 'test-php-index.local'] with_items: ['test-php.local', 'test-php-index.local']
@ -128,3 +133,8 @@
changed_when: false changed_when: false
register: authgok register: authgok
failed_when: authgok.stdout.find('401 Authorization Required') != -1 failed_when: authgok.stdout.find('401 Authorization Required') != -1
- name: -- VERIFY BACKUPPC --
command: "curl -u hanx:qwerty -H 'Host: backuppc.local' http://127.0.0.1/"
changed_when: false
register: authbpc
failed_when: authbpc.stdout.find('BackupPC Server Status') == -1