Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to set the oracle environment and run crsctl command #144

Open
akshaynbora opened this issue May 12, 2020 · 1 comment
Open

Not able to set the oracle environment and run crsctl command #144

akshaynbora opened this issue May 12, 2020 · 1 comment

Comments

@akshaynbora
Copy link

Hi ,

I am not able to set the oracle environment and hence cant run crsctl commands. I wrote below code. Someone please suggest me.


  • hosts: all
    vars_prompt:
    • name: SID
      prompt: "Enter the Oracle SID"
      private: no
    • name: HOME
      prompt: "Enter the Oracle HOME"
      private: no
      tasks:
    • name: Setup the environemtnal variable
      shell:
      export ORACLE_SID={{ SID }}
      export ORACLE_HOME={{ HOME }}
      export PATH=$PATH:$ORACLE_HOME/bin
      crsctl stat res -t
      [oracle@rac2 ~]$
@oravirt
Copy link
Owner

oravirt commented May 12, 2020

Hi,
Do you have a problem with one of the modules in this repo or is this just a general Ansible question? If it is the latter this (https://groups.google.com/forum/#!forum/ansible-project) is probably a better place to ask.

Anyway, if you want to inject environment variables into your play, you should use the environment keyword in your playbook
e.g
(https://docs.ansible.com/ansible/latest/user_guide/playbooks_environment.html)

- name: run crsctl
  shell: $ORACLE_HOME/bin/crsctl stat res -t
  environment:
          ORACLE_SID: "xxx"
          ORACLE_HOME: "yyy"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants