Browse Source

Generate config files

master
Benjamin Neff 7 years ago
parent
commit
777cc78fad
No account linked to committer's email address
8 changed files with 118 additions and 1 deletions
  1. +4
    -0
      README.md
  2. +19
    -0
      diaspora/config.sls
  3. +54
    -0
      diaspora/files/database.yml
  4. +17
    -0
      diaspora/files/diaspora.yml
  5. +1
    -1
      diaspora/init.sls
  6. +5
    -0
      diaspora/install.sls
  7. +10
    -0
      diaspora/map.jinja
  8. +8
    -0
      pillar.example

+ 4
- 0
README.md View File



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`)

+ 19
- 0
diaspora/config.sls View File

{%- 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 }}

+ 54
- 0
diaspora/files/database.yml View File

#
# 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

+ 17
- 0
diaspora/files/diaspora.yml View File

#
# 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
- 1
diaspora/init.sls View File

include: include:
- diaspora.install - diaspora.install
# - diaspora.config
- diaspora.config
# - diaspora.service # - diaspora.service

+ 5
- 0
diaspora/install.sls View File

{%- 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:

+ 10
- 0
diaspora/map.jinja View File

'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': {

+ 8
- 0
pillar.example View File

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"

Loading…
Cancel
Save