oragono/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Sat, 05 Sep 2020 19:27:02 -0500
changeset 137 645c1e109921
parent 118 56bffa9ef826
permissions -rw-r--r--
Moved oragono socket to more persistent location.
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
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    38
- name: configure oragono
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    39
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    40
  template:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    41
    src: "oragono.yaml.j2"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    42
    dest: "/etc/oragono/oragono.yaml"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    43
    owner: "oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    44
    group: "oragono"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    45
    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
    46
  notify: reload oragono
114
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    47
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    48
- name: copy motd file
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    49
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    50
  copy:
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    51
    src: "{{oragono_motd}}"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    52
    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
    53
  notify: reload oragono
114
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    54
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    55
- name: install oragono service
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    56
  become: yes
137
645c1e109921 Moved oragono socket to more persistent location.
Luke Hoersten <luke@hoersten.org>
parents: 118
diff changeset
    57
  copy:
645c1e109921 Moved oragono socket to more persistent location.
Luke Hoersten <luke@hoersten.org>
parents: 118
diff changeset
    58
    src: "oragono.service"
114
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    59
    dest: "/lib/systemd/system/oragono.service"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    60
    mode: "0644"
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    61
  notify: restart oragono
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    62
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    63
- name: ensure oragono is started
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    64
  become: yes
34c8632d763d Added oragono role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    65
  systemd: service="oragono.service" enabled="yes" state="started" daemon_reload="yes"