Hi,
How will I get only the sql statement from the json output ? I am
registering this as " register: query_result"
Here is my json output
"msg": {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"failed
Thanks Hugo for helping me. Basically I am running a sql command that runs
a sql query which gives the below results. (this is a debug out)
"msg": {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"failed":
Thank you so much Vlado. This works fine.
On Tuesday, February 11, 2020 at 5:40:05 PM UTC-5, Vladimir Botka wrote:
>
> On Tue, 11 Feb 2020 14:02:45 -0800 (PST)
> Anand Solomon > wrote:
>
> > I need to get this
> > Revoke EXECUTE on UTL_FILE from TESTACC1; Revoke
Instead of maintaining another template file. Can I embed the content in
the playbook itself ?
On Tuesday, February 11, 2020 at 5:57:09 PM UTC-5, Anand Solomon wrote:
>
> Thank you so much Vlado. This works fine.
>
> On Tuesday, February 11, 2020 at 5:40:05 PM UTC-5, Vladimir
I get --> localhost]: FAILED! => {"changed": false, "msg": "dest is
required"}
Is that something I am missing ?
On Tuesday, February 11, 2020 at 6:06:42 PM UTC-5, Vladimir Botka wrote:
>
> On Tue, 11 Feb 2020 14:59:04 -0800 (PST)
> Anand Solomon > wrote:
>
Thank you so much Vlado.
It works fine.
On Wednesday, February 12, 2020 at 1:49:13 PM UTC-5, Vladimir Botka wrote:
>
> On Wed, 12 Feb 2020 08:51:12 -0800 (PST)
> Anand Solomon > wrote:
>
> > - name: Generate Revoke Statement
> > local_action:
> >
Hi,
What is the best way to loop the below KEY : VALUE ?
*main.yml*
var_files:
- /home/ansible/sqlvar.yml
- name: Script
oracle_sql:
sql: {{Value}}
environment: "{{oracle_env}}"
register: query_result
connection: local
- name: Runs statements
command: $ORACLE_HOME/sqlplus -s {{u
On Wed, 12 Feb 2020 18:02:20 -0800 (PST)
> Anand Solomon > wrote:
>
> > What is the best way to loop the below KEY : VALUE ?
> > [...]
> > sqlvar.yml
> > Key: Value
> > Script1: select username from dba_users;
> > Script2: select f
Basically I want to read sqlvar.yml, pass the "select username from
dba_users;" to SQLID and "Script1" to SQLQRY one by one.
On Wednesday, February 12, 2020 at 10:52:32 PM UTC-5, Anand Solomon wrote:
>
> You helped me Vlado. Thanks again. This works very well.
>
ame}}
@/home/ansible/Playbooks/{{sname}}/sql/{{sqlid}}_revoke.sql
environment: "{{oracle_env}}"
register: sqloutput
connection: local
On Wednesday, February 12, 2020 at 11:22:46 PM UTC-5, Vladimir Botka wrote:
>
> On Wed, 12 Feb 2020 19:52:31 -0800 (PST)
>
ool /home/ansible/Playbooks/{{sname}}/log/{{item.key}}.log
{% for line in query_result.msg |flatten %}
{{ line }}
{% endfor %}
spool off;
delegate_to: localhost
connection: local
loop: "{{ scripts|dict2items }}"
How do I capture onl
},
"item": {
"key": "Script1",
"value": "select name from v$database;"
},
"msg": [
[
"LCKTSTDB&
STSCH;"
> ]
> ]
> }
> ]
> }
> }
---
I just want to get the one extract the below value and pass it on.
[
"Revoke EXECUTE on UTL_FILE from TESTDBA;"
],
[
[
"Revoke EXECUTE on UTL_FILE from TESTDBA;"
],
[
"Revoke EXECUTE on UTL_FILE from TSTSCH;"
]
Here is my Jinja template
- name: Generate Revoke Statement
the dictionary to "take
> the
> values".
>
> On Thu, 13 Feb 2020 11:52:30 -0800 (PST)
> Anand Solomon > wrote:
>
> > I want to parse the json output an
>
> On Thu, 13 Feb 2020 13:33:32 -0800 (PST)
> Anand Solomon > wrote:
>
> > - name: Display the query results
> > debug:
> > msg: "{{query_result.msg}}
> >
> > I get the below
> > "msg": "All items complet
Thanks Rache,
This didn't solve the issue. I need to read the content in the "msg" in
"results" section
On Friday, February 14, 2020 at 7:52:31 AM UTC-5, Stefan Hornburg (Racke)
wrote:
>
> On 2/14/20 1:31 PM, Anand Solomon wrote:
> > Thanks Vla
"Revoke EXECUTE on UTL_FILE from TSTSCH;"
]
]
On Friday, February 14, 2020 at 8:28:12 AM UTC-5, Stefan Hornburg (Racke)
wrote:
>
> On 2/14/20 2:10 PM, Anand Solomon wrote:
> > Thanks Rache,
> > This didn't solve the issue. I need t
Hi, I still don’t have an answer for this. Is there someone to help me ?
--
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-project+unsubscr...@googlegro
Hi,
I basically wanted to skip the remaining of the playbook if a file exists
- name: Check if the file exists
stat:
path: /home/ansible/dbname/sql/file.sql
register: optional_file
- debug:
msg: "File Exists"
when: optional_file.stat.exists == True
Also
Thanks I got this working.
On Friday, January 24, 2020 at 3:37:43 PM UTC-5, Dick Visser wrote:
>
> meta: end_play
> is what you want
>
> https://docs.ansible.com/ansible/latest/modules/meta_module.html
>
>
> On Fri, 24 Jan 2020 at 21:01, Anand Solomon > wrote:
>
&
Hi,
I am trying to run a sql script which has simple select statement. (select
username from dba_users). Will oracle_sql module run a "Select" statement
and returns the results ?
My playbook is
- name: Script will creates Oracle DBA IDs and Profiles on AWS RDS.
oracle_sql:
us
I am trying to create oracle user using oracle_user module in a RDS server.
Here is my playbook
- hosts: all
vars:
oracle_home: /home/ansible/instantclient_12_2
user: SYSDBA
password: **
prt: "1521"
hostname: "RDS Instance"
sname: TESTDB
oracle_env:
ORACLE_
Hi,
I want to create users in the database using Ansible. I need ansible to run
the task (creating user) for all the users mentioned in the vars:
schemaname. How do I do that in loop ?
var:
schemaname: user1, user2, user3
tasks:
- name: This playbook will create the user.
oracle_
Yes, All I want to create is the user from the list (vars). This will be
hard coded value from the vars and the password will be the same for all
the users.
On Monday, January 27, 2020 at 10:34:25 AM UTC-5, Dick Visser wrote:
>
> On Mon, 27 Jan 2020 at 15:57, Anand Solomon &
ame }}"
>
>
> If you get that comma delimited string from somewhere else (which I
> asked but got no response to), then you'd have to manually split and
> trim:
>
> loop: "{{ schemaname.split(',') | map('trim') | list }}"
>
>
>
&g
Looks like we can only use sql parameter in oracle_sql module.
On Saturday, January 25, 2020 at 5:30:05 PM UTC-5, Dick Visser wrote:
>
> This isn't a module that ships with ansible, please contact the
> module's authors for support.
>
> On Sat, 25 Jan 2020 at 16:0
Hi,
I am running the below playbook and I am getting errors when having 'state:
absent', but when I have 'present', it works fine.
tasks:
- name: This playbook will create the user.
oracle_grants:
user: "{{user}}"
password: "{{password}}"
service_name:
keep the comments and execute the sql script ?
On Saturday, January 25, 2020 at 5:17:44 PM UTC-5, Dick Visser wrote:
>
> Hi
>
> Ansible doesn’t have such a module, so I assume this is a 3rd party module?
> In that case you might have more luck asking the module’s authors for
>
done .
###
*/
On Tuesday, January 28, 2020 at 12:18:33 PM UTC-5, Stefan Hornburg (Racke)
wrote:
>
> On 1/28/20 6:05 PM, Anand Solomon wrote:
> > Hi,
> > I am using oracle_sql module and running a sql
done .
###
*/
set serveroutput on;
select username from dba_users;
/
..
On Tuesday, January 28, 2020 at 12:34:00 PM UTC-5, Stefan Hornburg (Racke)
wrote:
>
> On 1/28/20 6:31 PM, An
I am trying to use oracle_privs module to revoke privileges in account.
Below is my playbook
tasks:
- name: This playbook will grant or revoke privilges in the user.
oracle_privs:
user: "{{user}}"
password: "{{password}}"
service_name: "{{sname}}"
port
ne that:
>
> https://github.com/oravirt/ansible-oracle-modules/issues
>
> So, please don’t cross post questions regarding those modules to this
> list.
>
> Thx !
>
> On Tue, 28 Jan 2020 at 15:23, Anand Solomon > wrote:
>
>> Hi,
>>
>> I am runn
Hi,
How do I take only the text from the below from json created by an ansible
register
I have this
- name: Display the query results
debug:
msg: "{{ query_result }}"
and I get [["TESTDBA"]], I want the value to be TESTDBA. Basically I am
passing this value to another paramet
Hi,
Thank you so much. I made this work by commenting with -- instead of #
Thank you for your help.
On Tuesday, January 28, 2020 at 3:38:06 PM UTC-5, Stefan Hornburg (Racke)
wrote:
>
> On 1/28/20 7:05 PM, Anand Solomon wrote:
> > It goes soon after
On Thursday, January 30, 2020 at 9:02:02 AM UTC-5, Vladimir Botka wrote:
>
> On Thu, 30 Jan 2020 05:38:17 -0800 (PST)
> Anand Solomon > wrote:
>
> > - name: Display the query results
> > debug:
> > msg: "{{ query_result }}"
> &g
hostname: "{{hostname}}"
privs:
- INSERT ANY TABLE
state: absent
*roles: "{{ query_result }}"*
quiet: false
environment: "{{oracle_env}}"
register: user_privs
delegate_to: localhost
On Thursday, January 3
The result I get from the query_result is something like this [["TESTDBA"],
["TESTDBA2"]]
I want to know how to pass this variable removing the square brackets and
the *roles* in the task
On Thursday, January 30, 2020 at 2:52:43 PM UTC-5, Anand Solomon wrote:
>
> Hi,
Just this made the trick. Thanks very much
roles: "{{item}}"
quiet: false
environment: "{{oracle_env}}"
register: user_privs
with_items : "{{query_result.msg}}"
On Thursday, January 30, 2020 at 3:20:38 PM UTC-5, Anand Solomon wr
Hi,
I am reading 3 different variable from a text file and want to iterate in 3
different with_items.
variablefile.yml
vars1 :
- first_value1
- first_value 2
var2:
- second_value1
- second_value2
var3:
- third_value1
- third_value2
I want to read the value from the text file and pass t
t;
value: "{{value2}}"
privilege: "{{privs2}}"
On Monday, February 3, 2020 at 11:36:40 PM UTC-5, Vladimir Botka wrote:
>
> On Mon, 3 Feb 2020 16:31:21 -0800 (PST)
> Anand Solomon > wrote:
>
> > variablefile.yml
> >
> > var1:
Hi,
How to even run ansible commands to the RDS Oracle instance ? Is there a
special parameter I should be passing ? . I have "connection; local" in the
task. I tried to execute the playbook, I get the below error. Am i missing
something ?
Here is my playbook variable.
vars:
oracle_home: /h
Hi,
How to even run ansible commands to the RDS Oracle instance ? Is there a
special parameter I should be passing ? . I have "connection; local" in the
task. I tried to execute the playbook, I get the below error. Am i missing
something ?
Here is my playbook variable.
vars:
oracle_home: /h
43 matches
Mail list logo