summaryrefslogtreecommitdiffstats
path: root/roles/wiki/tasks/main.yml
blob: cd7cbdccefec11d4d259109fd5fd715f25a1e630 (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
- name: Set up packages
  ansible.builtin.apt:
    update_cache: true
    pkg:
      - ikiwiki
      - git
      - openssh-server
      - libimage-magick-perl
      - libtext-csv-perl
      - libxml-writer-perl
      - imagemagick
      - nginx
      - wget
    state: present
- name: Create ikiwiki group
  group:
    name: ikiwiki
    state: present
- name: Create ikiwiki user
  user:
    name: ikiwiki
    group: ikiwiki
    state: present
- name: Template the config
  ansible.builtin.template:
    src: emacsconf.setup
    dest: "{{ ikiwiki_path }}/emacsconf.setup"
    owner: ikiwiki
- name: Create the plugin directory
  file:
    path: "{{ ikiwiki_plugin_path }}/IkiWiki/Plugin"
    state: directory
- name: Copy Ikiwiki plugins
  tags: wiki-plugins
  template:
    src: "{{ item }}"
    dest: "{{ ikiwiki_plugin_path }}/IkiWiki/Plugin/{{ item }}"
  loop:
    - copyright.pm
    - htmlscrubber.pm
    - license.pm
- include: docker.yml
  when: docker
- name: Chown all the files to ikiwiki
  tags: wiki-plugins
  file:
    dest: "{{ ikiwiki_path }}"
    owner: ikiwiki
    group: ikiwiki
    recurse: true
- name: Regenerate all the files
  tags: wiki-regenerate, wiki-plugins
  become: true
  become_user: ikiwiki
  shell: cd ~ikiwiki; ikiwiki --setup "{{ ikiwiki_path }}/emacsconf.setup" --rebuild --wrappers
  register: output
- debug:
    var: output