opitzconsulting / opitzconsulting.ansible_oracle / 4.7.0 / module / oracle_job Manage DBMS_SCHEDULER jobs in Oracle database | "added in version" 2.2.1 of opitzconsulting.ansible_oracle" Authors: Ilmar Kerm, ilmar.kerm@gmail.com, @ilmarkermopitzconsulting.ansible_oracle.oracle_job (4.7.0) — module
Install with ansible-galaxy collection install opitzconsulting.ansible_oracle:==4.7.0
collections: - name: opitzconsulting.ansible_oracle version: 4.7.0
Manage DBMS_SCHEDULER jobs in an Oracle database
Can be run locally on the controlmachine or on a remote host
- hosts: localhost vars: oraclehost: 192.168.56.101 oracleport: 1521 oracleservice: orcl oracleuser: system oraclepassword: oracle oracle_env: ORACLE_HOME: /usr/lib/oracle/12.1/client64 LD_LIBRARY_PATH: /usr/lib/oracle/12.1/client64/lib tasks: - name: drop job oracle_job: hostname: "{{ oraclehost }}" port: "{{ oracleport }}" service_name: "{{ oracleservice }}" user: "{{ oracleuser }}" password: "{{ oraclepassword }}" state: absent name: hr.j1 environment: "{{ oracle_env }}" - name: create job oracle_job: hostname: "{{ oraclehost }}" port: "{{ oracleport }}" service_name: "{{ oracleservice }}" user: "{{ oracleuser }}" password: "{{ oraclepassword }}" state: present name: hr.j1 action: begin null; null; end; logging_level: runs comments: This job is just for testing something repeat_interval: FREQ=HOURLY;interval=3 enabled: False lightweight: False restartable: True environment: "{{ oracle_env }}"
mode: choices: - normal - sysdba default: normal description: 'The mode with which to connect to the database ' required: false port: default: 1521 description: The listener port number on the host required: false user: description: 'The Oracle user name to connect to the database, must have DBA privilege ' required: false state: choices: - present - absent description: 'If present, then job is created, if absent then job is dropped ' required: true enabled: default: true description: Is job enabled required: false type: bool comments: description: Job comments required: false hostname: default: localhost description: The Oracle database host required: false job_name: aliases: - name description: 'Job name, can be specified with owner schema name ' required: true job_type: aliases: - type choices: - plsql_block - stored_procedure - executable - external_script - sql_script - backup_script default: plsql_block description: Job type required: false password: description: The Oracle user password for 'user' required: false auto_drop: default: false description: 'Is job automatically dropped after execution ' required: false type: bool job_class: aliases: - class default: DEFAULT_JOB_CLASS description: Job class required: false credential: description: Credential name required: false job_action: aliases: - action description: Job action (what is executed) required: false destination: description: Destination name required: false lightweight: default: false description: Is it lightweight job required: false type: bool restartable: default: false description: Is job restartable required: false type: bool program_name: description: Associated DBMS_SCHEDULER program name required: false service_name: description: The database service name to connect to required: true job_arguments: aliases: - arguments description: 'List of arguments passed to job, only positional arguments supported ' required: false type: list logging_level: choices: - false - runs - failed runs - full description: Job logging level required: false schedule_name: description: Associated DBMS_SCHEDULER schedule name required: false repeat_interval: description: Job repeat interval required: false convert_to_upper: default: true description: 'Job name automatically converted to upper case ' required: false type: bool