Loops 如何在brocade'中使用循环;可更换存储模块

Loops 如何在brocade'中使用循环;可更换存储模块,loops,time,module,ansible,execution,Loops,Time,Module,Ansible,Execution,我是存储管理员,目前正在使用brocade fos命令ansible模块,希望将循环放入任务中,但playbook每次尝试连接循环的每个元素,因此执行时间变慢 以下是基本yaml文件: tasks: - name: alicreate in B fabric for total_path_number=2 brocade_fos_command: switch_login: "x" switch_passw

我是存储管理员,目前正在使用brocade fos命令ansible模块,希望将循环放入任务中,但playbook每次尝试连接循环的每个元素,因此执行时间变慢

以下是基本yaml文件:

tasks:
      - name: alicreate in B fabric for total_path_number=2
        brocade_fos_command:
          switch_login:  "x"
          switch_password:  "x”
          switch_address:  "x.x.x.x"
          command_set:
      
            - command: alicreate "{{ hostname1}}"_1B, "{{ hostwwn_Bfabric1}}"
            - command: alicreate "{{ hostname2}}"_1B, "{{ hostwwn_Bfabric2}}"
                
            - command: cfgenable SW_B1
              prompts:
                - question: Do you want to 
                  response: "yes"          
        register: configout
以下是我想要的,而不是上面的yaml:

  tasks:
      - name: alicreate in B fabric for total_path_number=2
        brocade_fos_command:
          switch_login:  "x"
          switch_password:  "x"
          switch_address:  "x.x.x.x"
          command_set:
      
            - command: alicreate "{{ host.hostname }}"_1B, "{{ host.hostwwn_Bfabric }}"                   
            - command: cfgenable SW_B1
              prompts:
                - question: Do you want to 
                  response: "yes"          
        register: configout
        register: result
        retries: 3
        delay: 10
        until: result is not failed   
      
              
        loop: "{{ hosts }}"
        loop_control:
          loop_var: host
有什么建议吗?提前谢谢