Initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
# Setup users etc
|
||||
- name: create the mastodon user account
|
||||
user:
|
||||
name: mastodon
|
||||
shell: /bin/bash
|
||||
group: docker
|
||||
|
||||
- name: Check if mastodon repo checked out
|
||||
stat: path=/home/mastodon/live
|
||||
register: p
|
||||
|
||||
- import_tasks: swap.yml
|
||||
|
||||
- import_tasks: repo.yml
|
||||
when: not p.stat.exists
|
||||
|
||||
- name: Install statsd mapper
|
||||
template:
|
||||
src: statsd-mapping.yaml.j2
|
||||
dest: /root/statsd-mapping.yml
|
||||
|
||||
- name: Install .env.production file
|
||||
template:
|
||||
src: env.production.j2
|
||||
dest: /home/mastodon/live/.env.production
|
||||
|
||||
- name: Install docker-compose.yml file
|
||||
template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: /home/mastodon/live/docker-compose.yml
|
||||
notify: "docker-compose up"
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: clone mastodon repo
|
||||
git:
|
||||
repo: https://github.com/mastodon/mastodon.git
|
||||
dest: /home/mastodon/live
|
||||
version: v4.0.2
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
- name: set swap_file variable
|
||||
set_fact:
|
||||
swap_file: /{{ swap_space }}.swap
|
||||
|
||||
- name: check if swap file exists
|
||||
stat:
|
||||
path: "{{ swap_file }}"
|
||||
register: swap_file_check
|
||||
|
||||
- name: create swap file
|
||||
command: fallocate -l {{ swap_space }} {{ swap_file }}
|
||||
args:
|
||||
creates: /{{ swap_file }}
|
||||
|
||||
- name: set permissions on swap file
|
||||
file:
|
||||
path: "{{ swap_file }}"
|
||||
mode: 0600
|
||||
|
||||
- name: format swap file
|
||||
command: mkswap {{ swap_file }}
|
||||
when: not swap_file_check.stat.exists
|
||||
|
||||
- name: add to fstab
|
||||
lineinfile:
|
||||
dest: /etc/fstab
|
||||
regexp: "{{ swap_file }}"
|
||||
line: "{{ swap_file }} none swap sw 0 0"
|
||||
|
||||
- name: turn on swap
|
||||
command: swapon -a
|
||||
|
||||
- name: set swapiness
|
||||
sysctl:
|
||||
name: vm.swappiness
|
||||
value: "1"
|
||||
Reference in New Issue
Block a user