aboutsummaryrefslogtreecommitdiff
path: root/roles/personal/tasks/main.yml
blob: 8491d2eae29d7a692efae51f29e721b8361c91c4 (plain)
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
---
- block:
    - name: Ensure personal web root exists
      ansible.builtin.file:
        path: /srv/http/michalec.dev
        state: directory
        owner: cmmm
        group: www-data
        mode: '0775'

    - name: Ensure nginx site modular directory exists
      ansible.builtin.file:
        path: /etc/nginx/http.d/michalec.dev.d
        state: directory
        owner: root
        group: root
        mode: '0755'

    - name: Deploy personal nginx site configuration
      ansible.builtin.template:
        src: nginx.conf.j2
        dest: /etc/nginx/http.d/personal.conf
        owner: root
        group: root
        mode: '0444'
        validate: nginx-validate %s /etc/nginx/http.d/personal.conf
      notify: Reload nginx

    - name: Deploy personal nginx htpasswd
      ansible.builtin.template:
        src: htpasswd.j2
        dest: /etc/nginx/htpasswd
        owner: root
        group: nginx
        mode: '0440'
      notify: Reload nginx

    - name: Provision personal CGit instance
      ansible.builtin.include_role:
        name: cgit
      tags:
        cgit
      vars:
        instance: "personal"
        domain: "git.michalec.dev"
        root_title: "Martin Michalec"
        root_desc: "Here you can find all my git repositories"
        scan_path: "/var/lib/git/repositories/cmmm/"
        extra: |
          section=cosmos
          repo.url=cosmos/codebase
          repo.name=codebase
          repo.desc=The codebase
          repo.owner=cmmm@cosmos.party
          repo.path=/var/lib/git/repositories/codebase.git

  tags:
    - personal