dir_home: file.directory: - name: /home/netcore dir_backup: file.directory: - name: /home/backup dir_progetti: file.directory: - name: /home/progetti dir_www: file.directory: - name: /var/www 'cd /home/netcore/ && rm -fr GWMS*': cmd.run 'cd /var/www/ && rm -fr publish*': cmd.run 'cd /home/netcore/ && wget --user=SWDownloader --password=viaD@nte16 "http://nexus.steamware.net/repository/SWS/GWMS/stable/LAST/GWMS.UI.zip"': cmd.run package_unzip: pkg: - installed - name: unzip - force_yes: True package_pythonMysql: pkg: - installed - name: python3-mysqldb - force_yes: True dir_app: file.directory: - name: /home/netcore/GWMS 'cd /home/netcore/ && /usr/bin/unzip GWMS.UI.zip -d GWMS': cmd.run 'cd /home/netcore/GWMS && find . -type d -name "publish" -exec cp -ra "{}" /var/www/ \;': cmd.run 'cd /var/www/ && cp -ra publish pizzaferri': cmd.run 'wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb': cmd.run 'dpkg -i packages-microsoft-prod.deb': cmd.run 'apt-get install apt-transport-https': cmd.run 'apt-get update': cmd.run 'apt-get install python3-software-properties': cmd.run package_mariadb: pkg: - installed - name: mariadb-server - force_yes: True mysql_user_root: mysql_user.present: - name: root - host: localhost - password: Egalware_24068! - connection_charset: utf8 mysql_user_steamware: mysql_user.present: - name: steamware - host: localhost - password: Egalware_24068! - connection_user: root - connection_pass: Egalware_24068! - connection_host: localhost - connection_unix_socket: /var/run/mysqld/mysqld.sock - connection_charset: utf8 mysql_user_egalware: mysql_user.present: - name: egalware - host: localhost - password: Egalware_24068! - connection_user: root - connection_pass: Egalware_24068! - connection_host: localhost - connection_unix_socket: /var/run/mysqld/mysqld.sock - connection_charset: utf8 /etc/mysql/mariadb.conf.d/50-server.cnf: file.managed: - source: salt://netcore/paterno/50-server.cnf - makedirs: true mysql_set_perm: mysql_query.run: - database: mysql - connection_user: root - connection_pass: Egalware_24068! - connection_host: localhost - query: | FLUSH PRIVILEGES; GRANT ALL ON *.* TO 'root'@'%' identified by 'Egalware_24068!'; mysql_set_perm_egal: mysql_query.run: - database: mysql - connection_user: root - connection_pass: Egalware_24068! - connection_host: localhost - query: | FLUSH PRIVILEGES; GRANT ALL ON *.* TO 'egalware'@'%' identified by 'Egalware_24068!'; package_redis: pkg: - installed - name: redis - force_yes: True package_nginx: pkg: - installed - name: nginx - force_yes: True package_samba: pkg: - installed - name: samba - force_yes: True 'groupadd --system smbgroup': cmd.run 'useradd --system --no-create-home --group smbgroup -s /bin/false smbuser': cmd.run 'chown -R smbuser:smbgroup /home/progetti': cmd.run 'chmod -R g+w /home/progetti': cmd.run 'chown -R smbuser:smbgroup /home/backup': cmd.run 'chmod -R g+w /home/backup': cmd.run egalware: user.present: - fullname: Utente Egalware - shell: /bin/bash - home: /home/egalware - password: 'Egalware_2022!' - groups: - smbgroup steamware: user.present: - fullname: Utente Steamware - shell: /bin/bash - home: /home/steamware - password: 'Egalware_2022!' - groups: - smbgroup 'printf "steamware\nsteamware\n" | smbpasswd -a -s steamware': cmd.run package_netcore: pkg: - installed - name: dotnet-sdk-6.0 - force_yes: True /etc/nginx/sites-available/default: file.managed: - source: salt://netcore/paterno/default - makedirs: true /etc/samba/smb.conf: file.managed: - source: salt://netcore/paterno/smb.conf - makedirs: true /etc/nginx/nginx.conf: file.managed: - source: salt://netcore/paterno/nginx.conf - makedirs: true 'systemctl restart nginx.service': cmd.run 'reboot': cmd.run