ansible-playbook(合集)

一、openssl升级更新

#download for package: https://www.openssl.org/source/old/1.0.2/openssl-1.0.2t.tar.gz
- name: update openssl
  hosts: xxx
  gather_facts: false
  remote_user: root
  roles:
    - openssl
  tasks:
    - name: copy package
      copy: src=openssl-1.0.2t.tar.gz dest=/usr/software/openssl-1.0.2t.tar.gz
      tags: cppkg

    - name: tar openssl
      shell: cd /usr/software;tar -xf openssl-1.0.2t.tar.gz

    - name: install openssl
      shell: cd /usr/software/openssl-1.0.2t;./config;make;make install

    - name: change
      shell: mv /usr/bin/openssl /tmp/openssl.old;ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

    - name: version
      shell: openssl version
      register: openssl_version

    - name: show
      debug: var=openssl_version verbosity=0

  

二、

posted @ 2020-09-07 09:46  suminem  阅读(244)  评论(0编辑  收藏  举报