Coder Social home page Coder Social logo

ansible-workshop's Introduction

打怪升级任务

  1. 执行 ansible-playbook -i hosts playbook.yml 成功
  2. 创建用户 apps 及用户组 apps:
  3. 创建以下文件夹,并设置文件夹的用户和组为 apps: /apps,/apps/hello,/apps/hello/bin,/apps/hello/logs
  4. 将 helloworld-0.0.2.jar copy 到 /apps/hello/bin 目录下,设置该 jar 文件的用户和用户组为 apps
  5. 使用 template 模块将 app.service copy 到目标服务器的 /etc/systemd/system 中,并重命名 hello.service :
  6. 启动 hello 服务
  7. 监听 hello 服务是否启动成功
  8. 为目标机器安装 JDK 1.8:
    1. 在本地仓库中创建 roles 目录
    2. clone 代码:https://github.com/geerlingguy/ansible-role-java 到 roles 目录中
    3. 在 playbook.yml 文件中加入 ansible-role-java 的role
  9. 创建自定义 role: hello role
    1. 进入 roles 目录:cd roles
    2. 使用命令生成 role 模板:ansible-galaxy init hello
    3. 将 hello 的部署逻辑(在 playbook.yml 中)写入到 hello role 中
  10. 将 hello 部署到多台机器
    • 需要修改 hosts 文件
  11. 多环境部署

ansible-workshop's People

Contributors

zacker330 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.