aboutsummaryrefslogtreecommitdiff
path: root/playbook.yml
blob: 1c694d5b9ee8b53dce4e2df2804ef746455aa182 (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
59
60
61
62
63
64
65
66
67
- name: Gerbolyze container setup playbook
  hosts: wendelstein
  tasks:
    - name: Set hostname
      hostname:
        name: wendelstein.jaseg.net

    - name: Install common admin tools
      dnf:
        name: htop,tmux,fish,mosh,neovim,sqlite
        state: latest

    - name: Install host requisites
      dnf:
          name: nginx,uwsgi,python3-flask,python3-flask-wtf,uwsgi-plugin-python3,certbot,python3-certbot-nginx,libselinux-python,git,iptables-services
          state: latest

    - name: Disable password-based root login
      lineinfile:
        path: /etc/ssh/sshd_config
        regexp: '^PermitRootLogin'
        line: 'PermitRootLogin without-password'
      register: disable_root_pw_ssh

    - name: Restart sshd
      systemd:
          name: sshd
          state: restarted
      when: disable_root_pw_ssh is changed

    - name: Create iptables firewall config dir
      file:
        path: /etc/iptables
        state: directory
        owner: root
        group: root
        mode: 0775

    - name: Configure iptables firewall service
      copy:
        src: iptables.rules
        dest: /etc/iptables/iptables.rules
        owner: root
        group: root
        mode: 0664

    - name: Enable iptables firewall service
      systemd:
        name: iptables
        enabled: yes
        state: started

    - name: Create containers
      include_tasks: setup_containers.yml
      vars:
        containers:
          - gerboweb
          - clippy

    - name: Setup web server
      include_tasks: setup_webserver.yml

    - name: Setup gerboweb
      include_tasks: setup_gerboweb.yml

    - name: Setup clippy
      include_tasks: setup_clippy.yml