@@ -16,6 +16,8 @@ Install, configure and run diaspora as a service. | |||
Installs diaspora from github. | |||
(Includes `diaspora.config`) | |||
### `diaspora.config` | |||
Configures diaspora. | |||
@@ -23,3 +25,5 @@ Configures diaspora. | |||
### `diaspora.service` | |||
Creates a service for diaspora and runs it. | |||
(Includes `diaspora.install` and `diaspora.config`) |
@@ -0,0 +1,19 @@ | |||
{%- 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 }} |
@@ -0,0 +1,54 @@ | |||
# | |||
# 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 |
@@ -0,0 +1,17 @@ | |||
# | |||
# 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 | |||
@@ -1,4 +1,4 @@ | |||
include: | |||
- diaspora.install | |||
# - diaspora.config | |||
- diaspora.config | |||
# - diaspora.service |
@@ -1,5 +1,8 @@ | |||
{%- from "diaspora/map.jinja" import diaspora with context %} | |||
include: | |||
- diaspora.config | |||
diaspora_dependencies: | |||
pkg.installed: | |||
- pkgs: {{ diaspora.dependencies|json }} | |||
@@ -79,6 +82,8 @@ diaspora_git: | |||
- user: {{ diaspora.user.username }} | |||
- require: | |||
- file: diaspora_install_directory | |||
- require_in: | |||
- file: {{ diaspora.install_path }}/config/database.yml | |||
diaspora_rvm_ruby_version_alias: | |||
cmd.run: |
@@ -17,6 +17,11 @@ | |||
'mysql_package' : 'libmariadbclient-dev', | |||
'redis_package' : 'redis-server', | |||
'redis_service' : 'redis-server', | |||
'configuration' : { | |||
'environment': { | |||
'certificate_authorities': '/etc/ssl/certs/ca-certificates.crt' | |||
} | |||
}, | |||
}, | |||
'RedHat': { | |||
'dependencies' : [ | |||
@@ -39,6 +44,11 @@ | |||
'mysql_package' : 'mariadb-devel', | |||
'redis_package' : 'redis', | |||
'redis_service' : 'redis', | |||
'configuration' : { | |||
'environment': { | |||
'certificate_authorities': '/etc/pki/tls/certs/ca-bundle.crt' | |||
} | |||
}, | |||
}, | |||
}, merge=salt['grains.filter_by']({ | |||
'Ubuntu': { |
@@ -13,8 +13,16 @@ diaspora: | |||
shell: /bin/zsh | |||
database: | |||
# type needs to be 'postgresql' or 'mysql' | |||
type: postgresql | |||
host: localhost | |||
username: diaspora | |||
password: secret | |||
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" |