Compare commits
3 commits
main
...
dev-mastod
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15b68794eb | ||
|
|
4b31dbc90a | ||
|
|
d8f9826fe0 |
4
roles/mastodon/defaults/main.json
Normal file
4
roles/mastodon/defaults/main.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"var_mastodon_user": "mastodon",
|
||||
"var_mastodon_directory": "/opt/mastodon"
|
||||
}
|
||||
8
roles/mastodon/info.md
Normal file
8
roles/mastodon/info.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
## Beschreibung
|
||||
|
||||
Micro-Blogging-Dienst [Mastodon](https://joinmastodon.org/)
|
||||
|
||||
|
||||
## Verweise
|
||||
|
||||
- [Mastodon Documentation | Running your own server](https://docs.joinmastodon.org/user/run-your-own/)
|
||||
169
roles/mastodon/tasks/main.json
Normal file
169
roles/mastodon/tasks/main.json
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
[
|
||||
{
|
||||
"name": "packages",
|
||||
"become": true,
|
||||
"ansible.builtin.apt": {
|
||||
"update_cache": true,
|
||||
"pkg": [
|
||||
"curl",
|
||||
"wget",
|
||||
"gnupg",
|
||||
"apt-transport-https",
|
||||
"lsb-release",
|
||||
"ca-certificates",
|
||||
"imagemagick",
|
||||
"ffmpeg",
|
||||
"libpq-dev",
|
||||
"libxml2-dev",
|
||||
"libxslt1-dev",
|
||||
"file",
|
||||
"git-core",
|
||||
"g++",
|
||||
"libprotobuf-dev",
|
||||
"protobuf-compiler",
|
||||
"pkg-config",
|
||||
"gcc",
|
||||
"autoconf",
|
||||
"bison",
|
||||
"build-essential",
|
||||
"libssl-dev",
|
||||
"libyaml-dev",
|
||||
"libreadline6-dev",
|
||||
"zlib1g-dev",
|
||||
"libncurses5-dev",
|
||||
"libffi-dev",
|
||||
"libgdbm-dev",
|
||||
"nginx",
|
||||
"nodejs",
|
||||
"redis-server",
|
||||
"redis-tools",
|
||||
"postgresql",
|
||||
"postgresql-contrib",
|
||||
"certbot",
|
||||
"python3-certbot-nginx",
|
||||
"libidn11-dev",
|
||||
"libicu-dev",
|
||||
"libjemalloc-dev"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "user",
|
||||
"become": true,
|
||||
"ansible.builtin.user": {
|
||||
"name": "{{var_mastodon_user}}",
|
||||
"create_home": true,
|
||||
"home": "{{var_mastodon_directory}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ruby_environment | 1",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"cmd": "git clone https://github.com/rbenv/rbenv.git ~/.rbenv"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ruby_environment | 2",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"cmd": "echo 'export PATH=\"$HOME/.rbenv/bin:$PATH\"' >> ~/.bashrc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ruby_environment | 3",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"cmd": "echo 'eval \"$(rbenv init -)\"' >> ~/.bashrc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ruby_environment | 4",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"cmd": "bash 'git clone https://github.com/rbenv/ruby-build.git \"$(rbenv root)\"/plugins/ruby-build'"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ruby_environment | 5",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"cmd": "RUBY_CONFIGURE_OPTS='--with-jemalloc rbenv install 3.2.3' rbenv global 3.2.3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ruby_environment | 6",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"cmd": "gem install bundler --no-document"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "setup | 1",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"cmd": "git clone https://github.com/mastodon/mastodon.git live"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "setup | 2",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"chdir": "{{var_mastodon_directory}}/live",
|
||||
"cmd": "git checkout $(git tag -l | grep '^v[0-9.]*$' | sort -V | tail -n 1)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "setup | 3",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"chdir": "{{var_mastodon_directory}}/live",
|
||||
"cmd": "bundle config deployment 'true'"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "setup | 4",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"chdir": "{{var_mastodon_directory}}/live",
|
||||
"cmd": "bundle config without 'development test'"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "setup | 5",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"chdir": "{{var_mastodon_directory}}/live",
|
||||
"cmd": "bundle install -j$(getconf _NPROCESSORS_ONLN)"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "setup | 6",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"chdir": "{{var_mastodon_directory}}/live",
|
||||
"cmd": "yarn install --pure-lockfile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "setup | 7",
|
||||
"become": true,
|
||||
"become_user": "{{var_mastodon_user}}",
|
||||
"ansible.builtin.command": {
|
||||
"chdir": "{{var_mastodon_directory}}/live",
|
||||
"cmd": "RAILS_ENV=production bundle exec rake mastodon:setup"
|
||||
}
|
||||
}
|
||||
]
|
||||
10
roles/mastodon/vardef.json
Normal file
10
roles/mastodon/vardef.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"user": {
|
||||
"mandatory": false,
|
||||
"type": "string"
|
||||
},
|
||||
"directory": {
|
||||
"mandatory": false,
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
5
roles/postgresql-for-mastodon/defaults/main.json
Normal file
5
roles/postgresql-for-mastodon/defaults/main.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"var_postgresql_for_mastodon_username": "mastodon_user",
|
||||
"var_postgresql_for_mastodon_password": "REPLACE_ME",
|
||||
"var_postgresql_for_mastodon_schema": "mastodon"
|
||||
}
|
||||
49
roles/postgresql-for-mastodon/tasks/main.json
Normal file
49
roles/postgresql-for-mastodon/tasks/main.json
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
[
|
||||
{
|
||||
"name": "packages",
|
||||
"become": true,
|
||||
"ansible.builtin.apt": {
|
||||
"update_cache": true,
|
||||
"pkg": [
|
||||
"acl",
|
||||
"python3-psycopg2"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "user",
|
||||
"become": true,
|
||||
"become_user": "postgres",
|
||||
"community.postgresql.postgresql_user": {
|
||||
"state": "present",
|
||||
"name": "{{var_postgresql_for_mastodon_username}}",
|
||||
"password": "{{var_postgresql_for_mastodon_password}}"
|
||||
},
|
||||
"environment": {
|
||||
"PGOPTIONS": "-c password_encryption=scram-sha-256"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "schema",
|
||||
"become": true,
|
||||
"become_user": "postgres",
|
||||
"community.postgresql.postgresql_db": {
|
||||
"state": "present",
|
||||
"name": "{{var_postgresql_for_mastodon_schema}}",
|
||||
"owner": "{{var_postgresql_for_mastodon_username}}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rights",
|
||||
"become": true,
|
||||
"become_user": "postgres",
|
||||
"community.postgresql.postgresql_privs": {
|
||||
"state": "present",
|
||||
"db": "{{var_postgresql_for_mastodon_schema}}",
|
||||
"objs": "ALL_IN_SCHEMA",
|
||||
"roles": "{{var_postgresql_for_mastodon_username}}",
|
||||
"privs": "ALL",
|
||||
"grant_option": true
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Reference in a new issue