From db55402fb8e00e94c1f4d89012e5ba5e08e59531 Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 18 Jul 2023 18:05:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=91=BD=E4=BB=A4=E6=97=B6=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=8C=85=E5=90=AB=20[=20=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E6=89=A7=E8=A1=8C=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98(issue:=2010986)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/ansible/inventory.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/ops/ansible/inventory.py b/apps/ops/ansible/inventory.py index 80922859b..b1a03fc30 100644 --- a/apps/ops/ansible/inventory.py +++ b/apps/ops/ansible/inventory.py @@ -268,6 +268,7 @@ class JMSInventory: data = {'all': {'hosts': {}}} for host in hosts: name = host.pop('name') + name = name.replace('[', '_').replace(']', '_') data['all']['hosts'][name] = host if self.exclude_localhost and data['all']['hosts'].__contains__('localhost'): data['all']['hosts'].update({'localhost': {'ansible_host': '255.255.255.255'}})