diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-10-14 21:35:40 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-10-14 21:35:40 -0400 |
commit | 5266ca74db9f1e1442d957bbd4be17335266b261 (patch) | |
tree | 9c6f8d6a9a1ba775fa58ba275037f6219e03bb3c /wiki/tasks | |
parent | 2d391af591700ae52b4f2630454eb31dcbbdd3ad (diff) | |
download | emacsconf-ansible-5266ca74db9f1e1442d957bbd4be17335266b261.tar.xz emacsconf-ansible-5266ca74db9f1e1442d957bbd4be17335266b261.zip |
Make docker wiki work
Diffstat (limited to 'wiki/tasks')
-rw-r--r-- | wiki/tasks/docker.yml | 45 | ||||
-rw-r--r-- | wiki/tasks/main.yaml | 33 | ||||
-rw-r--r-- | wiki/tasks/main.yml | 57 |
3 files changed, 102 insertions, 33 deletions
diff --git a/wiki/tasks/docker.yml b/wiki/tasks/docker.yml new file mode 100644 index 0000000..a5d73e2 --- /dev/null +++ b/wiki/tasks/docker.yml @@ -0,0 +1,45 @@ +- name: Set up docker stuff if on docker + apt: + pkg: + - lighttpd + - supervisor +- name: Create the anon user + user: + name: anon +- name: Set up Ikiwiki setup + template: + src: emacsconf.setup + dest: "{{ ikiwiki_path }}/emacsconf.setup" + owner: www-data + group: www-data +- name: Set up the ikiwiki directories + file: + dest: /var/www/html + state: directory + owner: www-data + group: www-data +- name: Clone the bare git repo + git: + bare: true + repo: "{{ ikiwiki_git_source_mount }}" + dest: "{{ ikiwiki_bare_git_dir }}" + version: "{{ ikiwiki_git_branch }}" +- name: Change owner + file: + dest: "{{ ikiwiki_bare_git_dir }}" + recurse: true + owner: www-data + group: www-data +- name: Clone the working git repo + git: + repo: "{{ ikiwiki_bare_git_dir }}" + dest: "{{ ikiwiki_src_dir }}" + version: "{{ ikiwiki_git_branch }}" +- name: Copy supervisor config + template: + src: supervisord.conf + dest: /etc/supervisor/conf.d/ikiwiki.conf +- name: Start lighttpd + service: + name: lighttpd + state: started diff --git a/wiki/tasks/main.yaml b/wiki/tasks/main.yaml deleted file mode 100644 index c685515..0000000 --- a/wiki/tasks/main.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- name: Set up packages - ansible.builtin.apt: - pkg: - - ikiwiki - - git - - openssh-server - - wget - state: present -- name: Create ikiwiki user - user: - name: ikiwiki -- name: Set up SSH directory - ansible.builtin.file: - path: /home/ikiwiki/.ssh - state: directory - mode: '0700' -- name: Install SSH key for EmacsConf wiki - ansible.builtin.get_url: - url: https://emacsconf.org/id_rsa_anon_git_emacsconf - dest: /home/ikiwiki/.ssh/id_rsa_anon_git_emacsconf - mode: '0600' - owner: 'ikiwiki' -- name: Set up or update repositories - become: ikiwiki - ansible.builtin.git: - repo: git://git.emacsconf.org/emacsconf-wiki - dest: /home/ikiwiki/emacsconf-wiki -- name: Template the config - ansible.builtin.template: - src: /templates/emacsconf.setup - dest: /home/ikiwiki/emacsconf.setup - owner: ikiwiki diff --git a/wiki/tasks/main.yml b/wiki/tasks/main.yml new file mode 100644 index 0000000..0fa2336 --- /dev/null +++ b/wiki/tasks/main.yml @@ -0,0 +1,57 @@ +--- +- 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 +- debug: + var: docker +- name: Set up or update repositories + ansible.builtin.git: + repo: git://git.emacsconf.org/emacsconf-wiki + dest: "{{ ikiwiki_src_dir }}" + when: not docker|d(false) +- name: Template the config + ansible.builtin.template: + src: emacsconf.setup + dest: "{{ ikiwiki_path }}/emacsconf.setup" + owner: ikiwiki +- name: Copy Ikiwiki plugins + template: + src: "{{ item }}" + dest: "{{ ikiwiki_plugin_path }}" + loop: + - copyright.pm + - htmlscrubber.pm + - license.pm +- include: docker.yml + when: docker is true +- name: Chown all the files to ikiwiki + file: + dest: "{{ ikiwiki_path }}" + owner: ikiwiki + group: ikiwiki + recurse: true +- name: Regenerate all the files + shell: ikiwiki --setup "{{ ikiwiki_path }}/emacsconf.setup" --rebuild --wrappers + register: output +- debug: + var: output |