SlideShare une entreprise Scribd logo
1  sur  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 |
|| ||

Contenu connexe

Plus 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
 

Plus 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
 

Dernier

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
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
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
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Dernier (20)

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
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
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
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
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!
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

How to stable upgrade the Ansible