diff --git a/README.md b/README.md index db1cd99..6559915 100644 --- a/README.md +++ b/README.md @@ -13,149 +13,137 @@ Apache configuration file (which is included as template in the role). Requirements ------------ -A webserver having PHP installed, e.g. by using PeterMosmans.apache2 +A webserver having PHP installed. For Apache, we suggest using [PeterMosmans.apache2](https://github.com/PeterMosmans/ansible-role-apache2). If you prefer Nginx, please use [Nginxinc.nginx](https://github.com/nginxinc/ansible-role-nginx). Role Variables -------------- -Available variables are listed below, along with default values. The default -values are specified in `default/main.yml`. -**dokuwiki_configure_apache2**: When true, will deploy an Apache configuration -(`dokuwiki.conf.j2`) to Apache, and enable the site. By default, the variable is -undefined (false). - - -**dokuwiki_name**: The 'internal' name of the dokuwiki, which is e.g. used for -Apache logfiles and the cleanup cronjob. (when `dokuwiki_configure_apache2` is -true). This allows the Ansible role to be used for multiple Dokuwiki sites on -the same server. Default: -``` -dokuwiki_name: dokuwiki -``` - - -**dokuwiki_source**: The URL where the (latest) version of Dokuwiki can be -found. By default, it uses the official Dokuwiki source. -``` -dokuwiki_source: https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz -``` - - -**dokuwiki_base**: The local path where Dokuwiki will be installed. -``` -dokuwiki_base: /var/www/html -``` - - -**dokuwiki_group**: The group owning the Dokuwiki files. -``` -dokuwiki_group: www-data -``` - - -**dokuwiki_plugins**: A list of name / source pairs, with plugins to -automatically install. The sources need to point to tar or .tgz sources (e.g.). -Example: -``` - - name: pagelist - src: https://github.com/dokufreaks/plugin-pagelist/tarball/master -``` - - -**dokuwiki_plugins_remove**: A list of plugins to automatically remove upon -installation or upgrade. -Default: -``` +### /vars + +Dependencies and package related variables are defined in `vars/*`. This includes all dependencies for dokuwiki and recommended plugins, as well as the location of all dokuwiki branches. You can select which branch to install with `dokuwiki_version` + +| Variable | Comments | +| :--- | :--- | +| `dokuwiki_stable_url` | `dokuwiki_stable_url: https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz` | +| `dokuwiki_old_stable_url` | `dokuwiki_old_stable_url: https://download.dokuwiki.org/src/dokuwiki/dokuwiki-oldstable.tgz` | +| `dokuwiki_development_url` | `dokuwiki_development_url: http://github.com/splitbrain/dokuwiki/tarball/master` | + +### /defaults + +All other available variables are listed below, along with default values. The default values are specified in `default/main.yml`. + +| Variable | Comments | +| :--- | :--- | +| `dokuwiki_server_name` | Dokuwiki ServerName Directive. `dokuwiki_server_name: "localhost"` | +| `dokuwiki_base` | Dokuwiki base directory. `dokuwiki_base: /var/www/dokuwiki` | +| `dokuwiki_savedir` | Dokuwiki data directory. `dokuwiki_savedir: /var/www/dokuwiki/data` | +| `dokuwiki_version` | Version to install. `dokuwiki_version: stable` | +| `dokuwiki_webserver` | When defined, will deploy an Nginx or Apache configuration (`apache.dokuwiki.conf.j2` or `nginx.dokuwiki.conf.j2`), and enable the site. `dokuwiki_webserver: nginx`. | +| `dokuwiki_name` | The 'internal' name of the dokuwiki, which is e.g. used for Nginx or Apache logfiles and the cleanup cronjob. (when `dokuwiki_webserver` is defined). This allows the Ansible role to be used for multiple Dokuwiki sites on the same server. Default: `dokuwiki_name: dokuwiki` | +| `dokuwiki_base` | The local path where Dokuwiki will be installed. `dokuwiki_base: /var/www/html` | +| `dokuwiki_user` | The user owning the Dokuwiki files. `dokuwiki_user: root` | +| `dokuwiki_group` | The group owning the Dokuwiki files. `dokuwiki_group: www-data` | +| `dokuwiki_plugins` (1) | List of name / source pairs, with plugins to automatically install via dokuwiki's gittool. | +| `dokuwiki_plugins_remove` (2) | A list of plugins to automatically remove upon installation or upgrade. | +| `dokuwiki_templates` (3) | A list of templates to automatically install. | +| `dokuwiki_provision` (4) | When true, apply configuration templates to provision Dokuwiki. `dokuwiki_provision: true` | +| `dokuwiki_savedir` | The directory where all files (content) will be stored. See [Dokuwiki Security - Move Directories out of DocRoot](https://www.dokuwiki.org/security#move_directories_out_of_docroot) for more info. `dokuwiki_savedir: /var/www/html/data` | + + + +(1) `dokuwiki_plugins`: The current, opinionated list of default plugins is: +```Yaml +dokuwiki_plugins: + - pagelist + - fastwiki + - edittable + - dw2pdf + - bookcreator + - tag + - discussion + - dropfiles + - color + - nspages + - sortablejs +``` + +(2) `dokuwiki_plugins_remove`: The default list of plugins to remove is: +```Yaml dokuwiki_plugins_remove: - - name: authad - - name: authldap - - name: authmysql - - name: authpdo - - name: authpgsql - - name: info - - name: popularity + - authad + - authldap + - authmysql + - authpdo + - authpgsql + - info + - popularity ``` +(3) `dokuwiki_templates`: A list of templates to install +```Yaml +dokuwiki_templates: + - bootstrap3 +``` -**dokuwiki_provision**: When true, apply configuration templates to provision -Dokuwiki. If not specified or false, Dokuwiki will be unprovisioned, a default +(4) `dokuwiki_provision`: If not specified or false, Dokuwiki will be unprovisioned, a default installation. See below in the provisioning chapter which variables can be used in the configuration templates. Note that when this variable is true, it will (re-)template and overwrite the current Dokuwiki configuration. -The following configuration files are templated: -- `/conf/acl.auth.php` -- `/conf/local.php` -- `/conf/plugins.local.php` -- `/conf/users.auth.php` - -Example: -``` -dokuwiki_provision: true -``` - -**dokuwiki_savedir**: The directory where all files (content) will be stored. -``` -dokuwiki_savedir: /var/www/html/data -``` - -**dokuwiki_templates**: A list of name / source pairs, with templates to -automatically install. The sources need to point to tar or .tgz sources (e.g.). -Example: -``` -dokuwiki_templates: - - name: bootstrap3 - src: https://github.com/LotarProject/dokuwiki-template-bootstrap3/tarball/master -``` +Configuration templates +-------------- +The following configuration files, located at `conf/*`, are templated: -**dokuwiki_user**: The user owning the Dokuwiki files. -``` -dokuwiki_user: root -``` +| Template | Comments | +| :--- | :--- | +| `acl.auth.php.j2` | Dokuwiki ACL Config file | +| `cleanup.sh.j2` | Cron job to cleanup DokuWiki installations | +| `local.protected.php.j2` | Dokuwiki's Main Configuration File - Local Settings, protected | +| `php-fpm.www.conf.j2` | PHP FPM config file - altered to make this role php version agnostic | +| `plugins.local.php.j2` | Local plugin enable/disable settings - recommended to be used with `dokuwiki_plugins_removed` | +| `users.auth.php.j2` | If dokuwiki_users is defined, this file is provisioned with those local users | +| `apache.dokuwiki.conf.j2` | Apache config for dokuwiki | +| `nginx.dokuwiki.conf.j2` | Nginx config for dokuwiki | ## Provisioning -The following variables will be used in the configuration templates -(`local.php.j2`, `users.auth.php.j2`), and therefore will only be applied if +The following variables will be used in the configuration templates, and therefore will only be applied if `dokuwiki_provision` is set to `true`. +| Template | Comments | +| :--- | :--- | +| `dokuwiki_title` | The Dokuwiki title. `dokuwiki_title: "Default Dokuwiki site"` | +| `dokuwiki_opt_lang` | Dokuwiki's language option. `dokuwiki_opt_lang: "en"` | +| `dokuwiki_opt_policy` | Dokuwiki's policy. 0 - Open Wiki (read, write, upload for everyone); 1 - Public Wiki (read for everyone, write and upload for registered users); 2 - Closed Wiki (read, write, upload for registered users only). `dokuwiki_opt_policy: "0"` | +| `dokuwiki_opt_acl` | Dokuwiki ACL enable. `dokuwiki_opt_acl: "1"` | +| `dokuwiki_acl_all` | The ACL bits for the default (@ALL) group. By default, only logged on users are allowed access (0). | +| `dokuwiki_acl_user` | The ACL bits for the user (@user) group. By default, users have upload, create, edit, and read permissions (8). | +| `dokuwiki_disableactions` | Which actions to disable. By default, user auto registering is disabled. | +| `dokuwiki_local` (1) | A list of name / value configuration pairs to be added to the `local.protected.php` configuration file. | +| `dokuwiki_users ` (2) | A list of users | +| `dokuwiki_opt_license` (3) | The content license to use. `dokuwiki_opt_license: "0"` | -**dokuwiki_acl_all**: The ACL bits for the default (@ALL) group. By default, -only logged on users are allowed access (0). - - -**dokuwiki_acl_user**: The ACL bits for the user (@user) group. By default, -users have upload, create, edit, and read permissions (8). - - -**dokuwiki_disableactions**: Which actions to disable. By default, registering -is disabled. - - -**dokuwiki_title**: The Dokuwiki title -**dokuwiki_local**: A list of name / value configuration pairs to be added to -the `local.php` configuration file. -Example: -``` +(1) `dokuwiki_local`: You can add additional parameters to the `local.protected.php` configuration file, as seen here: +```Yaml dokuwiki_local: - name: "['passcrypt']" value: 'bcrypt' ``` -This will result in adding the following string to `/conf/local.php`: -``` -$conf['mytemplate'] = 'myvalue'; -``` - -**dokuwiki_users**: A list of users, containing the following name / value pairs: +This will result in adding the following string to `/conf/local.protected.php`: +```Yaml +$conf['passcrypt'] = 'bcrypt'; ``` + +(2) `dokuwiki_users`: A list of users, containing the following name / value pairs: +```Yaml - login: login - hash: password hash - name: full name @@ -164,7 +152,7 @@ $conf['mytemplate'] = 'myvalue'; ``` Example: -``` +```Yaml dokuwiki_users: - login: admin hash: "$2y$05$Nr3wFqH54gcdhxPK9easseLSVwLAnLTD2flYmQbAbCVIiiTU4mCjS" @@ -172,9 +160,21 @@ dokuwiki_users: email: admin@admin groups: admin,user ``` - This will result in adding the user admin to Dokuwiki, with the bcrypted password `admin`. + +(3) `dokuwiki_opt_license`: The options for this are: +- cc-zero - [CC0 1.0 Universal](http://creativecommons.org/publicdomain/zero/1.0/) +- publicdomain - [Public Domain](http://creativecommons.org/licenses/publicdomain/) +- cc-by - [CC Attribution 4.0 International](http://creativecommons.org/licenses/by/4.0/) +- cc-by-sa - [CC Attribution-Share Alike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/) +- gnufdl - [GNU Free Documentation License 1.3](http://www.gnu.org/licenses/fdl-1.3.html) +- cc-by-nc - [CC Attribution-Noncommercial 4.0International](http://creativecommons.org/licenses/by-nc/4.0/) +- cc-by-nc-sa - [CC Attribution-Noncommercial-Share Alike 4.0 International](http://creativecommons.org/licenses/by-nc-sa/4.0/) +- 0 - Do not show any license information + + + Dependencies ------------ @@ -183,7 +183,7 @@ None. Example Playbook ---------------- -``` +```Yaml - hosts: all become: yes become_method: sudo @@ -191,26 +191,23 @@ Example Playbook - role: PeterMosmans.dokuwiki vars: dokuwiki_base: /var/www/html - dokuwiki_configure_apache2: true + dokuwiki_webserver: nginx dokuwiki_plugins: - - name: tag - src: https://github.com/dokufreaks/plugin-tag/tarball/master - - name: pagelist - src: https://github.com/dokufreaks/plugin-pagelist/tarball/master + - tag + - pagelist dokuwiki_plugins_remove: - - name: authad - - name: authldap - - name: authmysql - - name: authpdo - - name: authpgsql - - name: info - - name: popularity + - authad + - authldap + - authmysql + - authpdo + - authpgsql + - info + - popularity dokuwiki_preconfigure: true dokuwiki_savedir: /var/www/html/data dokuwiki_template: bootstrap3 dokuwiki_templates: - - name: bootstrap3 - src: https://github.com/LotarProject/dokuwiki-template-bootstrap3/tarball/master + - bootstrap3 dokuwiki_users: - login: admin hash: "$2y$05$Nr3wFqH54gcdhxPK9easseLSVwLAnLTD2flYmQbAbCVIiiTU4mCjS" @@ -218,10 +215,11 @@ Example Playbook email: admin@admin groups: admin,user ``` + This example will install Dokuwiki to `/var/www/html`, and use `/var/www/html/data` as data directory. It will install the plugins `tag` and `pagelist`, and remove the plugins `authad`, `authldap`, `authmysql`, `authpdo`, `authpgsql`, `info` and `popularity`. It will install and use the `bootstrap3` theme, and grant the user `admin` with the password `admin` access to the wiki. -Moreover, it will configure and enable the Apache site. +Moreover, it will configure and enable the Nginx site. License @@ -233,7 +231,10 @@ GPLv3 Author Information ------------------ -Created by Peter Mosmans. Suggestions, feedback and pull requests are always +Created by [Peter Mosmans](https://github.com/PeterMosmans). Suggestions, feedback and pull requests are always welcome. -Contributions by @onny +### Contributors + +- [Jonas Heinrich](https://github.com/onny) +- [B Cacheira](https://github.com/cacheira) \ No newline at end of file diff --git a/defaults/main.yml b/defaults/main.yml index 5919a2a..f7f655f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,27 +1,80 @@ --- # defaults file for PeterMosmans.dokuwiki +# webserver +dokuwiki_webserver: "nginx" # [nginx, apache] +dokuwiki_provision: false +dokuwiki_webserver_nginx_conf: "/etc/nginx/" # This is nginx_main_template['conf_file_location'] if using nginxinc.nginx role + -dokuwiki_base: /var/www/html +# for apache +#dokuwiki_user: root +#dokuwiki_group: www-data +# for nginx +dokuwiki_user: nginx dokuwiki_group: www-data -dokuwiki_name: dokuwiki + +# Version to install +dokuwiki_version: stable # [stable, old_stable, development] + +dokuwiki_server_name: "localhost" +dokuwiki_base: /var/www/dokuwiki +dokuwiki_savedir: /var/www/dokuwiki/data + +dokuwiki_plugins: + - pagelist + - fastwiki + - edittable + - dw2pdf + - bookcreator + - tag + - discussion + - dropfiles + - color + - nspages + - sortablejs + dokuwiki_plugins_remove: - - name: authad - - name: authldap - - name: authmysql - - name: authpdo - - name: authpgsql - - name: info - - name: popularity -dokuwiki_provision: false -dokuwiki_savedir: /var/www/html/data -dokuwiki_source: https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz -dokuwiki_user: root + - authad + - authldap + - authmysql + - authpdo + - authpgsql + - info + - popularity # Template parameters (will only be used when dokuwiki_provision is true) dokuwiki_acl_all: 0 dokuwiki_acl_user: 8 -dokuwiki_disableactions: "register" dokuwiki_local: - name: "['passcrypt']" value: 'bcrypt' -dokuwiki_title: "default Dokuwiki site" + - name: "['gzip_output']" + value: '1' + - name: "['updatecheck']" + value: '0' + +# Dokuwiki config options +dokuwiki_name: "dokuwiki" +dokuwiki_title: "Default Dokuwiki site" +dokuwiki_opt_lang: "en" +#dokuwiki_opt_superuser: "root" +#dokuwiki_opt_fullname: "root" +#dokuwiki_opt_email: "root" +#dokuwiki_opt_password: "root" +dokuwiki_opt_acl: "1" +# dokuwiki_opt_policy +# 0 - Open Wiki (read, write, upload for everyone) +# 1 - Public Wiki (read for everyone, write and upload for registered users) +# 2 - Closed Wiki (read, write, upload for registered users only) +dokuwiki_opt_policy: "0" +dokuwiki_disableactions: "register" +#dokuwiki_opt_licence +#cc-zero - CC0 1.0 Universal http://creativecommons.org/publicdomain/zero/1.0/ +#publicdomain - Public Domain http://creativecommons.org/licenses/publicdomain/ +#cc-by - CC Attribution 4.0 International http://creativecommons.org/licenses/by/4.0/ +#cc-by-sa - CC Attribution-Share Alike 4.0 International http://creativecommons.org/licenses/by-sa/4.0/ +#gnufdl - GNU Free Documentation License 1.3 http://www.gnu.org/licenses/fdl-1.3.html +#cc-by-nc - CC Attribution-Noncommercial 4.0 International http://creativecommons.org/licenses/by-nc/4.0/ +#cc-by-nc-sa - CC Attribution-Noncommercial-Share Alike 4.0 International http://creativecommons.org/licenses/by-nc-sa/4.0/ +#0 - Do not show any license information +dokuwiki_opt_license: "0" diff --git a/handlers/main.yml b/handlers/main.yml index d45d4ca..5bddec0 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,3 +4,13 @@ service: name: apache2 state: restarted + +- name: restart nginx + service: + name: nginx + state: restarted + +- name: restart php-fpm + service: + name: "{{ dokuwiki_phpfpm_service.files[0].path | basename | splitext | first }}" + state: restarted diff --git a/tasks/main.yml b/tasks/main.yml index 1802213..93dd46d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,6 +2,9 @@ # tasks file for PeterMosmans.dokuwiki # Variable setup. +- name: Include Generic variables. + include_vars: "{{ ansible_os_family }}.yml" + - name: Include OS-specific variables. include_vars: "{{ ansible_os_family }}.yml" @@ -26,6 +29,22 @@ tags: - permission +- name: Download and install latest version of plugins via Dokuwiki's gittool + become: yes + shell: "/usr/bin/php {{ dokuwiki_base }}/bin/gittool.php install {{item}}" + with_items: "{{ dokuwiki_plugins|default([]) }}" + tags: + - plugins + - upgrade + +- name: Download and install latest version of templates via Dokuwiki's gittool + become: yes + shell: "/usr/bin/php {{ dokuwiki_base }}/bin/gittool.php install template:{{item}}" + with_items: "{{ dokuwiki_templates|default([]) }}" + tags: + - templates + - upgrade + - block: - name: Apply and deploy configuration templates template: @@ -37,8 +56,8 @@ with_items: - src: acl.auth.php.j2 dest: acl.auth.php - - src: local.php.j2 - dest: local.php + - src: local.protected.php.j2 + dest: local.protected.php - src: plugins.local.php.j2 dest: plugins.local.php - src: users.auth.php.j2 @@ -65,76 +84,6 @@ - provision when: dokuwiki_provision -- name: Remove (previous versions of) plugins - file: - path: "{{ dokuwiki_base }}/lib/plugins/{{ item.name }}" - state: absent - with_flattened: - - "{{ dokuwiki_plugins|default([]) }}" - - "{{ dokuwiki_plugins_remove|default([]) }}" - tags: - - plugins - - upgrade - -- name: Recreate directory for each plugin (workaround for Ansible bug) - file: - path: "{{ dokuwiki_base }}/lib/plugins/{{ item.name }}" - state: directory - group: "{{ dokuwiki_group }}" - owner: "{{ dokuwiki_user }}" - with_items: "{{ dokuwiki_plugins|default([]) }}" - tags: - - plugins - - upgrade - -- name: Download and install latest version of plugins - unarchive: - src: "{{ item.src }}" - dest: "{{ dokuwiki_base }}/lib/plugins/{{ item.name }}" - remote_src: true - extra_opts: ['--strip-components=1'] - group: "{{ dokuwiki_group }}" - owner: "{{ dokuwiki_user }}" - mode: "0770" - with_items: "{{ dokuwiki_plugins|default([]) }}" - tags: - - plugins - - upgrade - -- name: Remove previous versions of templates - file: - path: "{{ dokuwiki_base }}/lib/tpl/{{ item.name }}" - state: absent - with_items: "{{ dokuwiki_templates|default([]) }}" - tags: - - templates - - upgrade - -- name: Recreate directory for each template (workaround for Ansible bug) - file: - path: "{{ dokuwiki_base }}/lib/tpl/{{ item.name }}" - state: directory - group: "{{ dokuwiki_group }}" - owner: "{{ dokuwiki_user }}" - with_items: "{{ dokuwiki_templates|default([]) }}" - tags: - - templates - - upgrade - -- name: Download and install latest version of templates - unarchive: - src: "{{ item.src }}" - dest: "{{ dokuwiki_base }}/lib/tpl/{{ item.name }}" - remote_src: true - extra_opts: ['--strip-components=1'] - group: "{{ dokuwiki_group }}" - owner: "{{ dokuwiki_user }}" - mode: "0770" - with_items: "{{ dokuwiki_templates|default([]) }}" - tags: - - templates - - upgrade - - name: Customize template using online files get_url: url: "{{ item.url }}" @@ -184,10 +133,34 @@ - permission - upgrade +- name: Apply and deploy Nginx configuration for Dokuwiki + block: + - name: Ensure Nginx conf.d exists + file: + path: "{{ dokuwiki_webserver_nginx_conf }}/conf.d" + state: directory + group: root + owner: root + mode: "0770" + + - name: Create dokuwiki config file and restart Nginx + template: + src: nginx.dokuwiki.conf.j2 + dest: "/etc/nginx/conf.d/{{ dokuwiki_name }}.conf" + owner: root + group: root + mode: "0640" + tags: + - templates + notify: + - restart nginx + when: dokuwiki_webserver is defined and dokuwiki_webserver == "nginx" + #when: dokuwiki_webserver == "nginx" + - block: - name: Apply and deploy Apache configuration for Dokuwiki template: - src: dokuwiki.conf.j2 + src: apache.dokuwiki.conf.j2 dest: "/etc/apache2/sites-available/{{ dokuwiki_name }}.conf" owner: root group: root @@ -197,10 +170,13 @@ notify: - restart apache2 - - name: Enable the site + - name: Enable dokuwiki and restart Apache command: a2ensite {{ dokuwiki_name }}.conf notify: - restart apache2 - when: dokuwiki_configure_apache2 is defined and dokuwiki_configure_apache2 + when: dokuwiki_webserver is defined and dokuwiki_webserver == "apache" + + + \ No newline at end of file diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 783f16e..3abed9a 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -1,32 +1,104 @@ --- -- name: Install required packages - apt: +- name: Install Required Dependencies # must be done before php-fpm, due to mbstring + become: true + package: name: "{{ item }}" - state: present + state: latest install_recommends: false - with_items: - - ca-certificates - - openssl - - php5-gd - - php5-sqlite - - tar - - unzip - - zip + with_items: "{{ dokuwiki_dependencies + dokuwiki_recommendations }}" +# + +- name: Setup PHP-FPM + block: + - name: Install PHP-FPM + become: true + package: + name: php-fpm + state: latest + install_recommends: false + + - name: Find the conf.d dir, making this php version agnostic + find: + paths: "/etc/php/" + patterns: "pool.d" + recurse: yes + file_type: directory + register: dokuwiki_phpfpm_confd + + - name: Register the PHP-FPM service name + find: + paths: "/lib/systemd/system/" + patterns: "php*fpm.service" + file_type: file + register: dokuwiki_phpfpm_service + # resulting service name will be "dokuwiki_phpfpm_service.files[0].path | basename | splitext | first"... yeah. + + - name: Configure PGP-FPM Pool + template: + src: php-fpm.www.conf.j2 + dest: "{{ dokuwiki_phpfpm_confd.files[0].path }}/www.conf" + mode: "0644" + group: root + owner: root + notify: + - restart php-fpm + + - name: Add nginx user to group www-data (php-fpm permissions) + user: + name: "nginx" + groups: "www-data" + append: yes + + when: dokuwiki_webserver == "nginx" +# - name: Make sure Dokuwiki base directory exists (workaround for Ansible bug) file: path: "{{ dokuwiki_base }}" - state: directory + group: "{{ dokuwiki_group }}" + owner: "{{ dokuwiki_user }}" + mode: "0770" + state: directory +# -- name: Download and extract latest version of Dokuwiki +- name: Download and extract Dokuwiki Stable + become: true unarchive: - src: "{{ dokuwiki_url }}" + src: "{{ dokuwiki_stable_url }}" + remote_src: yes dest: "{{ dokuwiki_base }}" - remote_src: true - extra_opts: ['--strip-components=1'] + extra_opts: ['--strip-components=1'] # remove first dir group: "{{ dokuwiki_group }}" owner: "{{ dokuwiki_user }}" - mode: "0750" + when: dokuwiki_version == "stable" tags: - upgrade +# +- name: Download and extract Dokuwiki Old Stable + become: true + unarchive: + src: "{{ dokuwiki_old_stable_url }}" + remote_src: yes + dest: "{{ dokuwiki_base }}" + extra_opts: ['--strip-components=1'] # remove first dir + group: "{{ dokuwiki_group }}" + owner: "{{ dokuwiki_user }}" + when: dokuwiki_version == "old_stable" + tags: + - upgrade +# + +- name: Download and extract Dokuwiki Development + become: true + unarchive: + src: "{{ dokuwiki_development_url }}" + remote_src: yes + dest: "{{ dokuwiki_base }}" + extra_opts: ['--strip-components=1'] # remove first dir + group: "{{ dokuwiki_group }}" + owner: "{{ dokuwiki_user }}" + when: dokuwiki_version == "development" + tags: + - upgrade +# \ No newline at end of file diff --git a/templates/dokuwiki.conf.j2 b/templates/apache.dokuwiki.conf.j2 similarity index 100% rename from templates/dokuwiki.conf.j2 rename to templates/apache.dokuwiki.conf.j2 diff --git a/templates/local.php.j2 b/templates/local.protected.php.j2 similarity index 68% rename from templates/local.php.j2 rename to templates/local.protected.php.j2 index a925c0e..ba59f56 100644 --- a/templates/local.php.j2 +++ b/templates/local.protected.php.j2 @@ -1,14 +1,15 @@