在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mastodon/mastodon-ansible开源软件地址(OpenSource Url):https://github.com/mastodon/mastodon-ansible开源编程语言(OpenSource Language):Jinja 99.2%开源软件介绍(OpenSource Introduction):Ansible playbook for installing MastodonThis playbook contains several roles for provisioning a ready-to-go Mastodon instance. Prerequisites for running the playbook
for testing purposes:
Setup$ virtualenv -p /usr/bin/python3 env
$ source env/bin/activate
$ git clone https://github.com/mastodon/mastodon-ansible.git
$ cd mastodon-ansible
$ pip install -r requirements.txt Running the playbooksBareThis playbook is intended to be run on a "bare" (virtual) server, with the support for provisioning the Mastodon stack as well as a PostgresSQL and Redis database. Typing secret content directly at the command line (without a prompt) leaves the secret string in your shell history. You should use Ansible Vault to secure your Mastodon database credentials for the use with Ansible instead. The To encrypt $ ansible-vault encrypt secrets.yml Then run the playbook as following: $ ansible-playbook playbook.yml --ask-vault-pass -i <your-host-here>, -u <remote-user> --ask-become-pass -e 'ansible_python_interpreter=/usr/bin/python3' --extra-vars="@secrets.yml" If you prefer not to use Ansible Vault, you can run the playbook as following: $ ansible-playbook playbook.yml -i <your-host-here>, -u <remote-user> --ask-become-pass -e 'ansible_python_interpreter=/usr/bin/python3' --extra-vars="mastodon_db_password=your-password redis_pass=your-password mastodon_host=example.com" The playbook is using Note: This assumes you're within the virtualenv already. After the playbook has finished its execution, Mastodon now should be available at the hostname you defined and you're not required run the Mastodon setup wizard. As Email servers differ widely from configuration to configuration you must edit the .env.production file and add your own email server details followed by restart of Mastodon services. To edit ssh yourmachine
su - mastodon
cd ~/live
nano .env.production
systemctl restart mastodon-*.service To see a list of available environment variables for your Mastodon installation, please refer to the Mastodon documentation. RolesBy default, the playbook runs all of the roles defined here in sequence. You can skip any of them by specifying ExampleSkipping the $ ansible-playbook playbook.yml --skip-tags=postgres -i <your-host>, -u <your-user> webThis role contains the following tasks:
Settings
PostgresSQLThis role installs PostgresSQL, adds a database (named Settings
If you configure your PostgresSQL on another server, you need to configure these settings additionally:
Examples
$ ansible-playbook playbook -i <your-host-here>, -u <remote-user> --extra-vars="mastodon_db_password=your-password mastodon_db_login_unix_socket='/var/run/postgresql'"
$ ansible-playbook playbook -i <your-host-here>, -u <remote-user> --extra-vars="mastodon_db_password=your-password mastodon_db_login_host=mastodon-db mastodon_db_port=5432 mastodon_db_login_user=your-admin-db-user mastodon_db_login_password=your-password" redisThis role installs the Redis key-value store, used by Mastodon, and its client libraries. Settings
DockerFIXME TestingTesting is done using Goss. The tests are in the Continuous IntegrationThis repository is regularly running tests using GitHub Actions. Its configuration can be found in Local testing$ vagrant up This should provision a new instance within VirtualBox and run all the tests necessary to verify the Ansible playbook is valid. By default it runs the bare provisioning. TODO
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论