summaryrefslogtreecommitdiff
path: root/baserock_webserver/instance-irclogs-config.yml
blob: f050d5ff7b1f862bc7eab3425c1ad1c9f5a4128f (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Instance-specific configuration for the Baserock IRC logger.
---
- hosts: webserver
  vars_files:
  - irclogs/brlogger_secrets.yml
  tasks:
  - name: Install Supybot from pip
    pip:
      name: supybot
      executable: pip2
    become: yes
    become_user: root

  - name: Check for MeetBot install
    stat:
      path: /usr/local/lib/python2.7/dist-packages/supybot/plugins/MeetBot
    register: meetbot

  - name: Install MeetBot
    block:
      - git:
          repo: 'https://opendev.org/opendev/meetbot.git'
          dest: /tmp/meetbot
          version: 01e051648c2759c03f2a907552af8e4410abcde9
      - command: mv /tmp/meetbot/ircmeeting /tmp/meetbot/MeetBot/
        args:
          creates: /tmp/meetbot/Meetbot/ircmeeting
      - synchronize:
          src: /tmp/meetbot/MeetBot
          dest: /usr/local/lib/python2.7/dist-packages/supybot/plugins
        delegate_to: "{{ inventory_hostname }}"
    become: yes
    become_user: root
    when: not meetbot.stat.exists

  - name: MeetBot configuration
    copy:
      src: irclogs/meetingLocalConfig.py
      dest: /usr/local/lib/python2.7/dist-packages/supybot/plugins/MeetBot/ircmeeting/meetingLocalConfig.py
    become: yes
    become_user: root


  - name: Install Supybot from pip
    pip:
      name: irclog2html
      executable: pip3
    become: yes
    become_user: root

  - name: supybot user
    user:
      name: supybot
    become: yes
    become_user: root

  - name: /srv/irclogs.baserock.org/
    file:
      path: /srv/irclogs.baserock.org/
      owner: supybot
      state: directory
    become: yes
    become_user: root

  - name: supybot configuration
    template:
      src: "irclogs/supybot-baserock.conf"
      dest: "/home/supybot/supybot-baserock.conf"
      owner: supybot
      group: supybot
    become: yes
    become_user: root

  - name: install systemd units
    copy:
      src: ./irclogs/{{item}}
      dest: /etc/systemd/system/{{item}}
    become: yes
    become_user: root
    with_items:
      - irclogs-generation.service
      - irclogs-generation.timer
      - supybot.service

  - name: enable systemd units
    systemd:
      name: "{{item}}"
      enabled: yes
      daemon_reload: yes
      state: started
    become: yes
    become_user: root
    with_items:
      - irclogs-generation.service
      - irclogs-generation.timer
      - supybot.service