• 制作zabbix和memcache的yml文本源代码


    [root@localhost roles]# vim zabbix/tasks/zabbix.yml
    - name: add user
      user: name=zabbix state=present
    - name: an yi lai bao
      yum: name=net-snmp,net-snmp-devel,curl-devel,java-1.8.0-openjdk,java-1.8.0-openjdk-devel,OpenIPMI-devel,mysql state=present 
    - name: chuan bao
      copy: src=/root/zabbix-3.2.1.tar.gz dest=/root
    - name: jie bao
      shell: tar zxf zabbix-3.2.1.tar.gz
    - name: pei zhi
      shell: chdir=/root/zabbix-3.2.1 ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --enable-java  --with-net-snmp --with-mysql=/usr/bin/mysql_config --with-libcurl --with-openipmi
    - name: bian yi 
      shell: chdir=/root/zabbix-3.2.1 make && make install
    - name: ruan lian jie
      shell: ln -s /usr/local/zabbix/bin/* /usr/local/bin/
    - shell: ln -s /usr/local/zabbix/sbin/* /usr/local/sbin/
    - name: fuzhi qi dong wenjian
      copy: src=/root/ld.so.conf dest=/etc
    - shell: ldconfig
    - name: ba gai hao de peizhifile gei 1.20
      copy: src=/root/zabbix_server.conf dest=/usr/local/zabbix/etc/
    - include: /etc/ansible/roles/zabbix/tasks/db.yml
    - name: ba an zhuang ye mian gei nginx htmlxia
      shell: chdir=/root/zabbix-3.2.1 cp -r frontends/php/ /usr/local/nginx/html/zabbix
    - name: gei quan xian
      shell: chmod 777 /usr/local/nginx/html/zabbix
    - name: qi dong
      shell: /usr/local/zabbix/sbin/zabbix_server -c /usr/local/zabbix/etc/zabbix_server.conf
    
    
    
    [root@localhost roles]# vim zabbix_agent/tasks/agent.yml
    - name: ba bao chuan guoqu
      copy: src=/root/zabbix-3.2.1.tar.gz dest=/root
    - name: jie bao
      shell: tar -zxf zabbix-3.2.1.tar.gz
    - name: bianyi 
      shell: chdir=/root/zabbix-3.2.1 ./configure --prefix=/usr/local/zabbix --enable-agent && make && make install
    - name: tian jia fu wu 
      shell: chdir=/root/zabbix-3.2.1 cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d
    - name: jia jue se
      user: name=zabbix state=present
    - name: kai ji zi qi 
      shell: chkconfig --add zabbix_agentd
    - shell: chkconfig zabbix_agentd on
    - name: xiu gai  qi dong dizhi
      shell: sed -i -e 's/BASEDIR=/usr/local/BASEDIR=/usr/local/zabbix/g' /etc/init.d/zabbix_agentd
    - shell: systemctl daemon-reload
    - name: wo men she zhi yi xia agent de pei zhi file
      template: src=zabbix_agentd.conf.j2 dest=/usr/local/zabbix/etc/zabbix_agentd.conf
    - name: kai fu wu
      shell: /etc/init.d/zabbix_agentd start
    - name: kai fang huo qiang
      shell: firewall-cmd --add-port=10050/tcp --permanent
    - shell: firewall-cmd --reload
    
    
    [root@localhost roles]# vim memcache/tasks/me.yml
    - name: chuan bao
      copy: src=/root/libevent-2.0.22-stable.tar.gz dest=/root
    - name: jie bao
      shell: tar zxf libevent-2.0.22-stable.tar.gz
    - name: bian yi an zhuang
      shell: chdir=/root/libevent-2.0.22-stable ./configure && make && make install
    - name: chuan memcached
      copy: src=/root/memcached-1.4.33.tar.gz dest=/root
    - name: jie bao
      shell: tar zxf memcached-1.4.33.tar.gz
    - name: pei zhi an zhuang
      shell: chdir=/root/memcached-1.4.33 ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local && make && make install
    - name: kai fu wu
      shell: /usr/local/memcached/bin/memcached -d -m 2048 -l 192.168.1.30 -p 11211 -u root -c 10240 -P /usr/local/memcached/memcached.pid
  • 相关阅读:
    [改善Java代码]使用构造块精炼程序
    [改善Java代码]若有必要,使用变长数组
    [改善Java代码]警惕数组的浅拷贝
    [改善Java代码]在明确的场景下,为集合指定初始容量
    [改善Java代码] 枚举项数量限定为64个以内
    [改善Java代码]多种最值算法,适时选择
    [改善Java代码]推荐使用枚举定义常量
    [改善Java代码]性能考虑,数组是首选
    [改善Java代码]用偶判断,不用奇判断
    [改善Java代码]break万万不可忘
  • 原文地址:https://www.cnblogs.com/mayaohui/p/11372644.html
Copyright © 2020-2023  润新知