oragono/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 05 Jul 2020 10:25:32 -0500
changeset 118 56bffa9ef826
parent 114 34c8632d763d
child 137 645c1e109921
permissions -rw-r--r--
Added nginx and oragono HUP reloading to systemd handlers. Added nginx config.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
114
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: add oragono user
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  user: name="oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
- name: download oragono
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
  unarchive:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
    remote_src: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    src: "{{oragono_url}}"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
    dest: "/tmp"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
    creates: "/tmp/{{oragono_tar_name}}/"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
- name: install oragono
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
  copy:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
    src: "/tmp/{{oragono_tar_name}}/oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
    dest: "/usr/local/bin/"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
    remote_src: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
    owner: "root"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
    group: "root"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
    mode: "0755"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
  notify: restart oragono
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
- name: create oragono dirs
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
  file:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
    path: "{{item}}/oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
    owner: "oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    31
    group: "oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    32
    mode: "0755"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    33
    state: "directory"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
  loop:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    35
    - "/etc"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    36
    - "/var"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    37
    - "/run"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    38
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    39
- name: configure oragono
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    40
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    41
  template:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    42
    src: "oragono.yaml.j2"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    43
    dest: "/etc/oragono/oragono.yaml"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    44
    owner: "oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    45
    group: "oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    46
    mode: "0644"
118
56bffa9ef826 Added nginx and oragono HUP reloading to systemd handlers. Added nginx config.
Luke Hoersten <luke@hoersten.org>
parents: 114
diff changeset
    47
  notify: reload oragono
114
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    48
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    49
- name: copy motd file
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    50
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    51
  copy:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    52
    src: "{{oragono_motd}}"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    53
    dest: "/etc/oragono/oragono.motd"
118
56bffa9ef826 Added nginx and oragono HUP reloading to systemd handlers. Added nginx config.
Luke Hoersten <luke@hoersten.org>
parents: 114
diff changeset
    54
  notify: reload oragono
114
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    55
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    56
- name: install oragono service
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    57
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    58
  template:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    59
    src: "oragono.service.j2"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    60
    dest: "/lib/systemd/system/oragono.service"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    61
    mode: "0644"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    62
  notify: restart oragono
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    63
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    64
- name: ensure oragono is started
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    65
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    66
  systemd: service="oragono.service" enabled="yes" state="started" daemon_reload="yes"