0

我试图在 ranchesOS 服务器上运行剧本。

- hosts: rancher
  tasks:
    - name: Insert/Update eth0 configuration stanza in /etc/network/interfaces
      blockinfile:
       path: ros.yaml
       block: |
          #cloud-config
          rancher:
          console: ubuntu
          runcmd:
              - [ apt-get, install, -y, curl ]
              - [ apt-get, install, -y, zip ]
    - name: merge
      become: yes
      command: ros config merge -i ros.yaml
    - name: Reboot immediately if there was a change.
      shell: "sleep 5 && reboot"
      register: reboot
    - debug:
         msg=reboot.stdout
    - name: Wait for the reboot to complete if there was a change.
      become: yes
      wait_for_connection:
         connect_timeout: 20
         sleep: 5
         delay: 5
         timeout: 300

运行此剧本时成功执行,但服务器未启动。

4

0 回答 0