Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How to stable upgrade the Ansible

442 views

Published on

# 怎麼無痛升級 Ansible

> Mirror from https://speakerdeck.com/chusiang/how-to-easy-upgrade-the-ansible

Ansible 是套很棒的組態設定工具,但在它成長迅速的同時,也代表著使用者得一同成長。這次凍仁將分享一路從 Ansible 2.0 升級到 2.5 的小小使用心得。

* 活動網址:https://devops.kktix.cc/events/meetup13-0428

#Ansible #TravisCI #DevOps

Published in: Technology
  • Be the first to comment

How to stable upgrade the Ansible

  1. 1. __________________ < 怎麼無痛升級 Ansible > ------------------ __ _/_/ __/ (oo)_______ (__) )/ ||----w | || || [ chusiang@AnsibleTaiwanUserGroup ~ ] $ cat .profile # Author: 凍仁翔 / chusiang@drx.tw # Blog: https://note.drx.tw # Modified: 2018-04-27 14:00
  2. 2. 關於我 • 凍仁翔 (@chusiang_lai)。 • 「凍仁的筆記」部落落客。 • DevOps Taiwan 志⼯工。 • 6 年年 IT 維運經驗。 2
  3. 3. 使⽤用者故事 ⾝身為 Ansible Playbooks 的開發者,
 我希望 Playbooks 可以⽀支援最新的 Ansible,因為我想在開發、測試和
 正式環境上,無痛使⽤用最新版的
 Ansible 2.5.0。 !3
  4. 4. 使⽤用者故事 ⾝身為 Ansible Playbooks 的開發者,
 我希望 Playbooks 可以⽀支援最新的 Ansible,因為我想在開發、測試和
 正式環境上,無痛使⽤用最新版的
 Ansible 2.5.0。 !4
  5. 5. Syntax Check with latest Ansible 1st Change Ansible Docker image on Pipeline2nd Upgrade Ansible 2.5 on each Env.3rd Upgrade to Ansible 2.5 !5 P R D D E V
  6. 6. Syntax Check with latest Ansible 1st Change Ansible Docker image on Pipeline2nd Upgrade Ansible 2.5 on each Env.3rd Upgrade to Ansible 2.5 !6 D E V
  7. 7. https://hub.docker.com/r/chusiang/ansible/ 7
  8. 8. https://galaxy.ansible.com/chusiang/php7/
  9. 9. https://travis-ci.org/chusiang/php7.ansible.role 9 Ansible 2.4.3 Ansible 2.5.0
  10. 10. $ vim .travis.yml 1 language: bash 2 sudo: required 3 services: 4 - docker 5 6 jobs: 7 include: 8 - stage: Syntax check 9 script: 10 - echo "==> Syntax Check on Ansible 2.4 ..." 11 12 - docker run -it chusiang/ansible:2.4 13 ansible --version 14 15 - docker run -it -v $PWD:/srv chusiang/ansible:2.4 16 /bin/sh -c "cd /srv && ansible-playbook —syntax-check
 setup.yml" 17 10 Link Check BuildSyntax Check
  11. 11. 11
  12. 12. 12 Version
  13. 13. 13 Syntax Check
  14. 14. 18 19 - stage: Syntax check 20 script: 21 - echo "==> Syntax Check on Ansible 2.5 ..." 22 23 - docker run -it chusiang/ansible:2.5 24 ansible --version 25 26 - docker run -it -v $PWD:/srv chusiang/ansible:2.5 27 /bin/sh -c "cd /srv && ansible-playbook —syntax-check
 setup.yml" 28 14 Link Check BuildSyntax Check
  15. 15. 18 19 - stage: Syntax check 20 script: 21 - echo "==> Syntax Check on Ansible 2.5 ..." 22 23 - docker run -it chusiang/ansible:2.5 24 ansible --version 25 26 - docker run -it -v $PWD:/srv chusiang/ansible:2.5 27 /bin/sh -c "cd /srv && ansible-playbook —syntax-check
 setup.yml" 28 15 Link Check BuildSyntax Check
  16. 16. 16 Syntax Check Version
  17. 17. Syntax Check with latest Ansible 1st Change Ansible Docker image on Pipeline2nd Upgrade Ansible 2.5 on each Env.3rd Upgrade to Ansible 2.5 !17 D E V
  18. 18. $ git diff - - docker run -it chusiang/ansible:2.4 + - docker run -it chusiang/ansible:2.5 18
  19. 19. Syntax Check with latest Ansible 1st Change Ansible Docker image on Pipeline2nd Upgrade Ansible 2.5 on each Env.3rd Upgrade to Ansible 2.5 !19 P R D
  20. 20. $ ansible ansible-server -i stage -i production -m apt -a “name=ansible state=latest update_cache: yes” --become 20
  21. 21. Syntax Check with latest Ansible 1st Change Ansible Docker image on Pipeline2nd Upgrade Ansible 2.5 on each Env.3rd Upgrade to Ansible 2.5 !21 P R D D E V
  22. 22. 22 今天提的 DevOps 是什什麼?
  23. 23. 嚴禁拍打餵食 Q & A !23
  24. 24. DevOps Taiwan https://t.me/devopstw https://fb.me/groups/DevOpsTaiwan/ https://devopstw.club/ !24
  25. 25. Ansible Taiwan https://t.me/ansible_tw https://github.com/ansible-tw http://ansible.tw !25
  26. 26. http://萍⽔水相逢.tw !26
  27. 27. _______ < Pause > ------- __ _/_/ __/ (oo)_______ (__) )/ ||----w | || ||
  28. 28. https://github.com/willthames/ansible-lint
  29. 29. Link Check Build Syntax Check
  30. 30. _____ < END > ----- __ _/_/ __/ (oo)_______ (__) )/ ||----w | || ||

×