[mod] role:mastodon
This commit is contained in:
parent
d8f9826fe0
commit
4b31dbc90a
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"
|
||||
}
|
||||
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"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue