当前位置: 代码迷 >> 综合 >> salt 批量配置dotnet多版本
  详细解决方案

salt 批量配置dotnet多版本

热度:62   发布时间:2024-02-01 23:19:14.0

salt-master配置
more /etc/salt/master

default_include: master.d/*.conf
auto_accept: True
file_recv: True 
file_recv_max_size: 1000
state_output: terse
file_roots:base:- /databackup:- /data/backupdeploy:- /data/deploy
rest_cherrypy:port: 8082ssl_crt: /etc/pki/tls/certs/localhost.crtssl_key: /etc/pki/tls/private/localhost_nopass.key
external_auth:pam:saltapi:- .*- '@runner'- '@wheel'

more /data/scripts/dotnet/version.sh

#!/bin/bash
cd /usr/local/src
tar xf aspnetcore-runtime-3.1.4-linux-x64.tar.gzln -s /usr/local/src/shared/Microsoft.AspNetCore.App/3.1.4 /usr/share/dotnet/shared/Microsoft.AspNetCore.App/3.1.4 
ln -s /usr/local/src/shared/Microsoft.NETCore.App/3.1.4 /usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.4ln -s /usr/local/src/shared/Microsoft.AspNetCore.App/3.1.4 /opt/dotnet/dotnet/shared/Microsoft.AspNetCore.App/3.1.4
ln -s /usr/local/src/shared/Microsoft.NETCore.App/3.1.4 /opt/dotnet/dotnet/shared/Microsoft.NETCore.App/3.1.4

more /data/scripts/install_dotnet.sls

/usr/local/src/aspnetcore-runtime-3.1.4-linux-x64.tar.gz:file.managed:- source: salt://scripts/dotnet/aspnetcore-runtime-3.1.4-linux-x64.tar.gz
update_version:cmd.script:- source: salt://scripts/dotnet/version.sh

执行sls文件
salt "" state.sls scripts.install_dotnet
salt-master主配置文件
egrep -v "#|^$" /etc/salt/master
default_include: master.d/
.conf
auto_accept: True
file_recv: True
file_recv_max_size: 1000
state_output: terse
file_roots:
base:

  • /data
    backup:
  • /data/backup
    deploy:
  • /data/deploy
    rest_cherrypy:
    port: 8082
    ssl_crt: /etc/pki/tls/certs/localhost.crt
    ssl_key: /etc/pki/tls/private/localhost_nopass.key
    external_auth:
    pam:
    saltapi:
    • .*
    • '@runner'
    • '@wheel'
      auto_accept: True
      mysql.host: '10.10.180.225'
      mysql.user: 'root'
      mysql.pass: 'OaZnODg4bL'
      mysql.db: 'salt'
      mysql.port: 3306
      return: mysql
  相关解决方案