summaryrefslogtreecommitdiffstats
path: root/roles/wiki/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/wiki/tasks/main.yml')
-rw-r--r--roles/wiki/tasks/main.yml64
1 files changed, 63 insertions, 1 deletions
diff --git a/roles/wiki/tasks/main.yml b/roles/wiki/tasks/main.yml
index cd7cbdc..3ee7d4f 100644
--- a/roles/wiki/tasks/main.yml
+++ b/roles/wiki/tasks/main.yml
@@ -13,6 +13,11 @@
- nginx
- wget
state: present
+- name: Start ssh
+ tags: ssh
+ service:
+ name: ssh
+ state: started
- name: Create ikiwiki group
group:
name: ikiwiki
@@ -22,11 +27,63 @@
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"
@@ -40,7 +97,7 @@
- copyright.pm
- htmlscrubber.pm
- license.pm
-- include: docker.yml
+- include_tasks: docker.yml
when: docker
- name: Chown all the files to ikiwiki
tags: wiki-plugins
@@ -48,7 +105,12 @@
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