ora role
Overview
This type allows you to create or delete a role inside an Oracle Database.
It recognises a limit part of the options that CREATE ROLE supports.
ora_role {'just_a_role@sid':
ensure => present,
}
You can also add grants to a role:
ora_role {'just_a_role@sid':
ensure => present,
grants => ['create session','create table'],
}
Experience the Power of Puppet for Oracle
If you want to play and experiment with Puppet and Oracle, please take a look at our playgrounds. At our playgrounds, we provide you with a pre-installed environment, where you experiment fast and easy.

Attributes
Attribute Name | Short Description |
---|---|
common_granted | The common grants you want to make sure are granted to the ora_user or ora_role . |
common_granted_with_admin | The common grants with admin you want to make sure are granted to the ora_user or ora_role . |
common_grants | Common grants for this user or role. |
common_grants_with_admin | Common grants for this user or role with admin. |
common_revoked | The common grants you want to make sure are revoked from the ora_user or ora_role . |
common_revoked_with_admin | The common grants you want to make sure are revoked from the ora_user or ora_role . |
container | Allows you to specify the scope of the object. |
disable_corrective_change | Disable the modification of a resource when Puppet decides it is a corrective change. |
disable_corrective_ensure | Disable the creation or removal of a resource when Puppet decides is a corrective change. |
ensure | The basic property that the resource should be in. |
granted | The grants you want to make sure are granted to the ora_user or ora_role . |
granted_with_admin | The grants with admin you want to make sure are granted to the ora_user or ora_role . |
grants | grants for this user or role. |
grants_with_admin | grants for this user or role. |
ignore_oracle_maintained_warnings | This is a parameter that can be used to skip generating warnings on changing or dropping Oracle managed users or roles. |
name | The role name. |
oracle_maintained | This is a read only property that cannot be used when specifying a user. |
password | The password to use when connecting to to the database. |
provider | resource. |
revoked | The grants you want to make sure are revoked from the ora_user or ora_role . |
revoked_with_admin | The grants you want to make sure are revoked from the ora_user or ora_role . |
role_name | The role name. |
sid | SID to connect to. |
common_granted
The common grants you want to make sure are granted to the ora_user
or ora_role
.
This property is only functional when applied on container databases.
It is different from the common_grants
property in the sense that this is not a full list of the rights, but just the rights that are granted to the user
Here is an example with an ora_user
:
ora_user {'scott':
...
common_granted => ['GRANT ANY ROLE'],
...
}
Here is an example with an ora_role
:
ora_role {'app_dba_role':
...
common_granted => ['GRANT ANY ROLE'],
...
}
common_granted_with_admin
The common grants with admin you want to make sure are granted to the ora_user
or ora_role
.
This property is only functional when applied on container databases.
It is different from the common_grants_with_admin
property in the sense that this is not a full list of the rights, but just the rights that are granted to the user
Here is an example with an ora_user
:
ora_user {'scott':
...
common_granted_with_admin => ['GRANT ANY ROLE'],
...
}
Here is an example with an ora_role
:
ora_role {'app_dba_role':
...
common_granted_with_admin => ['GRANT ANY ROLE'],
...
}
common_grants
Common grants for this user or role.
This property is only functional when applied on container databases.
All the common grants this resource has. Here is an example on how to use this on an ora_user
:
ora_user { ‘my_user@sid’: … common_grants => [‘UNLIMITED TABLESPACE’, ‘CREATE PUBLIC SYNONYM’]. … }
Here is an example on how to use this on an ora_role
:
ora_ora_role { ‘my_role@sid’: … common_grants => [‘UNLIMITED TABLESPACE’, ‘CREATE PUBLIC SYNONYM’]. … }
common_grants_with_admin
Common grants for this user or role with admin.
This property is only functional when applied on container databases.
All the common grants this resource has. Here is an example on how to use this on an ora_user
:
ora_user { ‘my_user@sid’: … common_grants_with_admin => [‘UNLIMITED TABLESPACE’, ‘CREATE PUBLIC SYNONYM’]. … }
Here is an example on how to use this on an ora_role
:
ora_ora_role { ‘my_role@sid’: … common_grants_with_admin => [‘UNLIMITED TABLESPACE’, ‘CREATE PUBLIC SYNONYM’]. … }
common_revoked
The common grants you want to make sure are revoked from the ora_user
or ora_role
.
This property is only functional when applied on container databases.
It is different from the common_grants
property in the sense that this is not a full list of the rights, but just the rights that are NOT granted to the user
Here is an example when using ora_user
:
ora_user {'scott':
...
common_revoked => ['GRANT ANY ROLE'],
}
Here is an example when using ora_role
:
ora_role {'scott':
...
common_revoked => ['GRANT ANY ROLE'],
}
WARNING
When you us both the common_grants
and common_revoked
property, Puppet will give you a warning about conflicting values. In the end it WILL ensure that the rights specified for the common_revoked
property are removed. This way ensuring the most secure configuration.
common_revoked_with_admin
The common grants you want to make sure are revoked from the ora_user
or ora_role
.
This property is only functional when applied on container databases.
It is different from the grants
property in the sense that this is not a full list of the rights, but just the rights that are NOT granted to the user
Here is an example when using ora_user
:
ora_user {'scott':
...
common_revoked_with_admin => ['GRANT ANY ROLE'],
}
Here is an example when using ora_role
:
ora_role {'scott':
...
common_revoked_with_admin => ['GRANT ANY ROLE'],
}
WARNING
When you us both the common_grants
and common_revoked
property, Puppet will give you a warning about conflicting values. In the end it WILL ensure that the rights specified for the common_revoked
property are removed. This way ensuring the most secure configuration.
container
Allows you to specify the scope of the object.
This property is only supported on version 12 and higher. It allows you to specify if the user will be seen through all portable containers (e.g. global) of just in the current pluggable database.
You can use container
on:
ora_user
ora_profile
ora_object_grant
Here is an example on how to use this:
ora_... { '...@sid':
...
container => 'local',
...
}
Valid values are local
, common
.
disable_corrective_change
Disable the modification of a resource when Puppet decides it is a corrective change.
(requires easy_type V2.11.0 or higher)
When using a Puppet Server, Puppet knows about adaptive and corrective changes. A corrective change is when Puppet notices that the resource has changed, but the catalog has not changed. This can occur for example, when a user, by accident or willingly, changed something on the system that Puppet is managing. The normal Puppet process then repairs this and puts the resource back in the state as defined in the catalog. This process is precisely what you want most of the time, but not always. This can sometimes also occur when a hardware or network error occurs. Then Puppet cannot correctly determine the current state of the system and thinks the resource is changed, while in fact, it is not. Letting Puppet recreate remove or change the resource in these cases, is NOT wat you want.
Using the disable_corrective_change
parameter, you can disable corrective changes on the current resource.
Here is an example of this:
crucial_resource {'be_carefull':
...
disable_corrective_change => true,
...
}
When a corrective ensure does happen on the resource Puppet will not modify the resource and signal an error:
Error: Corrective change present requested by catalog, but disabled by parameter disable_corrective_change
Error: /Stage[main]/Main/Crucial_resource[be_carefull]/parameter: change from '10' to '20' failed: Corrective change present requested by catalog, but disabled by parameter disable_corrective_change. (corrective)
disable_corrective_ensure
Disable the creation or removal of a resource when Puppet decides is a corrective change.
(requires easy_type V2.11.0 or higher)
When using a Puppet Server, Puppet knows about adaptive and corrective changes. A corrective change is when Puppet notices that the resource has changed, but the catalog has not changed. This can occur for example, when a user, by accident or willingly, changed something on the system that Puppet is managing. The normal Puppet process then repairs this and puts the resource back in the state as defined in the catalog. This process is precisely what you want most of the time, but not always. This can sometimes also occur when a hardware or network error occurs. Then Puppet cannot correctly determine the current state of the system and thinks the resource is changed, while in fact, it is not. Letting Puppet recreate remove or change the resource in these cases, is NOT wat you want.
Using the disable_corrective_ensure
parameter, you can disable corrective ensure present or ensure absent actions on the current resource.
Here is an example of this:
crucial_resource {'be_carefull':
ensure => 'present',
...
disable_corrective_ensure => true,
...
}
When a corrective ensure does happen on the resource Puppet will not create or remove the resource and signal an error:
Error: Corrective ensure present requested by catalog, but disabled by parameter disable_corrective_ensure.
Error: /Stage[main]/Main/Crucial_resource[be_carefull]/ensure: change from 'absent' to 'present' failed: Corrective ensure present requested by catalog, but disabled by parameter disable_corrective_ensure. (corrective)
ensure
The basic property that the resource should be in.
Valid values are present
, absent
.
granted
The grants you want to make sure are granted to the ora_user
or ora_role
. It is different from the grants
property in the sense that this is not a full list of the rights, but just the rights that are granted to the user
Here is an example with an ora_user
:
ora_user {'scott':
...
granted => ['GRANT ANY ROLE'],
...
}
Here is an example with an ora_role
:
ora_role {'app_dba_role':
...
granted => ['GRANT ANY ROLE'],
...
}
**WARNING**
When you us both the `grants` and `granted` property, Puppet will give you a warning about conflicting values. In the end it **WILL** ensure
that the rights specified for the `revoked` property are removed. This way ensuring the most secure configuration.
granted_with_admin
The grants with admin you want to make sure are granted to the ora_user
or ora_role
. It is different from the grants_with_admin
property in the sense that this is not a full list of the rights, but just the rights that are granted to the user
Here is an example with an ora_user
:
ora_user {'scott':
...
granted_with_admin => ['GRANT ANY ROLE'],
...
}
Here is an example with an ora_role
:
ora_role {'app_dba_role':
...
granted_with_admin => ['GRANT ANY ROLE'],
...
}
grants
grants for this user or role.
All the grants this resource has. Here is an example on how to use this on an ora_user
:
ora_user { ‘my_user@sid’: … grants => [‘UNLIMITED TABLESPACE’, ‘CREATE PUBLIC SYNONYM’]. … }
Here is an example on how to use this on an ora_role
:
ora_ora_role { ‘my_role@sid’: … grants => [‘UNLIMITED TABLESPACE’, ‘CREATE PUBLIC SYNONYM’]. … }
grants_with_admin
grants for this user or role.
All the grants this resource has. Here is an example on how to use this on an ora_user
:
ora_user { ‘my_user@sid’: … grants_with_admin => [‘UNLIMITED TABLESPACE’, ‘CREATE PUBLIC SYNONYM’]. … }
Here is an example on how to use this on an ora_role
:
ora_ora_role { ‘my_role@sid’: … grants_with_admin => [‘UNLIMITED TABLESPACE’, ‘CREATE PUBLIC SYNONYM’]. … }
ignore_oracle_maintained_warnings
This is a parameter that can be used to skip generating warnings on changing or dropping Oracle managed users or roles.
name
The role name.
oracle_maintained
This is a read only property that cannot be used when specifying a user.
password
The password to use when connecting to to the database.
provider
The specific backend to use for this ora_role
resource. You will seldom need to specify this — Puppet will usually discover the appropriate provider for your platform.Available providers are:
- simple
- Manage an Oracle role in an Oracle Database via regular SQL
revoked
The grants you want to make sure are revoked from the ora_user
or ora_role
. It is different from the grants
property in the sense that this is not a full list of the rights, but just the rights that are NOT granted to the user
Here is an example when using ora_user
:
ora_user {'scott':
...
revoked => ['GRANT ANY ROLE'],
}
Here is an example when using ora_role
:
ora_role {'scott':
...
revoked => ['GRANT ANY ROLE'],
}
WARNING
When you us both the grants
and revoked
property, Puppet will give you a warning about conflicting values. In the end it WILL ensure that the rights specified for the revoked
property are removed. This way ensuring the most secure configuration.
revoked_with_admin
The grants you want to make sure are revoked from the ora_user
or ora_role
. It is different from the grants
property in the sense that this is not a full list of the rights, but just the rights that are NOT granted to the user
Here is an example when using ora_user
:
ora_user {'scott':
...
revoked_with_admin => ['GRANT ANY ROLE'],
}
Here is an example when using ora_role
:
ora_role {'scott':
...
revoked_with_admin => ['GRANT ANY ROLE'],
}
WARNING
When you us both the grants_with_admin
and revoked_with_admin
property, Puppet will give you a warning about conflicting values. In the end it WILL ensure that the rights specified for the revoked_with_admin
property are removed. This way ensuring the most secure configuration.
role_name
The role name.
sid
SID to connect to.
All types have a name like resource@sid
. The sid is optional. If you don’t specify the sid, the type will use the database from the /etc/ora_setting.yaml
with the property default
set to true
. We advise you to either use @sid
in all your manifests or leave it empty everywhere.