ã¬ãããããã®ææã§ããAnsible ã®ãã¯ãã«ã«ãµãã¼ãããã¦ãã¾ãã
ä»åã¯ä»¥åã®ãåãåããããã ããäºä¾ãããSSH (Secure Shell Protocol) ã«ã¤ãã¦ä¸ã¤ç´¹ä»ãããã¨æãã¾ããAnsible 㯠Linux ãµã¼ããå¶å¾¡å¯¾è±¡ã¨ããã¨ã㯠SSH ã§æ¥ç¶ãã¦å¦çãå®è¡ãã¾ãã®ã§ãSSH ã®éä¿¡ã«ã¤ãã¦ã®ãã©ãã«ã¯åé¡ã«ç´çµãã¾ãã
RHEL 8.6 + Ansible Core 2.13 ã§ç¢ºèªãã¦ãã¾ãã
Ansible ã®åºæ¬çãªåä½åç
ã¾ã㯠Ansible ã¯ã©ããã£ã¦åãã¦ããã®ãã¨ããã®ã軽ãæ¯ãè¿ã£ã¦ã¿ã¾ãã
Ansible ãåä½ãããµã¼ããã³ã³ããã¼ã«ãã¼ããå¶å¾¡å¯¾è±¡ãããã¼ã¸ããã¼ãã¨å¼ã³ã¾ããæµãã大ã¾ãã«èª¬æãã¾ãã¨ããã®å³ã®ããã«ãªãã¾ãã
- â YAMLã§æ¸ããããã¬ã¤ããã¯ããã¿ã¹ã¯ãã¨ã«å°ããªããã°ã©ã ãçæãã
- â¡ â ã§çæããå°ããªããã°ã©ã ãããã¼ã¸ããã¼ãã«éãè¾¼ã
- ⢠ããã¼ã¸ããã¼ãã§é©åãªã¤ã³ã¿ããªã¿ãæ¤åºãã¦ãããã使ã£ã¦å¦çãå®è¡ãã
- ⣠å¦ççµæã JSON å½¢å¼ã§è¿ã
ãã®ããã¼ã¸ããã¼ãã¯ã³ã³ããã¼ã«ãã¼ãèªèº«ã«ãªããã¨ãããã¾ãããã¨ãã°ã¯ã©ã¦ãããããã¯ã¼ã¯æ©å¨ãå¶å¾¡ãããå ´åã«ã¯ãâ¢ã®å¦ç㧠REST API ãå¼ã³åºããããæ©å¨ã«å¯¾ãã¦å¯¾è©±çãªå¦çãè¡ã£ãããã¾ãã
ããã¼ã¸ããã¼ãã¸ã®æ¥ç¶æ¹å¼ãå®è¡ç°å¢ã«ã¤ãã¦ã¯ãæ¨æºè¨å®ã§ã¯ãã¡ãã®è¡¨ã«å¾ãã¾ããä»åã®è¨äºã§ã¯ãLinux ãµã¼ãã«å¯¾ã㦠SSH ã§æ¥ç¶ããã¨ãã®ã話ããã¾ãã
ããã¼ã¸ããã¼ã | æ¥ç¶æ¹å¼ | æ¤åºããå®è¡ç°å¢ |
---|---|---|
ã³ã³ããã¼ã«ãã¼ãèªèº« | local | Python |
Linuxãµã¼ã | SSH | Python |
Windowsãµã¼ã | WinRM | PowerShell |
Ansible ã§ã®ä¸»ãªãã©ãã«
ä¸è¨ã®å³ã§èª¬æãã¾ããâ ãâ£ããã¡ãã¨åä½ããªã㨠Ansible ã¯èªååã®å¦çãå®è¡ã§ããªãããããã¬ã¤ããã¯ãåããªãã¨ããã¨ãã«ã¯ããããã«ç¢ºèªãããã¤ã³ããããã¾ãã
åãåãããåããã¨ãã¯ä¾ãã°ãã®ãããªãã®ã確èªãã¾ããåé¡ã«ãã£ã¦ã¯ãã®ä»ã«ã確èªãããã®ã¯ããã¾ãã
â ã³ã³ããã¼ã«ãã¼ãã®åé¡
- Ansible ãã¤ã³ã¹ãã¼ã«ããã¦ããªã
- YAML ã®ææ³ãééã£ã¦ãã
- ã³ã¬ã¯ã·ã§ã³ãåç §ã§ããªã
- å¤æ°ãèªè¨¼æ å ±ãåç §ã§ããªã
- Python ã®å®è¡ç°å¢ãæ£ããè¨å®ããã¦ããªã
- æå·åãã¼ã¿ãåãæ±ããã¨ãå®è¡å¯è½ãªã¹ã¯ãªãããçæãããã¨ãã¦ã¤ã«ã¹ã¹ãã£ã³ãµã¼ãã¹ã«ãã£ã¦é»å®³ããã¦ãã
â¡ SSH ã§ã®ããã¼ã¸ããã¼ãã¸ã®æ¥ç¶ã®åé¡
- ãã¡ã¤ã¢ã¦ã©ã¼ã«ã§éä¿¡ã許å¯ããã¦ããªã (é常㯠22/tcp)
- åå解決ãã§ããªã
- ããã¼ã¸ããã¼ãã¸ã®ã«ã¼ãã£ã³ã°ããªã
- ããã¼ã¸ããã¼ã㧠SSH ã®ãµã¼ãã¹ãèµ·åãã¦ããªã
- ã³ã³ããã¼ã«ãã¼ãããç´æ¥æ¥ç¶ã§ããªãã¨ãã«è¸ã¿å°çãçµç±ããè¨å®ãæ£ãããªã
- èªè¨¼ãã§ããªã
- ã¦ã¼ã¶åã¨ãã¹ã¯ã¼ãã®çµã¿åãããæ£ãããªã
- ãã¹ã¯ã¼ãã®å ¥åå¾ ã¡ã«ãªã£ã¦ãã
- å ¬ééµã¨ç§å¯éµã®çµã¿åãããæ£ãããªã
- StrictHostKeyChecking ãæå¹ã«ãªã£ã¦ãã¦ãã¹ãéµã®ç¢ºèªãæ±ãããã
- æå·åã¹ã¤ã¼ããåæ¹ã§é©åãããã®ããªã (å¼·ãã®ãè¦æ±ãããã®ã«å¼±ãã®ãããªããªã©)
- ä»ã®èªè¨¼ã®ä»çµã¿ã¨ã®é£æºã«åé¡ããã (Kerberos ã SSO (Single Sign On) ãªã©)
- æ¥ç¶ã¦ã¼ã¶ã«ãã¼ã ãã£ã¬ã¯ããªããªãããã¡ã¤ã«ãæ¸ãè¾¼ããªã
- 22/tcp ã¯è¨±å¯ããã¦ãããã®ã®ãå¿ è¦ãªéä¿¡ãä¸ç¶æ©å¨ã§é®æãã¦ãã
⢠ããã¼ã¸ããã¼ãã§ã®åä½ã®åé¡
- Python ã¤ã³ã¿ããªã¿ãã¤ã³ã¹ãã¼ã«ããã¦ããªã
- Python ã¤ã³ã¿ããªã¿ãæ¤åºã§ããªã
- æ¤åºããã Python ã¤ã³ã¿ããªã¿ã«å¿ è¦ãªã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ããã¦ããªã
- æ¥ç¶ããã¦ã¼ã¶ã«ã¹ã¯ãªãããå®è¡ãã権éããªã
- å¤ããéãè¾¼ã¾ããå®è¡å¯è½ãªã¹ã¯ãªããã®å®è¡ãã¦ã¤ã«ã¹ã¹ãã£ã³ãµã¼ãã¹ã«ãã£ã¦é»å®³ããã¦ãã
- å¦çã«æéããããããã¦æ¥ç¶ãã¿ã¤ã ã¢ã¦ããã
- 大éã«ãã¼ã¿ãçæãã¦ãã£ã¹ã¯ãããµãã
⣠ããã¼ã¸ããã¼ãããçµæãåãåãã¨ãã®åé¡
- å¦ççµæãè¨å¤§ããã¦æ¥ç¶ãã¿ã¤ã ã¢ã¦ããã
- 大éã«ãã¼ã¿ãåãåã£ã¦ã³ã³ããã¼ã«ãã¼ãå´ã®ãã£ã¹ã¯ãããµãã (fact ã使ãã¨ããªã©)
- å¦ççµæãæååããã¦ãã
Ansible ã®ãããã°ã¬ãã«
ansible-playbook ã³ãã³ãã§ã¯ã-v (--verbose) ã§ãããã°ã¬ãã«ãæå®ãã¾ããç¾å¨ã®ãã¼ã¸ã§ã³ (Ansible Core 2.13) ã§ã¯ã-vvvvvv (v ã6ã¤) ã¾ã§æå®ã§ãã¾ããå¤ãã»ã©ãã詳細ãªãã°ãåºåããã¾ãã主ã«ä½¿ãã®ã¯ -vvvv (v ã4ã¤) ã§ããWindows ã®ã¨ãã¯5ã¤æå®ããæ å ±ãåå¾ãã¾ãã
vã®æ° | æå³åã |
---|---|
(æå®ããªã) | é常ã®åºå |
v | verbose |
vv | more verbose |
vvv | debug |
vvvv | connection debug |
vvvvv | WinRM debug |
vvvvvv | (ä¸è¨ãªã³ã¯å ã®ã³ã¼ãã§ãã使ããã¦ãªãããã§ã) |
ãã®ä»ãANSIBLE_DEBUG å¤æ°ã true ã«ãããã¨ã§ãPython ã®å¦çã«æ·±ãåãè¾¼ãã§ãããã¨ãã§ãã¾ãã
å®éã®ä¾
ãã®ãããªç°¡åãªãã¬ã¤ããã¯ãç¨æãã¦ã¿ã¾ããã
--- - hosts: all gather_facts: false tasks: - name: ping ansible.builtin.ping:
ã¤ã³ãã³ããªãã¡ã¤ã«ãç¨æãã¦ããã¾ãã
[RHEL8] 192.168.0.130 192.168.0.131 192.168.0.132 [RHEL8:vars] ansible_user=sugimura ansible_password=XXXXXXXX
å®è¡ãã¾ãã
$ ansible-playbook -i inventory ping.yml PLAY [all] ********************************************************************************************************************************************************************************** TASK [ping] ********************************************************************************************************************************************************************************* ok: [192.168.0.131] ok: [192.168.0.132] ok: [192.168.0.130] PLAY RECAP ********************************************************************************************************************************************************************************** 192.168.0.130 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 192.168.0.131 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 192.168.0.132 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ããã -vvvv (vã4ã¤) ã§å®è¡ããã¨ããã®ããã«ãã¾ãã¾ãªæ å ±ãåºåããã¾ãã
$ ansible-playbook -i inventory ping.yml -vvvv ansible-playbook [core 2.13.0] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/sugimura/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /home/sugimura/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-playbook python version = 3.9.7 (default, Sep 13 2021, 08:18:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] jinja version = 3.0.3 libyaml = True Using /etc/ansible/ansible.cfg as config file setting up inventory plugins host_list declined parsing /home/sugimura/inventory as it did not pass its verify_file() method script declined parsing /home/sugimura/inventory as it did not pass its verify_file() method auto declined parsing /home/sugimura/inventory as it did not pass its verify_file() method Parsed /home/sugimura/inventory inventory source with ini plugin Loading callback plugin default of type stdout, v2.0 from /usr/lib/python3.9/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: ping.yml ************************************************************************************************************************************************************************** Positional arguments: ping.yml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/home/sugimura/inventory',) forks: 5 1 plays in ping.yml PLAY [all] ********************************************************************************************************************************************************************************** META: ran handlers TASK [ping] ********************************************************************************************************************************************************************************* task path: /home/sugimura/ping.yml:6 <192.168.0.130> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.131> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.130> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/72daa41b21"' 192.168.0.130 '/bin/sh -c '"'"'echo ~sugimura && sleep 0'"'"'' <192.168.0.131> SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/1f1a06c0f9"' 192.168.0.131 '/bin/sh -c '"'"'echo ~sugimura && sleep 0'"'"'' <192.168.0.132> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.132> SSH: EXEC sshpass -d14 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' 192.168.0.132 '/bin/sh -c '"'"'echo ~sugimura && sleep 0'"'"'' ...
ããã«ãANSIBLE_DEBUG=true
ãã¤ããã¨ããã«è©³ããæ
å ±ãåºã¦ãã¾ããå®è¡ã«åãæããåã«ãè¨å®ãã¡ã¤ã«ã®è§£éãã¢ã¸ã¥ã¼ã«ã®èªã¿è¾¼ã¿ãå®è¡æå»ãªã©ããã¾ãã¾ãªæ
å ±ãåå¾ã§ãã¾ãã
$ ANSIBLE_DEBUG=true ansible-playbook -i inventory ping.yml -vvvv 1522811 1664675100.64203: starting run ansible-playbook [core 2.13.0] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/sugimura/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.9/site-packages/ansible ansible collection location = /home/sugimura/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible-playbook python version = 3.9.7 (default, Sep 13 2021, 08:18:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] jinja version = 3.0.3 libyaml = True Using /etc/ansible/ansible.cfg as config file 1522811 1664675100.64446: Added group all to inventory 1522811 1664675100.64449: Added group ungrouped to inventory 1522811 1664675100.64453: Group all now contains ungrouped 1522811 1664675100.64456: Examining possible inventory source: /home/sugimura/inventory setting up inventory plugins 1522811 1664675100.64552: trying /usr/share/ansible/plugins/cache 1522811 1664675100.64557: trying /usr/lib/python3.9/site-packages/ansible/plugins/cache 1522811 1664675100.64591: Loading CacheModule 'memory' from /usr/lib/python3.9/site-packages/ansible/plugins/cache/memory.py (searched paths: /usr/lib/python3.9/site-packages/ansible/plugins/cache:/usr/share/ansible/plugins/cache) 1522811 1664675100.64606: trying /usr/share/ansible/plugins/inventory 1522811 1664675100.64609: trying /usr/lib/python3.9/site-packages/ansible/plugins/inventory 1522811 1664675100.64649: Loading InventoryModule 'host_list' from /usr/lib/python3.9/site-packages/ansible/plugins/inventory/host_list.py (searched paths: /usr/lib/python3.9/site-packages/ansible/plugins/inventory:/usr/share/ansible/plugins/inventory) 1522811 1664675100.64698: Loaded config def from plugin (inventory/script) 1522811 1664675100.64701: Loading InventoryModule 'script' from /usr/lib/python3.9/site-packages/ansible/plugins/inventory/script.py (searched paths: /usr/lib/python3.9/site-packages/ansible/plugins/inventory:/usr/share/ansible/plugins/inventory) 1522811 1664675100.64727: Loading InventoryModule 'auto' from /usr/lib/python3.9/site-packages/ansible/plugins/inventory/auto.py (searched paths: /usr/lib/python3.9/site-packages/ansible/plugins/inventory:/usr/share/ansible/plugins/inventory) 1522811 1664675100.64767: Loaded config def from plugin (inventory/yaml) ... PLAYBOOK: ping.yml ************************************************************************************************************************************************************************** Positional arguments: ping.yml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/home/sugimura/inventory',) forks: 5 1 plays in ping.yml ... 1522816 1664675100.74991: _low_level_execute_command(): starting 1522816 1664675100.74996: _low_level_execute_command(): executing: /bin/sh -c 'echo ~sugimura && sleep 0' <192.168.0.131> ESTABLISH SSH CONNECTION FOR USER: sugimura 1522818 1664675100.75114: running TaskExecutor() for 192.168.0.132/TASK: ping 1522818 1664675100.75153: in run() - task 00505699-f612-50dd-9ea3-00000000000a 1522818 1664675100.75163: variable 'ansible_search_path' from source: unknown 1522818 1664675100.75179: calling self._execute() 1522818 1664675100.75206: variable 'ansible_user' from source: group vars, precedence entry 'groups_inventory' 1522818 1664675100.75209: variable 'ansible_password' from source: group vars, precedence entry 'groups_inventory' 1522818 1664675100.75214: variable 'omit' from source: magic vars 1522818 1664675100.75264: variable 'omit' from source: magic vars <192.168.0.130> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/72daa41b21"' 192.168.0.130 '/bin/sh -c '"'"'echo ~sugimura && sleep 0'"'"'' 1522818 1664675100.75279: variable 'omit' from source: magic vars 1522818 1664675100.75313: trying /usr/share/ansible/plugins/connection 1522818 1664675100.75324: trying /usr/lib/python3.9/site-packages/ansible/plugins/connection 1522818 1664675100.75355: Loading Connection 'ssh' from /usr/lib/python3.9/site-packages/ansible/plugins/connection/ssh.py (searched paths: /usr/share/ansible/plugins/connection:/usr/lib/python3.9/site-packages/ansible/plugins/connection) (found_in_cache=True, class_only=False) ...
SSH ã®éä¿¡ããããã°ãã
ããããä»åã®æ¬é¡ã§ãããã®ãããã°æ å ±ãå ã«ãã¦ãã©ã®ããã«éä¿¡ã追ãããã¦ããã®ããç´¹ä»ãã¾ãã
ããã§ã¯ãã®ãããªåé¡ãèãã¾ãã
- RHEL ã®ã¿ã¼ããã«ãã ssh ã³ãã³ãã使ã£ã¦ããã¼ã¸ããã¼ãã«æ¥ç¶ãã¦ãã³ãã³ãã®å®è¡ã¯ã§ãããã®ã®ããã¬ã¤ããã¯ãå®è¡ããã¨çµæãè¿ããã¿ã¤ã ã¢ã¦ãã¨ãªãã
- ã³ã³ããã¼ã«ãã¼ãã¨ããã¼ã¸ããã¼ãã®éã«ã¯ VPN æ©å¨ãããã
- é常ã®ãã©ãã«ã·ã¥ã¼ãã£ã³ã°ãè¡ã£ãçµæãSSH ã®éä¿¡å 容ãæªããã¨æãããã¨ããã¾ã§ã¯çµãè¾¼ãã ã(ããã¾ã§ãã¾ã大å¤ã§ã¯ããã¾ããã)
ããã§ãANSIBLE_DEBUG=true
ã§ã®è©³ç´°æ
å ±ãããSSH ã§ã®æ¥ç¶ãèªã¿è§£ãã¦ããã¾ããä¸ããé ã«è¿½ãããã¾ãã
1. ssh ã§æ¥ç¶ãããã¨ãè¨å®ãã
æ¬å½ã« ssh ã使ããã¨ãã¦ããã®ããã©ã®ãããªãã©ã¡ã¼ã¿ãè¨å®ããã¦ãããã確èªãã¾ãããã¾ã® Ansible ã®å®è£ ã§ã¯ãæ¥ç¶é¨åã¯ãã©ã°ã¤ã³ã«åãé¢ããã¦ãã¾ããã³ã¼ãã追ããããã¨ãã«ã¯ã©ã®ãã©ã°ã¤ã³ã使ããã¦ããããææ¡ãããã¨ãå¿ è¦ã§ãã
1523091 1664675304.99557: trying /usr/share/ansible/plugins/connection 1523091 1664675304.99562: trying /usr/lib/python3.9/site-packages/ansible/plugins/connection 1523091 1664675304.99579: Loading Connection 'ssh' from /usr/lib/python3.9/site-packages/ansible/plugins/connection/ssh.py (searched paths: /usr/share/ansible/plugins/connection:/usr/lib/python3.9/site-packages/ansible/plugins/connection) (found_in_cache=True, class_only=False) 1523091 1664675304.99589: trying /usr/lib/python3.9/site-packages/ansible/plugins/shell 1523091 1664675304.99597: Loading ShellModule 'sh' from /usr/lib/python3.9/site-packages/ansible/plugins/shell/sh.py (found_in_cache=True, class_only=False) 1523091 1664675304.99603: Loading ShellModule 'sh' from /usr/lib/python3.9/site-packages/ansible/plugins/shell/sh.py (found_in_cache=True, class_only=False) 1523091 1664675304.99619: variable 'inventory_hostname' from source: host vars for '192.168.0.132' 1523091 1664675304.99621: variable 'ansible_password' from source: group vars, precedence entry 'groups_inventory' 1523091 1664675304.99623: variable 'ansible_user' from source: group vars, precedence entry 'groups_inventory' 1523091 1664675304.99692: Set connection var ansible_module_compression to ZIP_DEFLATED 1523091 1664675304.99697: Set connection var ansible_timeout to 10 1523091 1664675304.99699: Set connection var ansible_shell_executable to /bin/sh 1523091 1664675304.99703: Set connection var ansible_pipelining to False 1523091 1664675304.99705: Set connection var ansible_shell_type to sh 1523091 1664675304.99707: Set connection var ansible_connection to ssh 1523091 1664675304.99709: Set connection var ansible_host to 192.168.0.132 ...
2. ssh ã³ãã³ãã§æ¥ç¶ç¢ºèªç¨ã®ã³ãã³ããçºè¡ãã
å®è¡ãã¦ããã³ãã³ãããã°ã«è¨é²ããã¦ãã¾ããsshpass -d10 ssh -vvv ...
ã®ã¨ããã§ãããã¼ã ãã£ã¬ã¯ããªããããã¨ã確èªãã¦ãã¾ãã
1523091 1664675304.99812: _low_level_execute_command(): starting 1523091 1664675304.99819: _low_level_execute_command(): executing: /bin/sh -c 'echo ~sugimura && sleep 0' <192.168.0.132> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.132> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' 192.168.0.132 '/bin/sh -c '"'"'echo ~sugimura && sleep 0'"'"''
ããã«ãssh ã³ãã³ãã®ãããã°ãã° ssh -vvv
ãåºåããã¦ãã¾ãããã±ããã®æ°æã¡ã«ãªã£ã¦ãããããå¦çãèªã¿è§£ãã¦ããã¾ãã
- è¨å®ãã¡ã¤ã« /home/sugimura/.ssh/config, /etc/ssh/ssh_config, ãããã include ããã¦ãããã¡ã¤ã«
- ææ¡ããéµäº¤æã¢ã«ã´ãªãºã (ããã§ã¯ diffie-hellman-group-exchange-sha1) ã RHEL ã® crypto policy ã«åè´ãã¦ããã
- éä¿¡ã®ããã® socket ã確ç«ãããã
- ãªã¯ã¨ã¹ããéä¿¡ã§ããã (<<<)
- ã¬ã¹ãã³ã¹ãå¾ãããã (>>>)
1523091 1664675305.00773: stderr chunk (state=2): >>>OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 debug1: Reading configuration data /home/sugimura/.ssh/config debug3: kex names ok: [diffie-hellman-group-exchange-sha1] debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 54: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf <<< 1523091 1664675305.00791: stderr chunk (state=3): >>>debug2: checking match for 'final all' host 192.168.0.132 originally 192.168.0.132 debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final' debug2: match not found debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only) debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-] debug3: kex names ok: [curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] debug1: configuration requests final Match pass debug2: resolve_canonicalize: hostname 192.168.0.132 is address debug1: re-parsing configuration debug1: Reading configuration data /home/sugimura/.ssh/config debug3: kex names ok: [diffie-hellman-group-exchange-sha1] debug1: Reading configuration data /etc/ssh/ssh_config debug3: /etc/ssh/ssh_config line 54: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0 debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug2: checking match for 'final all' host 192.168.0.132 originally 192.168.0.132 debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final' debug2: match found debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-] debug3: kex names ok: [curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] <<< 1523091 1664675305.00803: stderr chunk (state=3): >>>debug1: auto-mux: Trying existing master debug2: fd 4 setting O_NONBLOCK <<< 1523091 1664675305.00820: stderr chunk (state=3): >>>debug2: mux_client_hello_exchange: master version 4 debug3: mux_client_forwards: request forwardings: 0 local, 0 remote debug3: mux_client_request_session: entering debug3: mux_client_request_alive: entering debug3: mux_client_request_alive: done pid = 1523069 debug3: mux_client_request_session: session request sent <<< 1523091 1664675305.03130: stdout chunk (state=3): >>>/home/sugimura <<< 1523091 1664675305.03203: stderr chunk (state=3): >>>debug3: mux_client_read_packet: read header failed: Broken pipe debug2: Received exit status from master 0 <<< 1523091 1664675305.03270: stderr chunk (state=3): >>><<< 1523091 1664675305.03278: stdout chunk (state=3): >>><<< <192.168.0.132> (0, b'/home/sugimura\n', b"OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021\r\ndebug1: Reading configuration data /home/sugimura/.ssh/config\r\ndebug3: kex names ok: [diffie-hellman-group-exchange-sha1]\r\ndebug1: ...
3. Python ã®ããã°ã©ã ãéä¿¡ããæºåããã
ãã¼ã ãã£ã¬ã¯ããªããããã¨ã確èªã§ããã®ã§ãSSH ã®éä¿¡ã»ãã·ã§ã³ã使ã£ã¦ Python ã®ããã°ã©ã ãéãè¾¼ãããã®ãã£ã¬ã¯ããªãä½æããå¦çãè¦ã¦ããã¾ãã
ããã§ãåæ§ã«å ¥åºåãè¦ã¾ãã
- ãªã¯ã¨ã¹ããéä¿¡ã§ããã (<<<)
- ã¬ã¹ãã³ã¹ãå¾ãããã (>>>)
- æ£å¸¸çµäºããã (rc=0)
ãã失æããã¨ãä»ã® /tmp çã®ãã£ã¬ã¯ããªã«ä½æã§ããªããã試ã¿ãããããã¨ãããã¾ãããã¼ããã·ã§ã³ã®åé¡ãããã¨ãã¯ã·ã§ã«ã«è¨å®ããã¦ãã umask ã®å¤ãã/etc/login.defs ãªã©ã«å®ç¾©ããã¦ããã·ã¹ãã ã¯ã¤ãã§ã® umask ã確èªãã¾ãããã¡ã¤ã«ã·ã¹ãã ã® mount ãªãã·ã§ã³ãçããã¨ãããã¾ãã
1523091 1664675305.03317: _low_level_execute_command(): starting 1523091 1664675305.03323: _low_level_execute_command(): executing: /bin/sh -c '( umask 77 && mkdir -p "` echo /home/sugimura/.ansible/tmp `"&& mkdir "` echo /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486 `" && echo ansible-tmp-1664675305.0331209-1523091-142821774396486="` echo /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486 `" ) && sleep 0' <192.168.0.132> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.132> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' 192.168.0.132 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/sugimura/.ansible/tmp `"&& mkdir "` echo /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486 `" && echo ansible-tmp-1664675305.0331209-1523091-142821774396486="` echo /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486 `" ) && sleep 0'"'"'' 1523091 1664675305.03972: stderr chunk (state=2): >>>OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 ... debug1: auto-mux: Trying existing master debug2: fd 4 setting O_NONBLOCK <<< 1523091 1664675305.28372: stderr chunk (state=3): >>>debug2: mux_client_hello_exchange: master version 4 debug3: mux_client_forwards: request forwardings: 0 local, 0 remote debug3: mux_client_request_session: entering debug3: mux_client_request_alive: entering <<< 1523091 1664675305.28381: stderr chunk (state=3): >>>debug3: mux_client_request_alive: done pid = 1523069 debug3: mux_client_request_session: session request sent <<< 1523091 1664675305.30525: stderr chunk (state=3): >>>debug3: mux_client_read_packet: read header failed: Broken pipe debug2: Received exit status from master 0 <<< 1523091 1664675305.30614: stderr chunk (state=3): >>><<< 1523091 1664675305.30624: stdout chunk (state=3): >>><<< <192.168.0.132> (0, b'', b"OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021\r\ndebug1: Reading configuration data /home/sugimura/.ssh/config\r\ndebug3: kex names ok: [diffie-hellman-group-exchange-sha1]\r\ndebug1: Reading ... 1523091 1664675305.06308: _low_level_execute_command() done: rc=0, stdout=ansible-tmp-1664675305.0331209-1523091-142821774396486=/home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486 , stderr=OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 ...
4. ããã¼ã¸ããã¼ãã® Python ã¤ã³ã¿ããªã¿ãæ¤åºãã
ping ã¢ã¸ã¥ã¼ã«ãã㯠Python ã®å°ããªããã°ã©ã ãçæããããããããããã¼ã¸ããã¼ãã§å®è¡ããããã«å©ç¨ã§ãããã®ããããã©ãããæ¢ãã¾ãã ã¢ã¸ã¥ã¼ã«ã«ãã£ã¦ã¯ debug ã¢ã¸ã¥ã¼ã«ã®ããã« Python ã¤ã³ã¿ããªã¿ãå¿ è¦ã¨ããªããã®ããããããã¢ã¸ã¥ã¼ã«ã解éããªããã°ãã®å¦çã«å ¥ãã¾ããã
Python ã¤ã³ã¿ããªã¿ã®æ¤åºã«ã¤ãã¦ãå¤å´ããè¦ã大ã¾ããªæ¦è¦ã«ã¤ãã¦ã¯ãã¡ãã®è¨äºãã覧ãã ããã
1523091 1664675305.06391: ANSIBALLZ: Using lock for ansible.builtin.ping 1523091 1664675305.06394: ANSIBALLZ: Acquiring lock 1523091 1664675305.06397: ANSIBALLZ: Lock acquired: 139933950381504 1523091 1664675305.06399: ANSIBALLZ: Creating module 1523091 1664675305.15378: ANSIBALLZ: Writing module into payload 1523091 1664675305.15434: ANSIBALLZ: Writing module 1523091 1664675305.15450: ANSIBALLZ: Renaming module 1523091 1664675305.15454: ANSIBALLZ: Done creating module 1523091 1664675305.15472: variable 'ansible_facts' from source: unknown 1523091 1664675305.15476: variable 'inventory_hostname' from source: host vars for '192.168.0.132' <192.168.0.132> Attempting python interpreter discovery 1523091 1664675305.15485: _low_level_execute_command(): starting 1523091 1664675305.15490: _low_level_execute_command(): executing: /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'python3.10'"'"'; command -v '"'"'python3.9'"'"'; command -v '"'"'python3.8'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0' <192.168.0.132> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.132> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' 192.168.0.132 '/bin/sh -c '"'"'echo PLATFORM; uname; echo FOUND; command -v '"'"'"'"'"'"'"'"'python3.10'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.9'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.8'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.6'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.5'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/bin/python3'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/libexec/platform-python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python2.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/bin/python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python'"'"'"'"'"'"'"'"'; echo ENDFOUND && sleep 0'"'"'' 1523091 1664675305.16121: stderr chunk (state=2): >>>OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 ... <<< 1523091 1664675305.18538: stdout chunk (state=3): >>>PLATFORM <<< 1523091 1664675305.18587: stdout chunk (state=3): >>>Linux <<< 1523091 1664675305.18621: stdout chunk (state=3): >>>FOUND /usr/bin/python3.9 /usr/bin/python3 /usr/libexec/platform-python ENDFOUND <<< 1523091 1664675305.18779: stderr chunk (state=3): >>>debug3: mux_client_read_packet: read header failed: Broken pipe debug2: Received exit status from master 0 <<< 1523091 1664675305.18796: stderr chunk (state=3): >>><<< 1523091 1664675305.18801: stdout chunk (state=3): >>><<< ... 1523091 1664675305.18826: _low_level_execute_command() done: rc=0, stdout=PLATFORM Linux FOUND /usr/bin/python3.9 /usr/bin/python3 /usr/libexec/platform-python ENDFOUND , stderr=OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 ... 1523091 1664675305.18836 [192.168.0.132]: found interpreters: ['/usr/bin/python3.9', '/usr/bin/python3', '/usr/libexec/platform-python']
5. æ¤åºãã Python ã¤ã³ã¿ããªã¿ã調ã¹ã
Python ã¤ã³ã¿ããªã¿ãå®éã«å®è¡ãã¦ãçµæãå¾ããã¨ãã§ãããã確èªãã¦ãã¾ãã1234 bytes ã®ä½ãå°ããªãã¼ã¿ãéã£ã¦ãããã¨ã¯ãããã¾ããããã®å 容ã¯ãã°ã«ã¯åºã¦ãã¦ãã¾ããã§ãããOS ã«ã¤ãã¦ã®æ å ±ãåéãã¦çµæã JSON ã§è¿ããã¦ãããã¨ããããã¾ãã
ããã§ãå ¥åºå㨠rc=0 (æ£å¸¸çµäº) ã§ãããã¨ã確èªãã¾ãã
1523091 1664675305.18877: _low_level_execute_command(): starting 1523091 1664675305.18885: _low_level_execute_command(): executing: /bin/sh -c '/usr/bin/python3.9 && sleep 0' <192.168.0.132> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.132> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' 192.168.0.132 '/bin/sh -c '"'"'/usr/bin/python3.9 && sleep 0'"'"'' 1523091 1664675305.19179: Sending initial data 1523091 1664675305.19195: Sent initial data (1234 bytes) ... <<< 1523091 1664675305.19553: stderr chunk (state=3): >>>debug3: mux_client_request_alive: done pid = 1523069 debug3: mux_client_request_session: session request sent <<< 1523091 1664675305.23304: stdout chunk (state=3): >>>{"platform_dist_result": [], "osrelease_content": "NAME=\"Red Hat Enterprise Linux\"\nVERSION=\"8.6 (Ootpa)\"\nID=\"rhel\"\nID_LIKE=\"fedora\"\nVERSION_ID=\"8.6\"\nPLATFORM_ID=\"platform:el8\"\nPRETTY_NAME=\"Red Hat Enterprise Linux 8.6 (Ootpa)\"\nANSI_COLOR=\"0;31\"\nCPE_NAME=\"cpe:/o:redhat:enterprise_linux:8::baseos\"\nHOME_URL=\"https://www.redhat.com/\"\nDOCUMENTATION_URL=\"https://access.redhat.com/documentation/red_hat_enterprise_linux/8/\"\nBUG_REPORT_URL=\"https://bugzilla.redhat.com/\"\n\nREDHAT_BUGZILLA_PRODUCT=\"Red Hat Enterprise Linux 8\"\nREDHAT_BUGZILLA_PRODUCT_VERSION=8.6\nREDHAT_SUPPORT_PRODUCT=\"Red Hat Enterprise Linux\"\nREDHAT_SUPPORT_PRODUCT_VERSION=\"8.6\"\n"} <<< 1523091 1664675305.23927: stderr chunk (state=3): >>>debug3: mux_client_read_packet: read header failed: Broken pipe debug2: Received exit status from master 0 <<< 1523091 1664675305.23952: stderr chunk (state=3): >>><<< 1523091 1664675305.23955: stdout chunk (state=3): >>><<< ... 1523091 1664675305.23973: _low_level_execute_command() done: rc=0, stdout={"platform_dist_result": [], "osrelease_content": "NAME=\"Red Hat Enterprise Linux\"\nVERSION=\"8.6 (Ootpa)\"\nID=\"rhel\"\nID_LIKE=\"fedora\"\nVERSION_ID=\"8.6\"\nPLATFORM_ID=\"platform:el8\"\nPRETTY_NAME=\"Red Hat Enterprise Linux 8.6 (Ootpa)\"\nANSI_COLOR=\"0;31\"\nCPE_NAME=\"cpe:/o:redhat:enterprise_linux:8::baseos\"\nHOME_URL=\"https://www.redhat.com/\"\nDOCUMENTATION_URL=\"https://access.redhat.com/documentation/red_hat_enterprise_linux/8/\"\nBUG_REPORT_URL=\"https://bugzilla.redhat.com/\"\n\nREDHAT_BUGZILLA_PRODUCT=\"Red Hat Enterprise Linux 8\"\nREDHAT_BUGZILLA_PRODUCT_VERSION=8.6\nREDHAT_SUPPORT_PRODUCT=\"Red Hat Enterprise Linux\"\nREDHAT_SUPPORT_PRODUCT_VERSION=\"8.6\"\n"} , stderr=OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021
6. ping ã¢ã¸ã¥ã¼ã«ããçæããã Python ã®ããã°ã©ã ãéä¿¡ãã
ããã¾ã§æ¥ã¦ãã£ã¨ãping ã¢ã¸ã¥ã¼ã«ããçæãã Python ã®ããã°ã©ã ãéä¿¡ãã¾ããping.py ãå ã«ã㦠AnsiballZ_ping.py ãçæããsftp ã§éä¿¡ãã¦ãã¾ãã
ãã¡ã¤ã«ãéä¿¡ãã¦ç¸æå ã«æ¸ãè¾¼ãã¨ããã®ã¯ããã¾ã§ã®ã³ãã³ãã®å®è¡ã¨æ¯ã¹ãã¨ãããªãã«è¤éãªããã注ææ·±ãè¦ã¦ããå¿ è¦ãããã¾ãã
1523091 1664675305.24066: variable 'ansible_facts' from source: unknown 1523091 1664675305.24071: variable 'ansible_facts' from source: unknown 1523091 1664675305.24098: ANSIBALLZ: using cached module: /home/sugimura/.ansible/tmp/ansible-local-1523087yurgsn13/ansiballz_cache/ansible.modules.ping-ZIP_DEFLATED 1523091 1664675305.24123: variable 'ansible_facts' from source: unknown Using module file /usr/lib/python3.9/site-packages/ansible/modules/ping.py 1523091 1664675305.24179: transferring module to remote /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/AnsiballZ_ping.py <192.168.0.132> PUT /home/sugimura/.ansible/tmp/ansible-local-1523087yurgsn13/tmpl67x1t1y TO /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/AnsiballZ_ping.py <192.168.0.132> SSH: EXEC sshpass -d10 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' '[192.168.0.132]' 1523091 1664675305.24611: Sending initial data 1523091 1664675305.24627: Sent initial data (175 bytes) 1523091 1664675305.25089: stderr chunk (state=3): >>>OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 ... debug3: kex names ok: [curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1] <<< 1523091 1664675305.25115: stderr chunk (state=3): >>>debug1: auto-mux: Trying existing master debug2: fd 4 setting O_NONBLOCK <<< 1523091 1664675305.25134: stderr chunk (state=3): >>>debug2: mux_client_hello_exchange: master version 4 debug3: mux_client_forwards: request forwardings: 0 local, 0 remote debug3: mux_client_request_session: entering debug3: mux_client_request_alive: entering debug3: mux_client_request_alive: done pid = 1523069 <<< 1523091 1664675305.25140: stderr chunk (state=3): >>>debug3: mux_client_request_session: session request sent <<< 1523091 1664675305.26885: stderr chunk (state=3): >>>debug2: Remote version: 3 debug2: Server supports extension "[email protected]" revision 1 debug2: Server supports extension "[email protected]" revision 2 debug2: Server supports extension "[email protected]" revision 2 debug2: Server supports extension "[email protected]" revision 1 debug2: Server supports extension "[email protected]" revision 1 debug2: Server supports extension "[email protected]" revision 1 debug3: Sent message fd 3 T:16 I:1 <<< 1523091 1664675305.26918: stderr chunk (state=3): >>>debug3: SSH_FXP_REALPATH . -> /home/sugimura size 0 debug3: Looking up /home/sugimura/.ansible/tmp/ansible-local-1523087yurgsn13/tmpl67x1t1y debug3: Sent message fd 3 T:17 I:2 <<< 1523091 1664675305.26927: stdout chunk (state=3): >>>sftp> put /home/sugimura/.ansible/tmp/ansible-local-1523087yurgsn13/tmpl67x1t1y /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/AnsiballZ_ping.py <<< 1523091 1664675305.26938: stderr chunk (state=3): >>>debug3: Received stat reply T:101 I:2 debug1: Couldn't stat remote file: No such file or directory debug3: Sent message SSH2_FXP_OPEN I:3 P:/home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/AnsiballZ_ping.py <<< 1523091 1664675305.26968: stderr chunk (state=3): >>>debug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768 <<< 1523091 1664675305.27142: stderr chunk (state=3): >>>debug3: SSH2_FXP_STATUS 0 debug3: In write loop, ack for 4 32768 bytes at 0 debug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:32768 debug3: Sent message SSH2_FXP_WRITE I:6 O:65536 S:32768 debug3: Sent message SSH2_FXP_WRITE I:7 O:98304 S:28929 <<< 1523091 1664675305.27425: stderr chunk (state=3): >>>debug3: SSH2_FXP_STATUS 0 debug3: In write loop, ack for 5 32768 bytes at 32768 <<< 1523091 1664675305.27454: stderr chunk (state=3): >>>debug3: SSH2_FXP_STATUS 0 debug3: In write loop, ack for 6 32768 bytes at 65536 <<< 1523091 1664675305.27470: stderr chunk (state=3): >>>debug3: SSH2_FXP_STATUS 0 debug3: In write loop, ack for 7 28929 bytes at 98304 debug3: Sent message SSH2_FXP_CLOSE I:4 <<< 1523091 1664675305.27488: stderr chunk (state=3): >>>debug3: SSH2_FXP_STATUS 0 <<< 1523091 1664675305.27539: stderr chunk (state=3): >>>debug3: mux_client_read_packet: read header failed: Broken pipe debug2: Received exit status from master 0 <<< 1523091 1664675305.27634: stderr chunk (state=3): >>><<< 1523091 1664675305.27645: stdout chunk (state=3): >>><<< ... 1523091 1664675305.27677: done transferring module to remote
7. ping ã¢ã¸ã¥ã¼ã«ããçæããã Python ã®ããã°ã©ã ã«å®è¡æ¨©éãä»ä¸ãã
ç¡äº AnsiballZ_ping.py ãéãã¤ããããå®è¡æ¨©éãä»ä¸ãã¾ããchmod u+x
ã³ãã³ããå®è¡ãã¦ãã¾ãã
ããããã³ãã³ãã§ãããã¼ã¸ããã¼ãä¸ã®è¨å®ã«ãã£ã¦ã¯ä½ããã®çç±ã§å¤±æããå ´åãããã®ã§ã注ææ·±ãè¦ã¦ããå¿ è¦ãããã¾ããchmod ã®å¤±æã¯ãã¡ã¤ã«ã·ã¹ãã (LVM ã NFS ãªã©) ã®è¨å®ãçããããã¨ãããã¾ãã
1523091 1664675305.27690: _low_level_execute_command(): starting 1523091 1664675305.27695: _low_level_execute_command(): executing: /bin/sh -c 'chmod u+x /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/ /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/AnsiballZ_ping.py && sleep 0' <192.168.0.132> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.132> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' 192.168.0.132 '/bin/sh -c '"'"'chmod u+x /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/ /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/AnsiballZ_ping.py && sleep 0'"'"'' 1523091 1664675305.28351: stderr chunk (state=2): ... 1523091 1664675305.30648: _low_level_execute_command() done: rc=0, stdout=, stderr=OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021
8. ping ã¢ã¸ã¥ã¼ã«ããçæããã Python ã®ããã°ã©ã ãå®è¡ãã
ããããã¢ã¸ã¥ã¼ã«ãå®è¡ãã¾ãã4. ã§ã¯ ['/usr/bin/python3.9', '/usr/bin/python3', '/usr/libexec/platform-python'] ã® Python ã¤ã³ã¿ããªã¿ãæ¤åºã㦠5. ã§ã¯æåã® /usr/bin/python3.9 ã§å®è¡ãã¦ãã¾ãããã5. ã®å¦ççµæããã¯ããã¼ã¸ããã¼ãã® OS 㯠RHEL 8 ã§ãããã¨ãå¤æã§ããã®ã§ãINTERPRETER_PYTHON_DISTRO_MAP ã®å®ç¾©ãã RHEL 8 ãæ¢ã㦠/usr/libexec/platform-python ã使ã£ã¦å®è¡ãã¾ãããã®å®ç¾©ã¯ ansible-config dump
ã§ç¢ºèªã§ãã¾ãã
$ ansible-config dump | grep INTERPRETER INTERPRETER_PYTHON(default) = auto INTERPRETER_PYTHON_DISTRO_MAP(default) = {'redhat': {'6': '/usr/bin/python', '8': '/usr/libexec/platform-python', '9': '/usr/bin/python3'}, 'debian': {'8': '/usr/bin/python', '10': '/usr/bin/python3'}, 'fedora': {'23': '/usr/bin/python3'}, 'ubuntu': {'14': '/usr/bin/python', '16': '/usr/bin/python3'}} INTERPRETER_PYTHON_FALLBACK(default) = ['python3.10', 'python3.9', 'python3.8', 'python3.7', 'python3.6', 'python3.5', '/usr/bin/python3', '/usr/libexec/platform-python', 'python2.7', '/usr/bin/python', 'python']
ãã®ããã« /usr/libexec/platform-python 㧠AnsiballZ_ping.py ãå®è¡ãã¦ãã¾ãã>>> ã®ã¬ã¹ãã³ã¹ãè¦ã㨠âpongâ ãè¿ããã¦ãããã¨ããããã¾ããAnsible ã®ã¢ã¸ã¥ã¼ã«ã¯ JSON å½¢å¼ã§çµæãè¿ãç´æã«ãªã£ã¦ãã¾ãã
æ£å¸¸çµäº (rc=0) ãè¦ã¦ããã¾ãã
1523091 1664675305.30654: _low_level_execute_command(): starting 1523091 1664675305.30659: _low_level_execute_command(): executing: /bin/sh -c '/usr/libexec/platform-python /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/AnsiballZ_ping.py && sleep 0' <192.168.0.132> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.132> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' -tt 192.168.0.132 '/bin/sh -c '"'"'/usr/libexec/platform-python /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/AnsiballZ_ping.py && sleep 0'"'"'' 1523091 1664675305.31222: stderr chunk (state=2): >>>OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 ... <<< 1523091 1664675305.31286: stderr chunk (state=3): >>>debug3: mux_client_request_alive: done pid = 1523069 debug3: mux_client_request_session: session request sent <<< 1523091 1664675305.43192: stdout chunk (state=3): >>> {"ping": "pong", "invocation": {"module_args": {"data": "pong"}}} <<< 1523091 1664675305.44110: stderr chunk (state=3): >>>debug3: mux_client_read_packet: read header failed: Broken pipe debug2: Received exit status from master 0 Shared connection to 192.168.0.132 closed. <<< 1523091 1664675305.44191: stderr chunk (state=3): >>><<< 1523091 1664675305.44199: stdout chunk (state=3): >>><<< ... 1523091 1664675305.44222: _low_level_execute_command() done: rc=0, stdout= {"ping": "pong", "invocation": {"module_args": {"data": "pong"}}} , stderr=OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021 ... debug2: fd 4 setting O_NONBLOCK debug2: mux_client_hello_exchange: master version 4 debug3: mux_client_forwards: request forwardings: 0 local, 0 remote debug3: mux_client_request_session: entering debug3: mux_client_request_alive: entering debug3: mux_client_request_alive: done pid = 1523069 debug3: mux_client_request_session: session request sent debug3: mux_client_read_packet: read header failed: Broken pipe debug2: Received exit status from master 0 Shared connection to 192.168.0.132 closed. 1523091 1664675305.44261: done with _execute_module (ansible.builtin.ping, {'_ansible_check_mode': False, '_ansible_no_log': False, '_ansible_debug': True, '_ansible_diff': False, '_ansible_verbosity': 4, '_ansible_version': '2.13.0', '_ansible_module_name': 'ansible.builtin.ping', '_ansible_syslog_facility': 'LOG_USER', '_ansible_selinux_special_fs': ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p', 'vfat'], '_ansible_string_conversion_action': 'warn', '_ansible_socket': None, '_ansible_shell_executable': '/bin/sh', '_ansible_keep_remote_files': False, '_ansible_tmpdir': '/home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/', '_ansible_remote_tmp': '~/.ansible/tmp'})
ãã ping ã¢ã¸ã¥ã¼ã«ã§ã¯ãªãä»ã®ã¢ã¸ã¥ã¼ã«ã§ã©ã¤ãã©ãªã足ããªãããã«ã¨ã©ã¼ã¨ãªãã¨ãããããªãã¨ãããã°ãããã®ãããã詳ããè¦ã¦ãã㨠Python ã®ã¨ã©ã¼ãè¦ã¤ãããã¨ãããã¾ãã
9. ping ã¢ã¸ã¥ã¼ã«ããçæããã Python ã®ããã°ã©ã ãåé¤ãã
ã¢ã¸ã¥ã¼ã«ã®å®è¡ãçµãã£ãããéãã¤ããããã°ã©ã ããã£ã¬ã¯ããªãã¨åé¤ãã¾ãã3. ã§å®è¡ãã mkdir
ã³ãã³ãã«å¯¾å¿ãã¦ãrm -f -r
ã³ãã³ããå®è¡ãã¦ãã¾ãã
1523091 1664675305.44269: _low_level_execute_command(): starting 1523091 1664675305.44273: _low_level_execute_command(): executing: /bin/sh -c 'rm -f -r /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/ > /dev/null 2>&1 && sleep 0' <192.168.0.132> ESTABLISH SSH CONNECTION FOR USER: sugimura <192.168.0.132> SSH: EXEC sshpass -d10 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'User="sugimura"' -o ConnectTimeout=10 -o 'ControlPath="/home/sugimura/.ansible/cp/8577d474f2"' 192.168.0.132 '/bin/sh -c '"'"'rm -f -r /home/sugimura/.ansible/tmp/ansible-tmp-1664675305.0331209-1523091-142821774396486/ > /dev/null 2>&1 && sleep 0'"'"'' 1523091 1664675305.44857: stderr chunk (state=2): ... 1523091 1664675305.47347: _low_level_execute_command() done: rc=0, stdout=, stderr=OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021
10. ã¢ã¸ã¥ã¼ã«å®è¡ã®å¾å¦ç
ã¿ã¹ã¯ã®å®è¡ãçµãã£ãããè¿ããããã¼ã¿ã®æ´å½¢ãå¾å¦çããã¾ãã
1523091 1664675305.47359: handler run complete 1523091 1664675305.47371: variable 'ansible_facts' from source: unknown 1523091 1664675305.47436: variable 'ansible_facts' from source: unknown 1523091 1664675305.47461: attempt loop complete, returning result 1523091 1664675305.47465: _execute() done 1523091 1664675305.47467: dumping result to json 1523091 1664675305.47469: done dumping result, returning 1523091 1664675305.47477: done running TaskExecutor() for 192.168.0.132/TASK: ping [00505699-f612-c152-b54d-000000000008] 1523091 1664675305.47480: sending task result for task 00505699-f612-c152-b54d-000000000008 1523091 1664675305.47527: done sending task result for task 00505699-f612-c152-b54d-000000000008 1523091 1664675305.47531: WORKER PROCESS EXITING ok: [192.168.0.132] => { "ansible_facts": { "discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": false, "invocation": { "module_args": { "data": "pong" } }, "ping": "pong" } 1523087 1664675305.47873: no more pending results, returning what we have
ç°å¸¸ãªã¨ã
å ã»ã©ä¸ã§è¦ãã®ã¯æ£å¸¸ã«åä½ãã¦ããæµãã追ã£ã¦ã¿ããã®ã§ãã
ANSIBLE_DEBUG=true
㧠Ansible ããè¦ãå¦çã¨ãã¦ã¯æå³éãæµãã¦ããå ´åãããä¸ã®ã¬ã¤ã¤ã® SSH ã追ããããå¿
è¦ããããã¨ãããã¾ãã
ããã¼ã¸ããã¼ãã® /etc/ssh/sshd_config ãã¡ã¤ã«ã§ LogLevel DEBUG3
ã¨ãã¦ãsshd ãµã¼ãã¹ãåèµ·åãã¾ãã
$ sudo su -
# systemctl restart sshd
ããã¦å度 ansible-playbook -vvvv ...
ãå®è¡ãã¦ãããã¼ã¸ããã¼ãå´ã® /var/log/secure ãè¦ã¾ããä¾ãã° Python ã¤ã³ã¿ããªã¿ãæ¤åºãããããã§ã¯ããã®ãããªãã°ãåºã¦ãã¾ããã
Oct 2 11:51:00 rhel86 sshd[24024]: debug3: receive packet: type 90 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: server_input_channel_open: ctype session rchan 2 win 2097152 max 32768 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: input_session_request Oct 2 11:51:00 rhel86 sshd[24024]: debug1: channel 0: new [server-session] Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_new: session 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_open: channel 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_open: session 0: link with channel 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: server_input_channel_open: confirm session Oct 2 11:51:00 rhel86 sshd[24024]: debug3: send packet: type 91 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: receive packet: type 98 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: server_input_channel_req: channel 0 request env reply 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_by_channel: session 0 channel 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_input_channel_req: session 0 req env Oct 2 11:51:00 rhel86 sshd[24024]: debug2: Setting env 0: LANG=ja_JP.UTF-8 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: receive packet: type 98 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: server_input_channel_req: channel 0 request exec reply 1 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_by_channel: session 0 channel 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_input_channel_req: session 0 req exec Oct 2 11:51:00 rhel86 sshd[24024]: Starting session: command for sugimura from 192.168.0.130 port 35746 id 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: mm_audit_run_command entering command /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'python3.10'"'"'; command -v '"'"'python3.9'"'"'; command -v '"'"'python3.8'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0' Oct 2 11:51:00 rhel86 sshd[24024]: debug3: mm_request_send entering: type 114 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: mm_request_receive_expect entering: type 115 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: mm_request_receive entering Oct 2 11:51:00 rhel86 sshd[24024]: debug2: fd 17 setting O_NONBLOCK Oct 2 11:51:00 rhel86 sshd[24024]: debug2: fd 16 setting O_NONBLOCK Oct 2 11:51:00 rhel86 sshd[24024]: debug2: fd 19 setting O_NONBLOCK Oct 2 11:51:00 rhel86 sshd[24024]: debug3: mm_forward_audit_messages: entering Oct 2 11:51:00 rhel86 sshd[24024]: debug3: send packet: type 99 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: Received SIGCHLD. Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_by_pid: pid 24065 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_exit_message: session 0 channel 0 pid 24065 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: request exit-status confirm 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: send packet: type 98 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_exit_message: release channel 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: write failed Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: chan_shutdown_write (i0 o0 sock -1 wfd 16 efd 19 [read]) Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: send eow Oct 2 11:51:00 rhel86 sshd[24024]: debug3: send packet: type 98 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: output open -> closed Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: read<=0 rfd 17 len 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: read failed Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: chan_shutdown_read (i0 o3 sock -1 wfd 17 efd 19 [read]) Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: input open -> drain Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: read 0 from efd 19 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: closing read-efd 19 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: ibuf empty Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: send eof Oct 2 11:51:00 rhel86 sshd[24024]: debug3: send packet: type 96 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: input drain -> closed Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: send close Oct 2 11:51:00 rhel86 sshd[24024]: debug3: send packet: type 97 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: notify_done: reading Oct 2 11:51:00 rhel86 sshd[24024]: debug3: channel 0: will not send data after close Oct 2 11:51:00 rhel86 sshd[24024]: debug3: receive packet: type 97 Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: rcvd close Oct 2 11:51:00 rhel86 sshd[24024]: debug3: channel 0: will not send data after close Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: is dead Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: gc: notify user Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_by_channel: session 0 channel 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug1: session_close_by_channel: channel 0 child 0 Oct 2 11:51:00 rhel86 sshd[24024]: Close session: user sugimura from 192.168.0.130 port 35746 id 0 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: mm_audit_end_command entering command /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'python3.10'"'"'; command -v '"'"'python3.9'"'"'; command -v '"'"'python3.8'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0' Oct 2 11:51:00 rhel86 sshd[24024]: debug3: mm_request_send entering: type 116 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: session_unused: session id 0 unused Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: gc: user detached Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: is dead Oct 2 11:51:00 rhel86 sshd[24024]: debug2: channel 0: garbage collecting Oct 2 11:51:00 rhel86 sshd[24024]: debug1: channel 0: free: server-session, nchannels 1 Oct 2 11:51:00 rhel86 sshd[24024]: debug3: channel 0: status: The following connections are open:\r\n #0 server-session (t4 r2 i3/0 o3/0 e[closed]/0 fd -1/-1/-1 sock -1 cc -1)\r\n
ãã®ã¨ãã«çç®ããã®ã¯ä¸»ã«ãã®ãããªãã®ãè¦ã¦ããã¾ãã
- SSH ã® type
- channel 㮠open 㨠close
- éä¿¡ã¨åä¿¡ (read, write)
SSH ã® type ã¯ãRFC 4250 ã« Message Numbers ã¨ãã¦å®ç¾©ããã¦ãã¾ããchannel ã§ã¯ãã®ãããã追ãããã¾ãã
- SSH_MSG_CHANNEL_OPEN 90
- SSH_MSG_CHANNEL_EOF 96
- SSH_MSG_CHANNEL_CLOSE 97
- SSH_MSG_CHANNEL_REQUEST 98
- SSH_MSG_CHANNEL_SUCCESS 99
channel ã«ã¤ãã¦ã¯ RFC 4254 ãåæ§ã«è¦ã¦ããã¾ãããã¼ãã¼ãã®å ¥åºå以å¤ã«ãè¤æ°ã®ããã¨ããè¦ããªãã¨ããã§ã§ããããã«ãªã£ã¦ãã¾ãã
ä¸ã®ãã°ããã¯ãã®ãããªå½¢ã§èªã¿è§£ãã¦ããã¾ãã
- type 90 ã®è¦æ±ã«åºã¥ã㦠channel 0 ãéã
- ã¯ã©ã¤ã¢ã³ã㨠channel 0 ã使ããã¨ãåæ
- mm_audit_run_command ã«ããã³ãã³ãè¦æ±ãåãä»ã
- channel 0 ä¸ã§èªã¿æ¸ã
- çµãã£ãã session_close_by_channel 㧠channel 0 ãéãã
- mm_audit_end_command ã§ã³ãã³ãå®è¡ãçµäº
å®éã«åãåããã®ãã£ãäºä¾ã ã¨ããã® type 90 ã®ãã±ããã¯åä¿¡ãããã®ã®ãã´ã·ã¨ã¼ã·ã§ã³ã«è³ãããchannel ã確ç«ã§ããªãã£ãããã« Ansible ã®ã¢ã¸ã¥ã¼ã«å®è¡ã®å ¥åºåãæ£ããåã渡ãã§ããªãã£ããã¨ã«ãããã³ã³ããã¼ã«ãã¼ãå´ã§ã¯ãã¼ã¿ã®åãåãå¾ ã¡ã«ãªã£ã¦ã¿ã¤ã ã¢ã¦ãããã¨ãããã¨ãããã¾ããã
ssh ã³ãã³ãã§ãã°ã¤ã³ããã ãã§ãã¨æ°ãã channel ã確ç«ãããã¨ããªããããå½åã¯åé¡ã«æ°ãã¤ããã¨ã¯ããã¾ããã§ããããã®å¾ä¾ãã° vim ã³ãã³ãã§ãã¡ã¤ã«ãä½æãããããã¨ã¿ã¼ããã«ä¸ã§è¦ãã¦ããç»é¢ã®æ¸ãæãã®ããã«åæ§ã«æ°ãã channel ã確ç«ããå¦çãå®è¡ããããã¨ãããããåé¡ã®ç¹å®ãåç¾ã«å½¹ã«ç«ã£ãã®ãè¦ãã¦ãã¾ãã
ãããåé ã®ä¾ã«æããã22/tcp ã¯è¨±å¯ããã¦ãããã®ã®ãå¿ è¦ãªéä¿¡ãä¸ç¶æ©å¨ã§é®æãã¦ãããã«ãã£ã¦çºçãããã®ã§ãVPN è£ ç½®å´ã§å ¨ã¦ã® SSH ã®éä¿¡ãã±ãããéãã¦ããªãã£ããã¨ãçãããã¨ãããã¨ã§åé¡è§£æ¶ã¨ãªãã¾ããã
ã¾ã¨ã
æãç°¡å㪠ping ã¢ã¸ã¥ã¼ã«ã§ã®å¦çã«ã¤ãã¦ãä¸éãä½ãè¡ããã¦ããããç´¹ä»ãã¾ããã
SSH ã§æ¥ç¶ãã¦ãã¡ã¤ã«ãéåä¿¡ãããã³ãã³ãã®å®è¡çµæãåãåãã¨ãããã¨ã§ããããã ãã®æ·±ãå 容ãããã¾ããããã«èªè¨¼ãéµäº¤æãªã©ãå«ããã¨ããããæãä¸ãããã¨ãããã¾ãã
å®éã®æ°å以ä¸ããã¢ã¸ã¥ã¼ã«ã§ã¯ããããä½ããã®èªååã®å¦çãå®è¡ãã¾ãã®ã§ããã©ãã«ã®å 容ã«ãã£ã¦ã¯ãã®ä¸èº«ã追ãããããã¨ãããã¾ããããã¾ã§ãã±ããã®ã¬ãã«ã¾ã§è¦ã¦ãããã¨ã¯ãã¾ãé »åº¦ã¯å¤ãããã¾ããããåé¡ã«ãã£ã¦ãã¾ãã¾ãªæ¹æ³ã試ãã¦ãã¾ãã
Ansible Automation Platform ã®è©ä¾¡ã©ã¤ã»ã³ã¹ãªã¯ã¨ã¹ãã¯ãã¡ããããå©ç¨ããã ãã¾ãã60æ¥éå©ç¨ã§ãã¾ãã
Happy Automation!