Mark Maas wrote:
> Hi List,
>
> I'm trying to reboot a server from a playlist and then have the playlist
> wait for the server to come back before continuing with it's next action.
>
> So this is the playbook part:
>
> ---
> - hosts: 10.137.0.145
> user: mark
> sudo: true
> vars:
> hostname: servername01
> sid: ABC2
> tasks:
> - name: Make /etc/hostname/ correct
> action: lineinfile dest=/etc/hostname backup=true state=present
> regexp=^ line='$hostname'
> - name: Reboot
> action: command /sbin/reboot
> - name: Wait for it to come back
> local_action: wait_for host=10.137.0.145 port=22 delay=5 timeout=300
What you want here is a
sudo: False
to disable sudo for this task.
Daniel
> <other actions follow this>
>
>
> And this is the error it gives me:
>
> sudo password:
>
> PLAY [10.137.0.145] *********************
>
> GATHERING FACTS *********************
> ok: [10.137.0.145]
>
> TASK: [Make /etc/hostname/ correct] *********************
> ok: [10.137.0.145] => {"changed": false, "msg": ""}
>
> TASK: [Reboot] *********************
> changed: [10.137.0.145] => {"changed": true, "cmd": ["/sbin/reboot"],
> "delta": "0:00:00.069021", "end": "2012-11-07 14:51:07.350678", "rc": 0,
> "start": "2012-11-07 14:51:07.281657", "stderr": "", "stdout": ""}
>
> TASK: [Wait for it to come back] *********************
> fatal: [10.137.0.145] => sudo with password is presently only supported on
> the 'paramiko' (SSH) and native 'ssh' connection types
>
> FATAL: all hosts have already failed -- aborting
>
> PLAY RECAP *********************
> 10.137.0.145 : ok=3 changed=1 unreachable=1
> failed=0
>
>
> So I'm doing something wrong here. Any idea's?
>
> Thanks,
> Mark
>
> --
>
>
>