Salt with nginx php-fpm and ufw

Installing salt-master on ubuntu 18.04

so install salt-master using

sudo apt install salt-master

Installing salt-minion on ubuntu 18.04

to install salt-minion run

sudo apt install salt-minion

Configuring salt minion

configure salt minion to connect to the master

sudoedit /etc/salt/minion

/etc/salt/minion

  master:192.168.8.10x
  id:your_id  

restart the minion

sudo systemctl restart salt-minion.service

accept the key from the master

 sudo salt-key -A

Now try it out

  sudo salt '*' cmd.run 'whoami'

Configuring firewall

sudoedit /srv/salt/firewall.sls

firewall.sls

sudoedit /srv/salt/firewall/user.rules

user.rules

sudoedit /srv/salt/firewall/user6.rules

user6.rules

to enable firewall on minions

sudo salt '*' state.highstate

Server info using grains

sudo salt '*' grains.items

serverinfo.txt

installing nginx with php-fpm using salt

nginx configuration

listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {

include snippets/fastcgi-php.conf;

fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}

salt configuration
init.sls
top.sls
index.php

<?php

phpinfo();

final result
phpinfo

references

  1. http://terokarvinen.com/2018/aikataulu-%E2%80%93-palvelinten-hallinta-ict4tn022-3004-ti-ja-3002-to-%E2%80%93-loppukevat-2018-5p
  2. https://github.com/joonaleppalahti/CCM/tree/master/salt/srv/salt
  3. https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04
  4. https://github.com/obb12/vbox-server

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.