Install rmt: pkg.installed: - name: rmt-server include: - rmt.certs Create rmt MariaDB user: mysql.user: - name: rmt - host: localhost - password: {{ pillar['rmt']['db_password'] }} Create rmt database: mysql.database: - name: rmt - users: - "'rmt'@'localhost'" Create rmt.conf: file.managed: - name: /etc/rmt.conf - source: salt://rmt/files/rmt.conf.jinja - template: jinja - user: _rmt - group: root - mode: "0640" Start rmt-server: service.running: - name: rmt-server - enable: True - watch: - file: Create rmt.conf {% for service in pillar['rmt']['stopped_services'] -%} Stopp {{ service }}: service.dead: - name: {{ service }} - enable: False {% endfor %} Remove rmt http as default site: file.replace: - name: /etc/nginx/vhosts.d/rmt-server-http.conf - pattern: " listen 80 default;" - repl: " listen 80;" Set fqdn for rmt https: file.replace: - name: /etc/nginx/vhosts.d/rmt-server-https.conf - pattern: " server_name rmt;" - repl: " server_name rmt.{{ pillar['network']['domain'] }};" Set fqdn for rmt http: file.replace: - name: /etc/nginx/vhosts.d/rmt-server-http.conf - pattern: " server_name rmt;" - repl: " server_name rmt.{{ pillar['network']['domain'] }};" Restart nginx: service.running: - name: nginx - enable: Trie - watch: - file: Remove rmt http as default site - file: Set fqdn for rmt https - file: Set fqdn for rmt http