0

Im trying to run playbooks on ranchesOS server.

- 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

while running this playbook is executing successfully but server is not coming up.

  • 1
    "server is not coming up." ... but instead does ... ? and if the playbook executed successfully, then your question belongs on https://ServerFault.com because it is now a "what is wrong with my ros machine" and not "what is wrong with ansible" – mdaniel Dec 02 '20 at 17:12
  • 1
    Also, it's always hard to tell with these SO questions, but *as written* your cloud-config yaml looks suspicious to me, given the *null* `rancher:` key – mdaniel Dec 02 '20 at 17:14

0 Answers0