commit 65c2b869f507e27f99ef9ec595f3124b75f9c055 Author: Jakub Filo Date: Tue May 23 18:38:39 2023 +0000 My very first Salt states :) diff --git a/salt/srv/pillar/base/motd/init.sls b/salt/srv/pillar/base/motd/init.sls new file mode 100644 index 0000000..a922aaf --- /dev/null +++ b/salt/srv/pillar/base/motd/init.sls @@ -0,0 +1 @@ +env-name: base diff --git a/salt/srv/pillar/base/top.sls b/salt/srv/pillar/base/top.sls new file mode 100644 index 0000000..1b718ba --- /dev/null +++ b/salt/srv/pillar/base/top.sls @@ -0,0 +1,7 @@ +base: + '*': + - motd + +prod: + '*': + - motd diff --git a/salt/srv/salt/base/docker/init.sls b/salt/srv/salt/base/docker/init.sls new file mode 100644 index 0000000..a9a604a --- /dev/null +++ b/salt/srv/salt/base/docker/init.sls @@ -0,0 +1,15 @@ +Install and start Docker: + pkg.installed: + - pkgs: + - docker.io + pip.installed: + - name: docker + service.running: + - name: docker + +{% for vhost,config in pillar["vhosts"].items() %} +Create docker network-{{ vhost }}: + docker_network.present: + - name: network-{{ vhost }} + - internal: False +{% endfor %} \ No newline at end of file diff --git a/salt/srv/salt/base/locale/init.sls b/salt/srv/salt/base/locale/init.sls new file mode 100644 index 0000000..7d8cd1a --- /dev/null +++ b/salt/srv/salt/base/locale/init.sls @@ -0,0 +1,8 @@ +/etc/default/locale: # May be absent + file.managed # so create it if any + +en_US.UTF-8: + locale.present + +C.UTF-8: + locale.system diff --git a/salt/srv/salt/base/top.sls b/salt/srv/salt/base/top.sls new file mode 100644 index 0000000..a35b257 --- /dev/null +++ b/salt/srv/salt/base/top.sls @@ -0,0 +1,14 @@ +base: + '*': + - util + - locale + +prod: + '*': + - docker + - mariadb + - elasticsearch + - php-fpm-docker + - magento + - nginx-docker + - memcached-docker diff --git a/salt/srv/salt/base/util/init.sls b/salt/srv/salt/base/util/init.sls new file mode 100644 index 0000000..48cb211 --- /dev/null +++ b/salt/srv/salt/base/util/init.sls @@ -0,0 +1,7 @@ +util: + pkg.installed: + - pkgs: + - vim + - curl + - wget + - htop