Skip to content

Commit

Permalink
feat(arch): add support for archlinux
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperTux88 committed Oct 11, 2020
1 parent ba0e4fa commit 7571d3d
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
# - env: INSTANCE=default-amazonlinux-2-3000-3-py3
# - env: INSTANCE=default-ubuntu-1804-3000-3-py2
# - env: INSTANCE=default-ubuntu-1604-3000-3-py2
# - env: INSTANCE=default-arch-base-latest-3000-3-py2
- env: INSTANCE=default-arch-base-latest-3000-3-py2
# - env: INSTANCE=upstart-centos-6-2019-2-py2
# - env: INSTANCE=upstart-amazonlinux-1-2019-2-py2
- env: INSTANCE=mysql-debian-10-master-py3
Expand Down
4 changes: 2 additions & 2 deletions FORMULA
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: diaspora
os: Debian, Ubuntu, RedHat, CentOS
os_family: Debian, RedHat
os: Debian, Ubuntu, RedHat, CentOS, Arch
os_family: Debian, RedHat, Arch
version: 0.1.0
release: 1
minimum_version: 2019.2
Expand Down
8 changes: 8 additions & 0 deletions diaspora/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ diaspora_centos_enable_powertools_repo:
- pkg: diaspora_dependencies
{%- endif %}
{%- if grains.os_family == 'Arch' %}
diaspora_arch_install_devel_group:
pkg.group_installed:
- name: base-devel
- require_in:
- pkg: diaspora_dependencies
{%- endif %}
diaspora_dependencies:
pkg.installed:
- pkgs: {{ diaspora.dependencies|json }}
Expand Down
19 changes: 19 additions & 0 deletions diaspora/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,22 @@ RedHat:
environment:
certificate_authorities: /etc/pki/tls/certs/ca-bundle.crt
libjemalloc: /usr/lib64/libjemalloc.so.2

Arch:
dependencies:
- git
- imagemagick
- net-tools
- libidn
- libxslt
- gsfonts
- nodejs
- jemalloc
postgresql_package: postgresql-libs
mysql_package: libmariadbclient
redis_package: redis
redis_service: redis
configuration:
environment:
certificate_authorities: /etc/ssl/certs/ca-certificates.crt
libjemalloc: /usr/lib/libjemalloc.so.2
42 changes: 42 additions & 0 deletions test/integration/_mapdata/files/_mapdata/arch-base-latest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# yamllint disable rule:indentation rule:line-length
# Arch
---
configuration:
environment:
certificate_authorities: /etc/ssl/certs/ca-certificates.crt
url: https://example.org/
server:
listen: 127.0.0.1:3000
rails_environment: production
settings:
pod_name: example diaspora* pod
database:
database: diaspora
host: localhost
password: secret
type: postgresql
username: diaspora
dependencies:
- git
- imagemagick
- net-tools
- libidn
- libxslt
- gsfonts
- nodejs
- jemalloc
install_path: /srv/diaspora
install_redis: true
libjemalloc: /usr/lib/libjemalloc.so.2
mysql_package: libmariadbclient
postgresql_package: postgresql-libs
redis_package: redis
redis_service: redis
repository: https://github.com/diaspora/diaspora.git
ruby_version: 2.6.6
systemd:
web_template: salt://diaspora/files/diaspora-web.service
user:
shell: /bin/bash
username: diaspora
version: develop
1 change: 1 addition & 0 deletions test/integration/_mapdata/inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ supports:
- platform-name: debian
- platform-name: ubuntu
- platform-name: centos
- platform-name: arch
2 changes: 1 addition & 1 deletion test/integration/default/controls/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

ca_file =
case platform[:family]
when 'debian'
when 'debian', 'arch'
'/etc/ssl/certs/ca-certificates.crt'
when 'redhat'
'/etc/pki/tls/certs/ca-bundle.crt'
Expand Down
1 change: 1 addition & 0 deletions test/integration/default/inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ supports:
- platform-name: debian
- platform-name: ubuntu
- platform-name: centos
- platform-name: arch
12 changes: 11 additions & 1 deletion test/salt/states/postgres/init.sls
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{% set pkg = salt['grains.filter_by']({
'Debian': 'postgresql',
'RedHat': 'postgresql-server',
'Arch': 'postgresql',
}) -%}

pgsql_package:
pkg.installed:
- name: {{ pkg }}

{%- if grains.os_family == 'RedHat' %}
pgsql_initdb:
pgsql_initdb_redhat:
cmd.run:
- name: postgresql-setup initdb
- require:
Expand All @@ -22,6 +23,15 @@ pgsql_pg_hba_redhat:
- cmd: pgsql_initdb_redhat
- require_in:
- service: pgsql_service
{%- elif grains.os_family == 'Arch' %}
pgsql_initdb_arch:
cmd.run:
- name: initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'
- runas: postgres
- require:
- pkg: pgsql_package
- require_in:
- service: pgsql_service
{%- endif %}

pgsql_service:
Expand Down
2 changes: 1 addition & 1 deletion test/salt/states/redis/init.sls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- if grains.osfinger == 'Ubuntu-18.04' %}
{%- if grains.get('osfinger', grains.os) == 'Ubuntu-18.04' %}
redis_config:
file.replace:
- name: '/etc/redis/redis.conf'
Expand Down

0 comments on commit 7571d3d

Please sign in to comment.