SlideShare una empresa de 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 |
|| ||

Más contenido relacionado

Más 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
 

Más 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

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 

Último (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
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
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 

How to stable upgrade the Ansible