SlideShare uma empresa Scribd logo
1 de 31
__________________
< 怎麼無痛升級 Ansible >
------------------

 __ _/_/
 __/
(oo)_______
(__) )/
||----w |
|| ||
[ chusiang@AnsibleTaiwanUserGroup ~ ]
$ cat .profile
# Author: 凍仁翔 / chusiang@drx.tw
# Blog: https://note.drx.tw
# Modified: 2018-04-27 14:00
關於我
• 凍仁翔 (@chusiang_lai)。
• 「凍仁的筆記」部落落客。
• DevOps Taiwan 志⼯工。
• 6 年年 IT 維運經驗。
2
使⽤用者故事
⾝身為 Ansible Playbooks 的開發者,

我希望 Playbooks 可以⽀支援最新的
Ansible,因為我想在開發、測試和

正式環境上,無痛使⽤用最新版的

Ansible 2.5.0。
!3
使⽤用者故事
⾝身為 Ansible Playbooks 的開發者,

我希望 Playbooks 可以⽀支援最新的
Ansible,因為我想在開發、測試和

正式環境上,無痛使⽤用最新版的

Ansible 2.5.0。
!4
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
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
https://hub.docker.com/r/chusiang/ansible/
7
https://galaxy.ansible.com/chusiang/php7/
https://travis-ci.org/chusiang/php7.ansible.role
9
Ansible 2.4.3
Ansible 2.5.0
$ 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
12
Version
13
Syntax Check
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
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
Syntax Check
Version
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
$ git diff
- - docker run -it chusiang/ansible:2.4
+ - docker run -it chusiang/ansible:2.5
18
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
$ ansible ansible-server 
-i stage 
-i production 
-m apt
-a “name=ansible state=latest update_cache: yes”
--become
20
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
今天提的 DevOps 是什什麼?
嚴禁拍打餵食
Q & A
!23
DevOps Taiwan
https://t.me/devopstw
https://fb.me/groups/DevOpsTaiwan/
https://devopstw.club/
!24
Ansible Taiwan
https://t.me/ansible_tw
https://github.com/ansible-tw
http://ansible.tw
!25
http://萍⽔水相逢.tw
!26
_______
< Pause >
-------

 __ _/_/
 __/
(oo)_______
(__) )/
||----w |
|| ||
https://github.com/willthames/ansible-lint
Link
Check
Build
Syntax
Check
_____
< END >
-----

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

Mais conteúdo relacionado

Mais de Chu-Siang Lai

Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)Chu-Siang Lai
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Chu-Siang Lai
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)Chu-Siang Lai
 
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIContinuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIChu-Siang Lai
 
Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Chu-Siang Lai
 
Continuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIContinuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIChu-Siang Lai
 
Automate with Ansible basic (3/e)
Automate with Ansible basic (3/e)Automate with Ansible basic (3/e)
Automate with Ansible basic (3/e)Chu-Siang Lai
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Chu-Siang Lai
 
Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)Chu-Siang Lai
 
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & WindowsChu-Siang Lai
 
前端工程師一定要知道的 Docker 虛擬化容器技巧
前端工程師一定要知道的 Docker 虛擬化容器技巧前端工程師一定要知道的 Docker 虛擬化容器技巧
前端工程師一定要知道的 Docker 虛擬化容器技巧Chu-Siang Lai
 
現代 IT 人一定要知道的 Ansible 自動化組態技巧
現代 IT 人一定要知道的 Ansible 自動化組態技巧現代 IT 人一定要知道的 Ansible 自動化組態技巧
現代 IT 人一定要知道的 Ansible 自動化組態技巧Chu-Siang Lai
 
Git and Github basic with SourceTree
Git and Github basic with SourceTreeGit and Github basic with SourceTree
Git and Github basic with SourceTreeChu-Siang Lai
 
