Installs diaspora from github. | Installs diaspora from github. | ||||
(Includes `diaspora.config`) | |||||
### `diaspora.config` | ### `diaspora.config` | ||||
Configures diaspora. | Configures diaspora. | ||||
### `diaspora.service` | ### `diaspora.service` | ||||
Creates a service for diaspora and runs it. | Creates a service for diaspora and runs it. | ||||
(Includes `diaspora.install` and `diaspora.config`) |
{%- from "diaspora/map.jinja" import diaspora with context %} | |||||
{{ diaspora.install_path }}/config/database.yml: | |||||
file.managed: | |||||
- user: {{ diaspora.user.username }} | |||||
- mode: 600 | |||||
- source: salt://diaspora/files/database.yml | |||||
- template: jinja | |||||
- context: | |||||
database: {{ diaspora.database|json }} | |||||
{{ diaspora.install_path }}/config/diaspora.yml: | |||||
file.managed: | |||||
- user: {{ diaspora.user.username }} | |||||
- mode: 600 | |||||
- source: salt://diaspora/files/diaspora.yml | |||||
- template: jinja | |||||
- context: | |||||
configuration: {{ diaspora.configuration|json }} |
# | |||||
# This file is managed by Salt! Do not edit by hand! | |||||
# | |||||
postgresql: &postgresql | |||||
adapter: postgresql | |||||
host: {{ database.host }} | |||||
port: {{ pillar.get("diaspora:database:port", 5432) }} | |||||
username: {{ database.username }} | |||||
password: "{{ database.password }}" | |||||
encoding: unicode | |||||
mysql: &mysql | |||||
adapter: mysql2 | |||||
host: {{ database.host }} | |||||
port: {{ pillar.get("diaspora:database:port", 3306) }} | |||||
username: {{ database.username }} | |||||
password: "{{ database.password }}" | |||||
# socket: /tmp/mysql.sock | |||||
encoding: utf8mb4 | |||||
collation: utf8mb4_bin | |||||
# Comment the postgresql line and uncomment the mysql line | |||||
# if you want to use mysql | |||||
common: &common | |||||
<<: *{{ database.type }} | |||||
# Should match environment.sidekiq.concurrency | |||||
#pool: 25 | |||||
################################################## | |||||
#### CONFIGURE ABOVE ############################# | |||||
################################################## | |||||
# Normally you don't need to touch anything here | |||||
combined: &combined | |||||
<<: *common | |||||
development: | |||||
<<: *combined | |||||
database: {{ database.database }} | |||||
production: | |||||
<<: *combined | |||||
database: {{ database.database }} | |||||
test: | |||||
<<: *combined | |||||
database: "diaspora_test" | |||||
integration1: | |||||
<<: *combined | |||||
database: diaspora_integration1 | |||||
integration2: | |||||
<<: *combined | |||||
database: diaspora_integration2 |
# | |||||
# This file is managed by Salt! Do not edit by hand! | |||||
# | |||||
# have a look at https://github.com/diaspora/diaspora/blob/develop/config/diaspora.yml.example | |||||
configuration: | |||||
{{ configuration|yaml(false)|indent(2) }} | |||||
## Here you can override settings defined above if you need | |||||
## to have them different in different environments. | |||||
production: ## Section | |||||
environment: ## Section | |||||
development: ## Section | |||||
environment: ## Section | |||||
include: | include: | ||||
- diaspora.install | - diaspora.install | ||||
# - diaspora.config | |||||
- diaspora.config | |||||
# - diaspora.service | # - diaspora.service |
{%- from "diaspora/map.jinja" import diaspora with context %} | {%- from "diaspora/map.jinja" import diaspora with context %} | ||||
include: | |||||
- diaspora.config | |||||
diaspora_dependencies: | diaspora_dependencies: | ||||
pkg.installed: | pkg.installed: | ||||
- pkgs: {{ diaspora.dependencies|json }} | - pkgs: {{ diaspora.dependencies|json }} | ||||
- user: {{ diaspora.user.username }} | - user: {{ diaspora.user.username }} | ||||
- require: | - require: | ||||
- file: diaspora_install_directory | - file: diaspora_install_directory | ||||
- require_in: | |||||
- file: {{ diaspora.install_path }}/config/database.yml | |||||
diaspora_rvm_ruby_version_alias: | diaspora_rvm_ruby_version_alias: | ||||
cmd.run: | cmd.run: |
'mysql_package' : 'libmariadbclient-dev', | 'mysql_package' : 'libmariadbclient-dev', | ||||
'redis_package' : 'redis-server', | 'redis_package' : 'redis-server', | ||||
'redis_service' : 'redis-server', | 'redis_service' : 'redis-server', | ||||
'configuration' : { | |||||
'environment': { | |||||
'certificate_authorities': '/etc/ssl/certs/ca-certificates.crt' | |||||
} | |||||
}, | |||||
}, | }, | ||||
'RedHat': { | 'RedHat': { | ||||
'dependencies' : [ | 'dependencies' : [ | ||||
'mysql_package' : 'mariadb-devel', | 'mysql_package' : 'mariadb-devel', | ||||
'redis_package' : 'redis', | 'redis_package' : 'redis', | ||||
'redis_service' : 'redis', | 'redis_service' : 'redis', | ||||
'configuration' : { | |||||
'environment': { | |||||
'certificate_authorities': '/etc/pki/tls/certs/ca-bundle.crt' | |||||
} | |||||
}, | |||||
}, | }, | ||||
}, merge=salt['grains.filter_by']({ | }, merge=salt['grains.filter_by']({ | ||||
'Ubuntu': { | 'Ubuntu': { |
shell: /bin/zsh | shell: /bin/zsh | ||||
database: | database: | ||||
# type needs to be 'postgresql' or 'mysql' | |||||
type: postgresql | type: postgresql | ||||
host: localhost | host: localhost | ||||
username: diaspora | username: diaspora | ||||
password: secret | password: secret | ||||
database: diaspora | database: diaspora | ||||
# have a look at https://github.com/diaspora/diaspora/blob/develop/config/diaspora.yml.example | |||||
configuration: | |||||
environment: | |||||
url: "https://example.org/" | |||||
settings: | |||||
pod_name: "example diaspora* pod" |