Submit Search
Upload
20181210_Ansibleもくもく会_成果LT
•
2 likes
•
1,589 views
Takahiro Kujirai
Follow
20181210_Ansibleもくもく会_成果LT
Read less
Read more
Internet
Report
Share
Report
Share
1 of 19
Download now
Download to read offline
Recommended
Hyperscale SIG update
Hyperscale SIG update
Davide Cavalca
Piwik elasticsearch kibana at OSC Tokyo 2016 Spring
Piwik elasticsearch kibana at OSC Tokyo 2016 Spring
Takashi Yamamoto
Running CentOS on the Facebook fleet
Running CentOS on the Facebook fleet
Davide Cavalca
Hyperscale SIG update
Hyperscale SIG update
Davide Cavalca
DevStack
DevStack
維泰 蔡
Building a Django App on Heroku
Building a Django App on Heroku
Joe Fusaro
How Openstack is Built
How Openstack is Built
Anton Weiss
Nagios intro
Nagios intro
Hsi-Kai Wang
Recommended
Hyperscale SIG update
Hyperscale SIG update
Davide Cavalca
Piwik elasticsearch kibana at OSC Tokyo 2016 Spring
Piwik elasticsearch kibana at OSC Tokyo 2016 Spring
Takashi Yamamoto
Running CentOS on the Facebook fleet
Running CentOS on the Facebook fleet
Davide Cavalca
Hyperscale SIG update
Hyperscale SIG update
Davide Cavalca
DevStack
DevStack
維泰 蔡
Building a Django App on Heroku
Building a Django App on Heroku
Joe Fusaro
How Openstack is Built
How Openstack is Built
Anton Weiss
Nagios intro
Nagios intro
Hsi-Kai Wang
Cloud foundry on kubernetes
Cloud foundry on kubernetes
상준 윤
Deep dive networking
Deep dive networking
Victor Morales
せめてログサーバの稟議を通す方法
せめてログサーバの稟議を通す方法
歩 奥山
Cloud-Native Sling
Cloud-Native Sling
Robert Munteanu
OMD and Check_mk
OMD and Check_mk
Artur Martins
Everyone Loves a Sausage
Everyone Loves a Sausage
Nick Jones
Nginx3
Nginx3
kantohibi
Ansible intro
Ansible intro
Hsi-Kai Wang
Introduction to Git
Introduction to Git
John Ombagi
Secrets management vault cncf meetup
Secrets management vault cncf meetup
Juraj Hantak
How to Build a new under filesystem in Alluxio: Apache Ozone as an example
How to Build a new under filesystem in Alluxio: Apache Ozone as an example
Alluxio, Inc.
API Workloads on Kubernetes | Show Code Part 4
API Workloads on Kubernetes | Show Code Part 4
NGINX, Inc.
OpenStack Manila 紹介
OpenStack Manila 紹介
Takeshi Kuramochi
Virt monitoring
Virt monitoring
Amadou tidiane Diallo
systemd @ Facebook -- a year later
systemd @ Facebook -- a year later
Davide Cavalca
Ansible PyWAW
Ansible PyWAW
gnosek
Apache CloudStack Integration with HashiCorp Vault
Apache CloudStack Integration with HashiCorp Vault
CloudOps2005
Nginx
Nginx
Shaopeng He
Reference CNF development journey and outcomes
Reference CNF development journey and outcomes
Victor Morales
ブログ執筆を支える技術
ブログ執筆を支える技術
kazuki morita
论文答辩
论文答辩
wensheng wei
Heroku pycon
Heroku pycon
Sabatino Severino
More Related Content
What's hot
Cloud foundry on kubernetes
Cloud foundry on kubernetes
상준 윤
Deep dive networking
Deep dive networking
Victor Morales
せめてログサーバの稟議を通す方法
せめてログサーバの稟議を通す方法
歩 奥山
Cloud-Native Sling
Cloud-Native Sling
Robert Munteanu
OMD and Check_mk
OMD and Check_mk
Artur Martins
Everyone Loves a Sausage
Everyone Loves a Sausage
Nick Jones
Nginx3
Nginx3
kantohibi
Ansible intro
Ansible intro
Hsi-Kai Wang
Introduction to Git
Introduction to Git
John Ombagi
Secrets management vault cncf meetup
Secrets management vault cncf meetup
Juraj Hantak
How to Build a new under filesystem in Alluxio: Apache Ozone as an example
How to Build a new under filesystem in Alluxio: Apache Ozone as an example
Alluxio, Inc.
API Workloads on Kubernetes | Show Code Part 4
API Workloads on Kubernetes | Show Code Part 4
NGINX, Inc.
OpenStack Manila 紹介
OpenStack Manila 紹介
Takeshi Kuramochi
Virt monitoring
Virt monitoring
Amadou tidiane Diallo
systemd @ Facebook -- a year later
systemd @ Facebook -- a year later
Davide Cavalca
Ansible PyWAW
Ansible PyWAW
gnosek
Apache CloudStack Integration with HashiCorp Vault
Apache CloudStack Integration with HashiCorp Vault
CloudOps2005
Nginx
Nginx
Shaopeng He
Reference CNF development journey and outcomes
Reference CNF development journey and outcomes
Victor Morales
ブログ執筆を支える技術
ブログ執筆を支える技術
kazuki morita
What's hot
(20)
Cloud foundry on kubernetes
Cloud foundry on kubernetes
Deep dive networking
Deep dive networking
せめてログサーバの稟議を通す方法
せめてログサーバの稟議を通す方法
Cloud-Native Sling
Cloud-Native Sling
OMD and Check_mk
OMD and Check_mk
Everyone Loves a Sausage
Everyone Loves a Sausage
Nginx3
Nginx3
Ansible intro
Ansible intro
Introduction to Git
Introduction to Git
Secrets management vault cncf meetup
Secrets management vault cncf meetup
How to Build a new under filesystem in Alluxio: Apache Ozone as an example
How to Build a new under filesystem in Alluxio: Apache Ozone as an example
API Workloads on Kubernetes | Show Code Part 4
API Workloads on Kubernetes | Show Code Part 4
OpenStack Manila 紹介
OpenStack Manila 紹介
Virt monitoring
Virt monitoring
systemd @ Facebook -- a year later
systemd @ Facebook -- a year later
Ansible PyWAW
Ansible PyWAW
Apache CloudStack Integration with HashiCorp Vault
Apache CloudStack Integration with HashiCorp Vault
Nginx
Nginx
Reference CNF development journey and outcomes
Reference CNF development journey and outcomes
ブログ執筆を支える技術
ブログ執筆を支える技術
Similar to 20181210_Ansibleもくもく会_成果LT
论文答辩
论文答辩
wensheng wei
Heroku pycon
Heroku pycon
Sabatino Severino
Django deployment with PaaS
Django deployment with PaaS
Appsembler
Load Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS Cluster
Kevin Jones
Manoj Kolhe - Setup GitHub with Jenkins on Amazon Cloud - End-to-end Automation
Manoj Kolhe - Setup GitHub with Jenkins on Amazon Cloud - End-to-end Automation
Manoj Kolhe
Nginx+ Naxsi
Nginx+ Naxsi
3camp
Nuxeo Roadmap 2008/06
Nuxeo Roadmap 2008/06
Eric Barroca
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
Ortus Solutions, Corp
What’s new in cas 4.2
What’s new in cas 4.2
Misagh Moayyed
Lessons learned using GitOps
Lessons learned using GitOps
Edgaras Apšega
Nginx Essential
Nginx Essential
Gong Haibing
Improving Operations Efficiency with Puppet
Improving Operations Efficiency with Puppet
Nicolas Brousse
Open Sourcing NGINX Agent and Demo
Open Sourcing NGINX Agent and Demo
NGINX, Inc.
.NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se...
.NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se...
Maarten Balliauw
Neutron upgrades
Neutron upgrades
Victor Morales
vdocuments.site_nginx-essential.pdf
vdocuments.site_nginx-essential.pdf
crezzcrezz
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Igalia
NGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEA
NGINX, Inc.
Dokku
Dokku
Denys Kurets
Deploying nginx with minimal system resources
Deploying nginx with minimal system resources
Max Ukhanov
Similar to 20181210_Ansibleもくもく会_成果LT
(20)
论文答辩
论文答辩
Heroku pycon
Heroku pycon
Django deployment with PaaS
Django deployment with PaaS
Load Balancing Applications with NGINX in a CoreOS Cluster
Load Balancing Applications with NGINX in a CoreOS Cluster
Manoj Kolhe - Setup GitHub with Jenkins on Amazon Cloud - End-to-end Automation
Manoj Kolhe - Setup GitHub with Jenkins on Amazon Cloud - End-to-end Automation
Nginx+ Naxsi
Nginx+ Naxsi
Nuxeo Roadmap 2008/06
Nuxeo Roadmap 2008/06
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
What’s new in cas 4.2
What’s new in cas 4.2
Lessons learned using GitOps
Lessons learned using GitOps
Nginx Essential
Nginx Essential
Improving Operations Efficiency with Puppet
Improving Operations Efficiency with Puppet
Open Sourcing NGINX Agent and Demo
Open Sourcing NGINX Agent and Demo
.NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se...
.NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se...
Neutron upgrades
Neutron upgrades
vdocuments.site_nginx-essential.pdf
vdocuments.site_nginx-essential.pdf
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
NGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEA
Dokku
Dokku
Deploying nginx with minimal system resources
Deploying nginx with minimal system resources
More from Takahiro Kujirai
20180415 LinuC Level2 技術解説セミナー(SlideShare Version)
20180415 LinuC Level2 技術解説セミナー(SlideShare Version)
Takahiro Kujirai
Lpicl304 20170318
Lpicl304 20170318
Takahiro Kujirai
Lpicl300セミナー資料_20170218(鯨井貴博)
Lpicl300セミナー資料_20170218(鯨井貴博)
Takahiro Kujirai
20160619_LPICl304 技術解説セミナー in AP浜松町
20160619_LPICl304 技術解説セミナー in AP浜松町
Takahiro Kujirai
20160618_HTML5プロフェッショナル認定試験レベル1 技術解説セミナー in OSC北海道2016
20160618_HTML5プロフェッショナル認定試験レベル1 技術解説セミナー in OSC北海道2016
Takahiro Kujirai
20151114 _html5無料セミナー(OSC2015徳島)
20151114 _html5無料セミナー(OSC2015徳島)
Takahiro Kujirai
20150613 html5プロフェッショナル認定試験 レベル1技術解説セミナー
20150613 html5プロフェッショナル認定試験 レベル1技術解説セミナー
Takahiro Kujirai
Lpicl304Seminar Presentations on 20150118
Lpicl304Seminar Presentations on 20150118
Takahiro Kujirai
20141004 ゼウス・ラーニングパワーlinuxサーバ構築セミナー
20141004 ゼウス・ラーニングパワーlinuxサーバ構築セミナー
Takahiro Kujirai
Lpicl304セミナー資料20140727
Lpicl304セミナー資料20140727
Takahiro Kujirai
Lpicl1セミナー資料20140315
Lpicl1セミナー資料20140315
Takahiro Kujirai
20130615 未経験ok linux
20130615 未経験ok linux
Takahiro Kujirai
More from Takahiro Kujirai
(12)
20180415 LinuC Level2 技術解説セミナー(SlideShare Version)
20180415 LinuC Level2 技術解説セミナー(SlideShare Version)
Lpicl304 20170318
Lpicl304 20170318
Lpicl300セミナー資料_20170218(鯨井貴博)
Lpicl300セミナー資料_20170218(鯨井貴博)
20160619_LPICl304 技術解説セミナー in AP浜松町
20160619_LPICl304 技術解説セミナー in AP浜松町
20160618_HTML5プロフェッショナル認定試験レベル1 技術解説セミナー in OSC北海道2016
20160618_HTML5プロフェッショナル認定試験レベル1 技術解説セミナー in OSC北海道2016
20151114 _html5無料セミナー(OSC2015徳島)
20151114 _html5無料セミナー(OSC2015徳島)
20150613 html5プロフェッショナル認定試験 レベル1技術解説セミナー
20150613 html5プロフェッショナル認定試験 レベル1技術解説セミナー
Lpicl304Seminar Presentations on 20150118
Lpicl304Seminar Presentations on 20150118
20141004 ゼウス・ラーニングパワーlinuxサーバ構築セミナー
20141004 ゼウス・ラーニングパワーlinuxサーバ構築セミナー
Lpicl304セミナー資料20140727
Lpicl304セミナー資料20140727
Lpicl1セミナー資料20140315
Lpicl1セミナー資料20140315
20130615 未経験ok linux
20130615 未経験ok linux
Recently uploaded
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
aditipandeya
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
James Anderson
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
shivangimorya083
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Delhi Call girls
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
Diya Sharma
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
anamikaraghav4
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
9953056974 Low Rate Call Girls In Saket, Delhi NCR
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
divyansh0kumar0
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
anamikaraghav4
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
aditipandeya
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
stephieert
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Damian Radcliffe
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
SofiyaSharma5
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
Damian Radcliffe
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
APNIC
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
stephieert
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
soniya singh
Recently uploaded
(20)
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
20181210_Ansibleもくもく会_成果LT
1.
Ansible with NGINX/Zabbix Takahiro Kujirai (Opensourcetech / SubMattNesk)
2.
NGINX
3.
nginx_status_facts • 稼働中のNGINXのステータスを取得する https://docs.ansible.com/ansible/2.5/modules/nginx_status_facts_module.html https://github.com/ansible/ansible-modules-extras/blob/devel/web_infrastructure/ nginx_status_facts.py
4.
• 稼働中のNGINXのステータスを取得する http://opensourcetech.hatenablog.jp/entry/2018/11/22/ NGINX_Plus%E3%81%AB%E3%82%88%E3%82%8B%E3%83%AA%E3%83%90%E3%83%BC%E3 %82%B9%E3%83%97%E3%83%AD%E3%82%AD%E3%82%B7%E6%A7%8B%E7%AF%89 (NGINX Plusによるリバースプロキシ構築) (192.168.230.107 TCP81) 構成
5.
取得できる情報 • http://192.168.230.107:81/nginx_status サーバへのアクティブ接続数、リクエスト数などを確認できる。 http://nginx.org/en/docs/http/ngx_http_stub_status_module.html 192.168.230.107:81
6.
nginx.conf [root@localhost ~]# cat
-n /etc/nginx/nginx.conf 14 http { (省略) 34 upstream nginx_containers { 35 least_time header; 36 #least_time last_byte; 37 #least_time connect; 38 #least_time first_byte; 39 server localhost:8081; 40 server localhost:8082; 41 server localhost:8083; 42 } 43 44 server { 45 listen 81; 46 location / { 47 proxy_pass http://nginx_containers; 48 proxy_http_version 1.1; 49 proxy_set_header Host $host:$server_port; 50 proxy_set_header X-FOrwarded-For $proxy_add_x_forwarded_for; 51 proxy_set_header X-Forwarded-Proto http; 52 proxy_ignore_client_abort on; 53 } 54 location /nginx_status { 55 stub_status on; 56 allow all; 57 } 58 } 59 } バックエンド設定 フロントエンド設定 Status取得設定
7.
/etc/ansible/ansible.cfg [defaults] host_key_checking = False retry_files_enabled = False ask_pass = True [persistent_connection] command_timeout = 30 connect_timeout = 60
8.
/etc/ansible/hosts 192.168.230.107
9.
playbook --- - hosts: 192.168.230.107 user: root tasks: - name: Get Nginx Status(stub_status) nginx_status_facts: url: http://192.168.230.107:81/nginx_status timeout: 20 register: nginx_status - debug: var=nginx_status
10.
実行結果 やってみます!!
11.
実行結果 XYZ:ansible_test Yoshiki$ ansible-playbook nginx_stub_status.yaml SSH password: PLAY [192.168.230.107] *********************************************************** TASK [Gathering Facts] ********************************************************* ok: [192.168.230.107] TASK [Get Nginx Status(stub_status)] ******************************************* ok: [192.168.230.107] TASK [debug] ******************************************************************* ok: [192.168.230.107] => { "nginx_status": { "ansible_facts": { "nginx_status_facts": { "accepts": 21, "active_connections": 1, "data": "Active connections: 1 nserver accepts handled requestsn 21 21 31 nReading: 0 Writing: 1 Waiting: 0 n", "handled": 21, "reading": 0, "requests": 31, "waiting": 0, "writing": 1 } }, "changed": false, "failed": false } } PLAY RECAP ********************************************************************* 192.168.230.107 : ok=3 changed=0 unreachable=0 failed=0 skipped=0
12.
ハマったこと ü 対象サーバ(NGINX on CentOS7)へどうやって SSHやるんだ? → Playbookに 「host:」と「user:」
、/etc/ansible/hostsにIPアドレスな どを記載すればOK! ü SSHを秘密鍵じゃなく、パスワードで認証したいんだが? → ansible.cfgに「ask_pass = True」って書けばOK! ü 「nginx_status_factsを使ったぜ!」情報、ないかな? →ほぼ、なしw なので、書きます!! http://opensourcetech.hatenablog.jp/
13.
Zabbix
14.
zabbix_host • 監視対象ホストを追加/更新/削除する https://docs.ansible.com/ansible/2.5/modules/zabbix_host_module.html
15.
zabbix-apiが必要 XYZ:ansible_test Yoshiki$ ansible-playbook zabbix.yaml SSH password: PLAY [192.168.230.107] ********************************************************* TASK [Gathering Facts] ********************************************************* ok: [192.168.230.107] TASK [Add zabbix host] ********************************************************* fatal: [192.168.230.107 -> localhost]: FAILED! => {"changed": false, "msg": "Missing required ********-api module (check docs or install with: pip install ********-api)"} PLAY RECAP ********************************************************************* 192.168.230.107 : ok=1 changed=0 unreachable=0 failed=1 skipped=0
16.
zabbix-apiが必要 XYZ:ansible_test Yoshiki$ pip install zabbix-api Collecting zabbix-api Downloading https://files.pythonhosted.org/packages/2a/f3/ c261c6d7517acbb19bb76e9ff4721a8adda79be7e09218331603baeef145/zabbix-api-0.5.3.tar.gz Building wheels for collected packages: zabbix-api Running setup.py bdist_wheel for zabbix-api ... done Stored in directory: /Users/kujiraitakahiro/Library/Caches/pip/wheels/b3/c5/ba/ a91c17c637178c2b182a6f199cda8904f34626490ad11a4634 Successfully built zabbix-api Installing collected packages: zabbix-api Successfully installed zabbix-api-0.5.3 XYZ:ansible_test Yoshiki$ pip list | grep zabbix zabbix-api 0.5.3
17.
playbook --- - hosts: 192.168.230.107 user: root tasks: - name: Add zabbix host local_action: module: zabbix_host login_user: Admin login_password: zabbix server_url: http://192.168.230.107/zabbix timeout: 20 host_name: "NGINX" host_groups: -
NGINX status: enabled state: present interfaces: - type: 1 main: 1 useip: 1 ip: 192.168.230.107 dns: "" port: 10050 register: zabbix_status - debug: var=zabbix_status
18.
実行結果 XYZ:ansible_test Yoshiki$ ansible-playbook zabbix.yaml SSH password: PLAY [192.168.230.107] ************************************************************ TASK [Gathering Facts] ********************************************************* ok: [192.168.230.107] TASK [Add zabbix host] ********************************************************* changed: [192.168.230.107 -> localhost] TASK [debug] ******************************************************************* ok: [192.168.230.107] => { "zabbix_status": { "changed": true, "failed": false, "result": "Successfully update host NGINX (192.168.230.107) and linked with template 'None'" } } PLAY RECAP ********************************************************************* 192.168.230.107 : ok=3 changed=1 unreachable=0 failed=0 skipped=0
19.
実行結果 ホストが追加された!
Download now