mercurial/web/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Mon, 29 Jun 2020 18:59:24 -0500
changeset 57 628402a01a59
parent 56 59e94b4a91a2
child 58 baca37fdc8c3
permissions -rw-r--r--
Removed srht role.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: pip install mercurial
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  pip: name="mercurial" executable="pip3"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
- name: apt install uwsgi
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
  become: yes
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
  apt: name="{{item}}"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
  loop:
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    - "uwsgi"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
    - "uwsgi-plugin-python3"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
  notify: restart uwsgi
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
- name: configure hgweb
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
  become: yes
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
  template: src="{{item}}.j2" dest="{{mercurial_uwsgi_root}}/{{item}}"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
  loop:
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
    - "hgweb.config"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
    - "hgweb.wsgi"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
  notify: restart uwsgi
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
- name: install uwsgi site
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
  become: yes
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
  template: src="hgweb.ini.j2" dest="/etc/uwsgi/apps-available/hgweb.ini"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
  notify: restart uwsgi
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
- name: enable uwsgi site
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
  become: yes
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
  file:
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    31
    src:  "/etc/uwsgi/apps-available/hgweb.ini"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    32
    dest: "/etc/uwsgi/apps-enabled/hgweb.ini"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    33
    state: "link"
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
  notify: restart uwsgi
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    35
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    36
- name: ensure uwsgi service is started
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    37
  become: yes
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    38
  systemd: name="uwsgi.service" enabled="yes"