blob: 3ee7d4f88dd81a461b7ff28239fc7f2c420b3135 (
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
---
- 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: Start ssh
tags: ssh
service:
name: ssh
state: started
- name: Create ikiwiki group
group:
name: ikiwiki
state: present
- name: Create ikiwiki user
user:
name: ikiwiki
group: ikiwiki
state: present
- name: Create anon group
group:
name: anon
state: present
- name: Create anon user
user:
name: anon
group: anon
state: present
- include_tasks: bare-git.yml
when: docker or test_mode
- name: Configure safe directory
shell: git config --global --add safe.directory "{{ ikiwiki_src_dir }}"
- name: Clone the working git repo
git:
repo: "{{ ikiwiki_bare_git_dir }}"
dest: "{{ ikiwiki_src_dir }}"
- name: Switch the source git repo to the branch
shell: git checkout "{{ ikiwiki_git_branch }}" 2>/dev/null || git checkout -b "{{ ikiwiki_git_branch }}"
args:
chdir: "{{ ikiwiki_src_dir }}"
- name: Set the default branch policy
shell: git config --global pull.rebase false
become: true
become_user: ikiwiki
- name: Set up SSH directory
tags: ssh
file:
path: /home/ikiwiki/.ssh
owner: ikiwiki
group: ikiwiki
state: directory
mode: 0700
- name: Set up SSH key access
tags: wiki-test-keys
template:
src: authorized_keys
dest: "/home/ikiwiki/.ssh/authorized_keys"
mode: 0600
owner: ikiwiki
group: ikiwiki
when: test_mode
- name: Set up the ikiwiki directories
file:
dest: "{{ ikiwiki_dest }}"
state: directory
owner: ikiwiki
group: ikiwiki
recurse: true
- name: Template the config
ansible.builtin.template:
src: emacsconf.setup
dest: "{{ ikiwiki_path }}/emacsconf.setup"
owner: ikiwiki
group: ikiwiki
- include_tasks: nginx.yml
when: test_mode
- 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_tasks: docker.yml
when: docker
- name: Chown all the files to ikiwiki
tags: wiki-plugins
file:
dest: "{{ ikiwiki_path }}"
owner: ikiwiki
group: ikiwiki
state: directory
recurse: true
- name: Debug
tags: dev-wiki
debug:
var: ikiwiki_path
- 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
|