使用 Multi-sites 技術快速建置多 Drupal 網站
使用 Multi-sites 技術快速建置多 Drupal 網站使用 Multi-sites 技術快速建置多 Drupal 網站
使用 Multi-sites 技術快速建置多 Drupal 網站Chu-Siang Lai
 
歡迎來到 Ubuntu 9.10 Release Party (台中)
歡迎來到 Ubuntu 9.10 Release Party (台中)歡迎來到 Ubuntu 9.10 Release Party (台中)
歡迎來到 Ubuntu 9.10 Release Party (台中)Chu-Siang Lai
 
無痛入門 Chromecast
無痛入門 Chromecast無痛入門 Chromecast
無痛入門 ChromecastChu-Siang Lai
 
Ubuntu 藍星侵略計劃
Ubuntu 藍星侵略計劃Ubuntu 藍星侵略計劃
Ubuntu 藍星侵略計劃Chu-Siang Lai
 
Intro of Network, WiFi on Ubuntu
Intro of Network, WiFi on UbuntuIntro of Network, WiFi on Ubuntu
Intro of Network, WiFi on UbuntuChu-Siang Lai
 

Mais de Chu-Siang Lai (20)

Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
Continuous Delivery Workshop with Ansible x GitLab CI (3rd)
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd)
 
Continuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CIContinuous Delivery Workshop with Ansible x GitLab CI
Continuous Delivery Workshop with Ansible x GitLab CI
 
Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)Continuous Delivery with Ansible x GitLab CI (2e)
Continuous Delivery with Ansible x GitLab CI (2e)
 
Continuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CIContinuous Delivery with Ansible x GitLab CI
Continuous Delivery with Ansible x GitLab CI
 
Automate with Ansible basic (3/e)
Automate with Ansible basic (3/e)Automate with Ansible basic (3/e)
Automate with Ansible basic (3/e)
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)
 
Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)
 
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
現代 IT 人一定要知道的 Ansible 自動化組態技巧 Ⅱ - Roles & Windows
 
前端工程師一定要知道的 Docker 虛擬化容器技巧
前端工程師一定要知道的 Docker 虛擬化容器技巧前端工程師一定要知道的 Docker 虛擬化容器技巧
前端工程師一定要知道的 Docker 虛擬化容器技巧
 
現代 IT 人一定要知道的 Ansible 自動化組態技巧
現代 IT 人一定要知道的 Ansible 自動化組態技巧現代 IT 人一定要知道的 Ansible 自動化組態技巧
現代 IT 人一定要知道的 Ansible 自動化組態技巧
 
Git and Github basic with SourceTree
Git and Github basic with SourceTreeGit and Github basic with SourceTree
Git and Github basic with SourceTree
 
helloTux 2012
helloTux 2012helloTux 2012
helloTux 2012
 
Unity & Googlizer
Unity & GooglizerUnity & Googlizer
Unity & Googlizer
 
使用 Multi-sites 技術快速建置多 Drupal 網站
使用 Multi-sites 技術快速建置多 Drupal 網站使用 Multi-sites 技術快速建置多 Drupal 網站
使用 Multi-sites 技術快速建置多 Drupal 網站
 
歡迎來到 Ubuntu 9.10 Release Party (台中)
歡迎來到 Ubuntu 9.10 Release Party (台中)歡迎來到 Ubuntu 9.10 Release Party (台中)
歡迎來到 Ubuntu 9.10 Release Party (台中)
 
無痛入門 Chromecast
無痛入門 Chromecast無痛入門 Chromecast
無痛入門 Chromecast
 
Ubuntu 藍星侵略計劃
Ubuntu 藍星侵略計劃Ubuntu 藍星侵略計劃
Ubuntu 藍星侵略計劃
 
Intro of Network, WiFi on Ubuntu
Intro of Network, WiFi on UbuntuIntro of Network, WiFi on Ubuntu
Intro of Network, WiFi on Ubuntu
 

Último

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Último (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

How to stable upgrade the Ansible