<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                使用when關鍵字,當when后面指定的條件滿足時,該tasks中指定的某個任務才會被執行 1)When語句 * 在when后面使用表達式,當表達式結果為True則執行 案例: ~~~ tasks: - name: "shut down Debian flavored systems" command: /sbin/shutdown -t now when: ansible_os_family == "Debian" (當操作系統為debian時就執行關機操作) --- - hosts: webserver user: admin become: yes vars: - username: user01 tasks: - name: create {{ username }} user user: name={{ username }} when: ansible_fqdn == "node2.51yuki.cn" (當主機名為node2.51yuki.cn就在該機器上創建用戶user01) ~~~ ~~~ --- - hosts: webserver user: admin become: yes tasks: - name: host 192.168.20.138 run this task debug: msg="{{ansible_default_ipv4.address}}" when: ansible_default_ipv4.address == "192.168.20.138" - name: all host run this task shell: hostname register: info - name: hostname is node2 run this task debug: msg="{{ansible_fqdn}}" when: info['stdout']=="node2.51yuki.cn" ~~~ * 可以使用列表形式來表示,當多個條件同時滿足才執行 ~~~ tasks: - name: "shut down CentOS 6 systems" command: /sbin/shutdown -t now when: - ansible_distribution == "CentOS" - ansible_distribution_major_version == "6" (只有當系統是centos,并且版本為6的機器上執行) ~~~ * 使用變量進行判斷 ~~~ vars: epic: true tasks: - shell: echo "This certainly is epic!" when: epic ~~~ * 與循環一起使用 ~~~ tasks: - command: echo {{ item }} with_items: [ 0, 2, 4, 6, 8, 10 ] when: item > 5 ~~~ * 角色包含使用when ~~~ - include: tasks/sometasks.yml when: "'reticulating splines' in output" - hosts: webservers roles: - { role: debian_stock_config, when: ansible_os_family == 'Debian' } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看