On 22/02/19 7:29 PM, visar wrote:
Hello Sudheer,

Yes, Password required for any action . because my user "admin" is created and added to sudoers group in staging environment where the playbook is failing.

 Whereas in my development environment the playbook was working as there i jhad root user password.

For such situations, I would enable the 'admin' user to escalate privileges with sudo without specifying password. You can configure sudoer's to escalate privilege without password.

Would that resolve your problem?

-

Sudheer


On Friday, February 22, 2019 at 7:22:33 PM UTC+5:30, Sudheer S wrote:


    On 22/02/19 7:19 PM, visar wrote:
    Hello Sudeer.. No luck.

    Logon to the server manually as admin and try doing something like
    `sudo ls`.  See if password is required on the server.

    -

    Sudheer


    |
    ---

    - name: Replace the silent-install-server_ file to each
    Application Servers
      hosts: localhost,CCM,RM
      become: true
      vars:
        jts_file:
    /etc/ansible/roles/IBM2/files/silent-install-server_JTS.xml
        ccm_file:
    /etc/ansible/roles/IBM2/files/silent-install-server_CCM.xml
        rm_file:
    /etc/ansible/roles/IBM2/files/silent-install-server_RM.xml
        dest_dir: /opt/CLM-Web-Installer-Linux-6.0.5/im/linux.gtk.x86_64
      tasks:
        - name: check the folder existance
          stat:
    path=/opt/CLM-Web-Installer-Linux-6.0.5/im/linux.gtk.x86_64
          register: folder_exist

        - name: JTS Server
          copy:
            src: "{{ jts_file }}"
            dest: "{{ dest_dir }}/"
            mode: 777
            backup: yes
          delegate_to: localhost
          when: folder_exist.stat.exists == True

        - name: CCM Server
          copy:
            src: "{{ ccm_file }}"
            dest: "{{ dest_dir }}/"
            mode: 777
            backup: yes
          delegate_to: 10.16.24.102
          when: folder_exist.stat.exists == True

        - name: RM Server
          copy:
            src: "{{ rm_file }}"
            dest: "{{ dest_dir }}/"
            mode: 777
            backup: yes
          delegate_to: 10.16.24.103
          when: folder_exist.stat.exists == True

    |




    Output
    ________
    |
    PLAY [Replace the silent-install-server_ file to each Application
    Servers]
    
**********************************************************************************

    TASK [Gathering Facts]
    
**************************************************************************************************************************************
    fatal: [10.16.24.102]: FAILED! => {"changed": false,
    "module_stderr": "Shared connection to 10.16.24.102 closed.\r\n",
    "module_stdout": "sudo: a password is required\r\n", "msg":
    "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
    fatal: [10.16.24.103]: FAILED! => {"changed": false,
    "module_stderr": "Shared connection to 10.16.24.103 closed.\r\n",
    "module_stdout": "sudo: a password is required\r\n", "msg":
    "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
    ok: [localhost]

    TASK [check the folder existance]
    
***************************************************************************************************************************
    ok: [localhost]

    TASK [JTS Server]
    
*******************************************************************************************************************************************
    ok: [localhost -> localhost]

    TASK [CCM Server]
    
*******************************************************************************************************************************************
    fatal: [localhost]: FAILED! => {"msg": "Failed to get information
    on remote file
    
(/opt/CLM-Web-Installer-Linux-6.0.5/im/linux.gtk.x86_64/silent-install-server_CCM.xml):
    Shared connection to 10.16.24.102 closed.\r\n"}
            to retry, use: --limit
    @/etc/ansible/roles/IBM2/tasks/best/silentiInstallerfile1.retry

    PLAY RECAP
    
**************************************************************************************************************************************************
    10.16.24.102        : ok=0    changed=0 unreachable=0    failed=1
    10.16.24.103        : ok=0    changed=0 unreachable=0    failed=1
    localhost           : ok=3    changed=0 unreachable=0    failed=1

    |



    On Friday, February 22, 2019 at 7:06:28 PM UTC+5:30, Sudheer S
    wrote:

        On 22/02/19 6:58 PM, visar wrote:
        > Hello Experts,
        >
        > I had a working playbook in my test environment, where my
        user was
        > root user itslef and didnt have any issue.
        > When i moved my playbook to staging environment , there my
        login user
        > account is "admin" which is sudo user. But all of my
        playbooks are
        > failing in this environment.
        Have this in your playbook:

        become: true

        -

        Sudheer S

-- You received this message because you are subscribed to the
    Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected] <javascript:>.
    To post to this group, send email to [email protected]
    <javascript:>.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/ansible-project/b2c2673b-9961-4e53-b22a-7f72c4548e25%40googlegroups.com
    
<https://groups.google.com/d/msgid/ansible-project/b2c2673b-9961-4e53-b22a-7f72c4548e25%40googlegroups.com?utm_medium=email&utm_source=footer>.
    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8fd0dcb3-5fd7-4ab2-b92d-30a2de58e4cd%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/8fd0dcb3-5fd7-4ab2-b92d-30a2de58e4cd%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/615d68d9-0db6-5a7e-46c8-c65679258404%40techchorus.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to