• salt总结


    安装jdk

    jdk:
      file.managed:
       - source: salt://service/zabbix/files/jdk1.8.0_121.tar.gz
       - name: /usr/local/jdk1.8.0_121.tar.gz
       - mode: 644
       - uid: root
       - gid: root
    
    jdk_install:
      cmd.run:
        - name: cd /usr/local && tar xf jdk1.8.0_121.tar.gz
    
    
    /etc/profile:
      file.append:
       - name: /etc/profile
       - text:
           - export JAVA_HOME=/usr/local/jdk1.8.0_121
           - export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
           - export PATH=$PATH:$JAVA_HOME/bin

     编译安装nginx

    nginx-install.sls

    include:
      - service.nginx.nginx-pre
    
    nginx:
      user.present:
        - shell: /sbin/nologin
        - gid_from_name: True
        - createhome: false
    
    nginx-source-install:
      file.managed:
       - name: /tmp/nginx-1.10.3.tar.gz
       - source: salt://service/nginx/files/nginx-1.10.3.tar.gz
      cmd.run:
       - name: cd /tmp && tar xf nginx-1.10.3.tar.gz && cd nginx-1.10.3 && ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --with-cc-opt=-O3 --with-stream && make && make install
       - unless: test -d /tmp/nginx-1.10.3.tar.gz
       - creates: /usr/local/nginx
    
    nginx-conf-file:
      file.managed:
        - name: /usr/local/nginx/conf/nginx.conf
        - source: salt://service/nginx/files/nginx.conf
        - mode: 644
        - template: jinja
        - defaults:
          num_cpus: {{ grains['num_cpus'] }}
    ~                                                   

     nginx-pre.sls

    pkg-init:
      pkg.installed:
        - pkgs:
          - gcc
          - gcc-c++
          - zlib-devel
          - openssl-devel
          - openssl
          - pcre-devel
          - pcre

     tomcat8-sls

    tomcat-install:
      file.managed:
        - name: /tmp/apache-tomcat-8.5.29.tar.gz
        - source: salt://tomcat/files/apache-tomcat-8.5.29.tar.gz
        - user: root
        - group: root
        - mod: 755
      cmd.run:
        - name: tar -xf /tmp/apache-tomcat-8.5.29.tar.gz && mv apache-tomcat-8.5.29 /usr/local/tomcat
        - unless: test -d /usr/local/tomcat
        - require:
          - file: tomcat-install
    
    tomcat-config:
      file.managed:
        - name: /usr/local/tomcat/conf/server.xml
        - source: salt://tomcat/files/server.xml
        - user: root
        - group: root
        - mode: 644
        - template: jinja
        - defaults:
          IPADDR: {{ grains [ 'fqdn_ip4'][0] }}  
  • 相关阅读:
    14.UA池和代理池
    13.scrapy框架的日志等级和请求传参
    12.scrapy框架之递归解析和post请求
    11.scrapy框架持久化存储
    10.scrapy框架简介和基础应用
    09.移动端数据爬取
    08.Python网络爬虫之图片懒加载技术、selenium和PhantomJS
    07.验证码处理
    vi编辑器
    tar 压缩命令
  • 原文地址:https://www.cnblogs.com/uglyliu/p/8651902.html
Copyright © 2020-2023  润新知