Conflicting action statement in ansible

Here is the problem, you have mixed up two tasks into one:

---
- hosts: webhost
  sudo: yes
  connection: ssh

  tasks:
    - name: debuging module
      shell: ps aux
      register: output

    - name: show the value of output
      debug: var=output

And out put of the playbook will be like this:

PLAY [all] *********************************************************************

TASK [setup] *******************************************************************
ok: [192.168.33.100]

TASK [debuging module] *********************************************************
changed: [192.168.33.100]

TASK [show the value of output] ************************************************
ok: [192.168.33.100] => {
    "output": {
        "changed": true,
        "cmd": "ps aux",
        "delta": "0:00:00.004981",
        "end": "2016-06-26 06:25:22.975876",
        "rc": 0,
        "start": "2016-06-26 06:25:22.970895",
        "stderr": "",
        "stdout": "USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nroot         1  0.8  0.2  24432  2380 ?        Ss   06:23   0:00 /sbin/init\nroot         2  0.0  0.0

Hope that help you

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)