Advertisement
QualibreInfo

mediawiki/confapache/tasks/main.yml

Feb 4th, 2022
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.46 KB | None | 0 0
  1. ---
  2.  
  3. - name: "mediawiki directory"
  4.   file:
  5.     path: "{{mediawiki_directory}}"
  6.     owner: "{{ web_user }}"
  7.     group: "{{ web_group }}"
  8.     state: directory
  9.  
  10. - name: "uncompress mediawiki archive"
  11.   unarchive:
  12.     src: "{{mediawiki_archive_url}}"
  13.     dest: "{{mediawiki_directory}}"
  14.     owner: "{{ web_user }}"
  15.     group: "{{ web_group }}"
  16.     remote_src: yes
  17.     extra_opts: --transform=s/mediawiki-[0-9\.]*\///
  18.  
  19. - name: Ensure acl is installed before using an unprivileged user
  20.   package:
  21.     name: acl,git
  22.     state: latest
  23.  
  24. - name: "mediawiki configuration"
  25.   become: yes
  26.   become_user: "{{ web_user }}"
  27.   args:
  28.     creates: "{{mediawiki_directory}}/LocalSettings.php"
  29.     chdir: "{{mediawiki_maintenance_directory}}"
  30.   command:
  31.    php install.php --scriptpath /{{mediawiki_name}}
  32.       --server https://{{ user.slug }}-http2.qualibre-formations.fr
  33.       --dbname mediawiki --lang fr
  34.       --dbuser {{mediawiki_db_user}}
  35.       --dbpass {{mediawiki_db_password}}
  36.       --pass {{mediawiki_admin_password}}
  37.       --dbserver {{mediawiki_db_host}}  
  38.       {{mediawiki_title}} {{mediawiki_admin_user}}
  39.   run_once: yes
  40.   delegate_to: "{{item}}"
  41.   with_items: "{{groups.apache}}"
  42.  
  43. - name: "mediawiki db update"
  44.   become: yes
  45.   become_user: "{{ web_user }}"
  46.   command:
  47.    php update.php --quick
  48.   args:
  49.     chdir: "{{mediawiki_maintenance_directory}}"
  50.   run_once: yes
  51.   register: update_result
  52.   changed_when: "' ...done.' in update_result.stdout"
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement