|
4 | 4 | oracle_grants: |
5 | 5 | role={{ item.1.name }} |
6 | 6 | state={{ item.1.state }} |
7 | | - grants={{ item.1.grants }} |
| 7 | + grants={{ item.1.grants |default(omit) }} |
| 8 | + object_privs={{ item.1.object_privs | default (omit) }} |
8 | 9 | hostname={{ ansible_hostname }} |
9 | 10 | port={{ listener_port_template }} |
10 | 11 | service_name={{ db_service_name }} |
|
17 | 18 | - flags: |
18 | 19 | skip_missing: True |
19 | 20 | environment: "{{oracle_env}}" |
20 | | - when: oracle_databases is defined and item.0.state|lower == 'present' and item.1.grants is defined |
| 21 | + when: oracle_databases is defined and item.0.state|lower == 'present' and (item.1.grants is defined or item.1.object_privs is defined) |
21 | 22 | run_once: "{{ configure_cluster }}" |
22 | 23 | become_user: "{{ oracle_user }}" |
23 | 24 | loop_control: |
24 | | - label: "port: {{ listener_port_template }}, service: {{ db_service_name }}, role: {{ item.1.name | default('none') }}, grants: {{ item.1.grants | default('empty') }}, state: {{ item.1.state }}" |
| 25 | + label: "port: {{ listener_port_template }}, service: {{ db_service_name }}, role: {{ item.1.name | default('none') }}, grants: {{ item.1.grants | default(omit) }}, state: {{ item.1.state }}" |
25 | 26 | tags: users,grants |
26 | 27 |
|
27 | 28 | - name: Manage role grants (pdb) |
28 | 29 | oracle_grants: |
29 | 30 | role={{ item.1.name }} |
30 | 31 | state={{ item.1.state }} |
31 | | - grants={{ item.1.grants }} |
| 32 | + grants={{ item.1.grants |default(omit) }} |
| 33 | + object_privs={{ item.1.object_privs | default (omit) }} |
32 | 34 | hostname={{ ansible_hostname }} |
33 | 35 | port={{ listener_port_template }} |
34 | 36 | service_name={{ item.0.pdb_name }} |
|
41 | 43 | - flags: |
42 | 44 | skip_missing: True |
43 | 45 | environment: "{{oracle_env}}" |
44 | | - when: oracle_pdbs is defined and item.0 is defined and item.0.state|lower == 'present' and item.1.grants is defined |
| 46 | + when: oracle_pdbs is defined and item.0 is defined and item.0.state|lower == 'present' and (item.1.grants is defined or item.1.object_privs is defined) |
45 | 47 | run_once: "{{ configure_cluster }}" |
46 | 48 | become_user: "{{ oracle_user }}" |
47 | 49 | loop_control: |
48 | | - label: "port: {{ listener_port_template }}, service: {{ item.0.pdb_name }}, role: {{ item.1.name | default('none') }}, grants: {{ item.1.grants | default('empty') }}, state: {{ item.1.state }}" |
| 50 | + label: "port: {{ listener_port_template }}, service: {{ item.0.pdb_name }}, role: {{ item.1.name | default('none') }}, grants: {{ item.1.grants | default(omit) }}, state: {{ item.1.state }}" |
49 | 51 | tags: users,grants |
50 | 52 |
|
51 | 53 | - name: Manage schema grants (cdb) |
52 | 54 | oracle_grants: |
53 | 55 | schema={{ item.1.schema }} |
54 | 56 | state={{ item.1.state }} |
55 | | - grants={{ item.1.grants }} |
| 57 | + grants={{ item.1.grants |default(omit) }} |
| 58 | + object_privs={{ item.1.object_privs | default (omit) }} |
56 | 59 | hostname={{ ansible_hostname }} |
57 | 60 | port={{ listener_port_template }} |
58 | 61 | service_name={{ db_service_name }} |
|
65 | 68 | - flags: |
66 | 69 | skip_missing: True |
67 | 70 | environment: "{{oracle_env}}" |
68 | | - when: oracle_databases is defined and item.0.state|lower == 'present' and item.1.grants is defined |
| 71 | + when: oracle_databases is defined and item.0.state|lower == 'present' and (item.1.grants is defined or item.1.object_privs is defined) |
69 | 72 | run_once: "{{ configure_cluster }}" |
70 | 73 | become_user: "{{ oracle_user }}" |
71 | 74 | loop_control: |
72 | | - label: "port: {{ listener_port_template }}, service: {{ db_service_name }}, schema: {{ item.1.schema }}, grants: {{ item.1.grants | default('empty') }}, state: {{ item.1.state }}" |
| 75 | + label: "port: {{ listener_port_template }}, service: {{ db_service_name }}, schema: {{ item.1.schema }}, grants: {{ item.1.grants | default(omit) }}, state: {{ item.1.state }}" |
73 | 76 | tags: users,grants |
74 | 77 |
|
75 | 78 | - name: Manage schema grants (pdb) |
76 | 79 | oracle_grants: |
77 | 80 | schema={{ item.1.schema }} |
78 | 81 | state={{ item.1.state }} |
79 | | - grants={{ item.1.grants }} |
| 82 | + grants={{ item.1.grants | default (omit) }} |
| 83 | + object_privs={{ item.1.object_privs |default (omit)}} |
80 | 84 | hostname={{ ansible_hostname }} |
81 | 85 | port={{ listener_port_template }} |
82 | 86 | service_name={{ item.0.pdb_name }} |
|
89 | 93 | - flags: |
90 | 94 | skip_missing: True |
91 | 95 | environment: "{{oracle_env}}" |
92 | | - when: oracle_pdbs is defined and item.0 is defined and item.0.state|lower == 'present' and item.1.grants is defined |
| 96 | + when: oracle_pdbs is defined and item.0 is defined and item.0.state|lower == 'present' and (item.1.grants is defined or item.1.object_privs is defined) |
93 | 97 | run_once: "{{ configure_cluster }}" |
94 | 98 | become_user: "{{ oracle_user }}" |
95 | 99 | loop_control: |
96 | | - label: "port: {{ listener_port_template }}, service: {{ item.0.pdb_name }}, schema: {{ item.1.schema | default('none') }}, grants: {{ item.1.grants | default('empty') }}, state: {{ item.1.state }}" |
| 100 | + label: "port: {{ listener_port_template }}, service: {{ item.0.pdb_name }}, schema: {{ item.1.schema | default('none') }}, grants: {{ item.1.grants | default(omit) }}, state: {{ item.1.state }}" |
97 | 101 | tags: users,grants |
0 commit comments