Problem setting up the bash environment with playbook.

128 views
Skip to first unread message

Darup tek

unread,
Aug 13, 2014, 6:17:44 PM8/13/14
to ansible...@googlegroups.com
I am trying to execute the commands over playbook.

  - name: Configure open-pbis
    action: command /opt/pbis/bin/config LoginShellTemplate /bin/bash
    action: command /opt/pbis/bin/config AssumeDefaultDomain true


It is not setting the bash environment when I execute it with anisble-playbook.
[root@xxxxxxxxx~]# su - yyyy
-sh-4.1$ env|grep SHELL
SHELL=/bin/sh
-sh-4.1$

Whereas, it is working absolutely fine when I execute the command " /opt/pbis/bin/config LoginShellTemplate /bin/bash"
[yyyyy@xxxxxxxxxxxxxxxxxxxx ~]$ env|grep SHELL
SHELL=/bin/bash

Is there any thing special I have to do to make sure the command is executed as it is, it should reflect the bash as SHELL.


Thanks


Darup tek

unread,
Aug 13, 2014, 8:22:08 PM8/13/14
to ansible...@googlegroups.com
It worked after I moved the command to another task section
- name: Configure open-pbis login shell
    command: '/opt/pbis/bin/config LoginShellTemplate /bin/bash'
  - name: Configure open-pbis default domain
    command: /opt/pbis/bin/config AssumeDefaultDomain true


Can I cascade commands one after the other after from one section ?

Michael DeHaan

unread,
Aug 14, 2014, 7:53:37 AM8/14/14
to ansible...@googlegroups.com
Ansible doesn't use the host environment files like .bashrc because it's inconsistent if you have many hosts, it encourages centralized management.

To set environment variables, see this feature:





--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/774f90a8-c3e2-421e-8e75-49ef2a102866%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages