Hero Image
Misspelling, missing collection, or incorrect module path for fortios_system_config_backup_restore

Misspelling, missing collection, or incorrect module path for fortios_system_config_backup_restore issue Hi, I’m trying to retrieve the configuration from a Fortigate using the module fortios_system_config_backup_restore and basing on your playbook example. I have ansible 2.10.6. When I use the collection fortinet.fortios:1.1.8, I got the following error: missing 1 required positional argument: 'mod' The full traceback is: Traceback (most recent call last): File "/home/ansible/.ansible/tmp/ansible-local-8668osvgufxk/ansible-tmp-1615481963.0092971-8768-3877705280026/AnsiballZ_fortios_system_config_backup_restore.py", line 102, in <module> _ansiballz_main() File "/home/ansible/.ansible/tmp/ansible-local-8668osvgufxk/ansible-tmp-1615481963.0092971-8768-3877705280026/AnsiballZ_fortios_system_config_backup_restore.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/ansible/.ansible/tmp/ansible-local-8668osvgufxk/ansible-tmp-1615481963.0092971-8768-3877705280026/AnsiballZ_fortios_system_config_backup_restore.py", line 40, in invoke_module runpy.run_module(mod_name='ansible_collections.fortinet.fortios.plugins.modules.fortios_system_config_backup_restore', init_globals=None, run_name='__main__', alter_sys=True) File "/usr/lib/python3.8/runpy.py", line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/tmp/ansible_fortinet.fortios.fortios_system_config_backup_restore_payload_mplamrs7/ansible_fortinet.fortios.fortios_system_config_backup_restore_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_config_backup_restore.py", line 472, in <module> File "/tmp/ansible_fortinet.fortios.fortios_system_config_backup_restore_payload_mplamrs7/ansible_fortinet.fortios.fortios_system_config_backup_restore_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_config_backup_restore.py", line 436, in main TypeError: __init__() missing 1 required positional argument: 'mod' fatal: [fortigate-01]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/ansible/.ansible/tmp/ansible-local-8668osvgufxk/ansible-tmp-1615481963.0092971-8768-3877705280026/AnsiballZ_fortios_system_config_backup_restore.py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/ansible/.ansible/tmp/ansible-local-8668osvgufxk/ansible-tmp-1615481963.0092971-8768-3877705280026/AnsiballZ_fortios_system_config_backup_restore.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/ansible/.ansible/tmp/ansible-local-8668osvgufxk/ansible-tmp-1615481963.0092971-8768-3877705280026/AnsiballZ_fortios_system_config_backup_restore.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.fortinet.fortios.plugins.modules.fortios_system_config_backup_restore', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_fortinet.fortios.fortios_system_config_backup_restore_payload_mplamrs7/ansible_fortinet.fortios.fortios_system_config_backup_restore_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_config_backup_restore.py\", line 472, in <module>\n File \"/tmp/ansible_fortinet.fortios.fortios_system_config_backup_restore_payload_mplamrs7/ansible_fortinet.fortios.fortios_system_config_backup_restore_payload.zip/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_config_backup_restore.py\", line 436, in main\nTypeError: __init__() missing 1 required positional argument: 'mod'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } Using the recent pre release fortinet.fortios:2.0.0 , I got:

Hero Image
【理解 Cilium 系列文章】(一) 初識 Cilium

【理解 Cilium 系列文章】(一) 初識 Cilium 當前 k8s Service 負載均衡的實現現狀 在 Cilium 出現之前, Service 由 kube-proxy 來實現,實現方式有 userspace , iptables , ipvs 三種模式。 Userspace 當前模式下,kube-proxy 作為反向代理,監聽隨機端口,通過 iptables 規則將流量重定向到代理端口,再由 kube-proxy 將流量轉發到 後端 pod。Service 的請求會先從用户空間進入內核 iptables,然後再回到用户空間,代價較大,性能較差。 Iptables 存在的問題: 1.可擴展性差。隨着 service 數據達到數千個,其控制面和數據面的性能都會急劇下降。原因在於 iptables 控制面的接口設計中,每添加一條規則,需要遍歷和修改所有的規則,其控制面性能是 O(n²) 。在數據面,規則是用鏈表組織的,其性能是 O(n) 2.LB 調度算法僅支持隨機轉發 Ipvs 模式 IPVS 是專門為 LB 設計的。它用 hash table 管理 service,對 service 的增刪查找都是 O(1)的時間複雜度。不過 IPVS 內核模塊沒有 SNAT 功能,因此借用了 iptables 的 SNAT 功能。 IPVS 針對報文做 DNAT 後,將連接信息保存在 nf_conntrack 中,iptables 據此接力做 SNAT。該模式是目前 Kubernetes 網絡性能最好的選擇。但是由於 nf_conntrack 的複雜性,帶來了很大的性能損耗。騰訊針對該問題做過相應的優化 【繞過 conntrack,使用 eBPF 增強 IPVS 優化 K8s 網絡性能】

Hero Image
Day 28 - Kubernetes 第三方好用工具介紹

Day 28 - Kubernetes 第三方好用工具介紹 $ kubectl get pods NAME READY STATUS RESTARTS AGE ithome-6564f65698-947rv 1/1 Running 0 84s ithome-6564f65698-fglr9 1/1 Running 0 84s ithome-6564f65698-k5wtg 1/1 Running 0 84s ithome-6564f65698-rrvk4 1/1 Running 0 84s ithome-6564f65698-zhwlj 1/1 Running 0 84s Stern/Kail 創建出來的 Pod 名稱上面都會有一些不好閱讀的亂數 如果使用 kubectl 來觀察個別 Pod 的 log 就必須要於不同的 pod 之間來回切換 這方面的工具滿多的,譬如 Stern, Kube-tail, Kail 等都可以 上述範例會有五個 pod,而且這五個 pod 的名稱都是 ithome 開頭,因此我可以直接用 stern ithom 的方式來抓取這些 pod 的資訊,結果如下圖 $ stern ithome ... ithome-6564f65698-zhwlj netutils Hello! 369 secs elapsed... ithome-6564f65698-fglr9 netutils Hello! 369 secs elapsed... ithome-6564f65698-947rv netutils Hello! 367 secs elapsed... ithome-6564f65698-k5wtg netutils Hello! 368 secs elapsed... ithome-6564f65698-rrvk4 netutils Hello! 369 secs elapsed... ithome-6564f65698-zhwlj netutils Hello! 370 secs elapsed... ithome-6564f65698-fglr9 netutils Hello! 370 secs elapsed... ithome-6564f65698-947rv netutils Hello! 368 secs elapsed... ithome-6564f65698-k5wtg netutils Hello! 370 secs elapsed... ithome-6564f65698-rrvk4 netutils Hello! 370 secs elapsed... ithome-6564f65698-zhwlj netutils Hello! 371 secs elapsed... ithome-6564f65698-fglr9 netutils Hello! 371 secs elapsed... ithome-6564f65698-947rv netutils Hello! 369 secs elapsed... ithome-6564f65698-k5wtg netutils Hello! 371 secs elapsed... ithome-6564f65698-rrvk4 netutils Hello! 371 secs elapsed... ithome-6564f65698-zhwlj netutils Hello! 372 secs elapsed... ithome-6564f65698-fglr9 netutils Hello! 372 secs elapsed... ^C K9S 過往總是透過 kubectl 指令於各個資源,各 namespace 間切來切去,特別是要使用 exec, get, describe, logs, delete 等指令時,常常打的手忙腳亂或是覺得心累,有這種困擾的人可以考慮使用看看 k9s 這個工具