Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to stable upgrade the Ansible

How to stable upgrade the Ansible

# 怎麼無痛升級 Ansible
 
Ansible 是套很棒的組態設定工具,但在它成長迅速的同時,也代表著使用者得一同成長。這次凍仁將分享一路從 Ansible 2.0 升級到 2.5 的小小使用心得。
 
* 活動網址:https://devops.kktix.cc/events/meetup13-0428
 
#Ansible #TravisCI #DevOps

Chu-Siang Lai

April 28, 2018
Tweet

More Decks by Chu-Siang Lai

Other Decks in Technology

Transcript

  1. __________________ < 怎麼無痛升級 Ansible > ------------------ \ \ \_\_ _/_/

    \ \__/ (oo)\_______ (__)\ )\/\ ||----w | || || [ chusiang@AnsibleTaiwanUserGroup ~ ] $ cat .profile # Author: 凍仁翔 / [email protected] # Blog: https://note.drx.tw # Modified: 2018-04-27 14:00
  2. Syntax Check with latest Ansible 1st Change Ansible Docker image

    on Pipeline 2nd Upgrade Ansible 2.5 on each Env. 3rd Upgrade to Ansible 2.5 !5 P R D D E V
  3. Syntax Check with latest Ansible 1st Change Ansible Docker image

    on Pipeline 2nd Upgrade Ansible 2.5 on each Env. 3rd Upgrade to Ansible 2.5 !6 D E V
  4. $ 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 Build Syntax Check
  5. 11

  6. 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 Build Syntax Check
  7. 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 Build Syntax Check
  8. Syntax Check with latest Ansible 1st Change Ansible Docker image

    on Pipeline 2nd Upgrade Ansible 2.5 on each Env. 3rd Upgrade to Ansible 2.5 !17 D E V
  9. $ git diff - - docker run -it chusiang/ansible:2.4 +

    - docker run -it chusiang/ansible:2.5 18
  10. Syntax Check with latest Ansible 1st Change Ansible Docker image

    on Pipeline 2nd Upgrade Ansible 2.5 on each Env. 3rd Upgrade to Ansible 2.5 !19 P R D
  11. $ ansible ansible-server \ -i stage \ -i production \

    -m apt -a “name=ansible state=latest update_cache: yes” --become 20
  12. Syntax Check with latest Ansible 1st Change Ansible Docker image

    on Pipeline 2nd Upgrade Ansible 2.5 on each Env. 3rd Upgrade to Ansible 2.5 !21 P R D D E V
  13. _______ < Pause > ------- \ \ \_\_ _/_/ \

    \__/ (oo)\_______ (__)\ )\/\ ||----w | || ||
  14. _____ < END > ----- \ \ \_\_ _/_/ \

    \__/ (oo)\_______ (__)\ )\/\ ||----w | || ||