Skip to content

Commit

Permalink
pre-commit: Multiple changes for pre-commit run --all
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendanic committed Jan 19, 2024
1 parent 3204138 commit 860b29a
Show file tree
Hide file tree
Showing 26 changed files with 43 additions and 49 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@

2014-09-25
- Added support for 11.2.0.4

2 changes: 1 addition & 1 deletion README-ansible.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ IMPORTANT: `ansible-oracle` is designed to run as a container.
cd docker
docker-compose run --rm ansible bash
ansible-galaxy collection install -r requirements.yml
----
----
3 changes: 3 additions & 0 deletions changelogs/fragments/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- "pre-commit: Multiple changes for pre-commit run --all (oravirt#399)"
1 change: 1 addition & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
ansible orarac02 -a "/u01/app/12.1.0.2/grid/crs/install/rootcrs.pl -deconfig -force" -u root
ansible orarac01 -a "/u01/app/12.1.0.2/grid/crs/install/rootcrs.pl -deconfig -force -lastnode" -u root
ansible orarac02 -a "/u01/app/12.1.0.1/grid/crs/install/rootcrs.pl -deconfig -force" -u root
Expand Down
2 changes: 1 addition & 1 deletion doc/guides/advanced.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ansible@ansible-oracle:/git/ansible-oracle/example/beginner/ansible$ ansible-gal
.Example
[auote, output]
----
ansible@ansible-oracle:/git/ansible-oracle/example/beginner/ansible$ ansible-galaxy collection install -r requirements.yml
ansible@ansible-oracle:/git/ansible-oracle/example/beginner/ansible$ ansible-galaxy collection install -r requirements.yml
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Expand Down
2 changes: 1 addition & 1 deletion doc/guides/beginner.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ ansible@ansible-oracle:/git/ansible-oracle/example/beginner/ansible$ ansible-gal
.Example
[auote, output]
----
ansible@ansible-oracle:/git/ansible-oracle/example/beginner/ansible$ ansible-galaxy collection install -r requirements.yml
ansible@ansible-oracle:/git/ansible-oracle/example/beginner/ansible$ ansible-galaxy collection install -r requirements.yml
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Expand Down
Empty file modified example/beginner/ansible/inventory/group_vars/all/db-homes.yml
100755 → 100644
Empty file.
Empty file.
Empty file.
Empty file modified example/beginner/ansible/inventory/hosts.yml
100755 → 100644
Empty file.
2 changes: 0 additions & 2 deletions plugins/modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,3 @@ pre-rec: cx_Oracle

- Create/remove databases (cdb/non-cdb)
- Can be created by passing in a responsefile or just by using parameters


2 changes: 1 addition & 1 deletion plugins/modules/oracle_gi_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
except ImportError: # pragma: no cover
# python 2.6 doesn't include check_output
# monkey patch it in!
import subprocess
# import subprocess

STDOUT = subprocess.STDOUT

Expand Down
50 changes: 23 additions & 27 deletions plugins/modules/test-modules.yml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
user: vagrant
sudo: yes
sudo_user: oracle
gather_facts: false
gather_facts: false


vars:
oracle_home: /u01/app/oracle/11.2.0.4/home1
Expand All @@ -22,46 +22,46 @@
set_init: False
restart_db: False
init_parameters:
- { name: db_recovery_file_dest_size, value: 4G, state: present, scope: both }
- { name: db_recovery_file_dest, value: '+FRA', state: present, scope: both }
- { name: pga_aggregate_target, value: 300M, state: present, scope: both }
- { name: _parallel_statement_queuing, value: true, state: present, scope: both }
- { name: sga_target, value: 900M, state: present, scope: spfile }
- { name: sga_max_size, value: 900M, state: present, scope: spfile }
- { name: open_cursors, value: 400, state: present, scope: both }
- { name: processes, value: 700, state: present, scope: spfile }
- { name: log_archive_dest_2, value: 'service=hippie2, LGWR ASYNC NOAFFIRM db_unique_name=hippie2 valid_for=(online_logfile,primary_role)', state: present, scope: both }
- { name: db_recovery_file_dest_size, value: 4G, state: present, scope: both }
- { name: db_recovery_file_dest, value: '+FRA', state: present, scope: both }
- { name: pga_aggregate_target, value: 300M, state: present, scope: both }
- { name: _parallel_statement_queuing, value: true, state: present, scope: both }
- { name: sga_target, value: 900M, state: present, scope: spfile }
- { name: sga_max_size, value: 900M, state: present, scope: spfile }
- { name: open_cursors, value: 400, state: present, scope: both }
- { name: processes, value: 700, state: present, scope: spfile }
- { name: log_archive_dest_2, value: 'service=hippie2, LGWR ASYNC NOAFFIRM db_unique_name=hippie2 valid_for=(online_logfile,primary_role)', state: present, scope: both }


tablespaces:
- { name: newtbs, datafile: '+DATA', size: 5M, bigfile: True, autoextend: false , next: 5M, maxsize: 500M, content: permanent, state: present }
- { name: newundo, datafile: '+DATA', size: 5M, bigfile: false, autoextend: true, next: 5M, maxsize: 500M, content: undo, state: present }
- { name: newtemp, datafile: '+DATA', size: 5M, bigfile: false, autoextend: on, next: 5M, maxsize: 500M, content: temp, state: present }
- { name: newtbs, datafile: '+DATA', size: 5M, bigfile: True, autoextend: false , next: 5M, maxsize: 500M, content: permanent, state: present }
- { name: newundo, datafile: '+DATA', size: 5M, bigfile: false, autoextend: true, next: 5M, maxsize: 500M, content: undo, state: present }
- { name: newtemp, datafile: '+DATA', size: 5M, bigfile: false, autoextend: on, next: 5M, maxsize: 500M, content: temp, state: present }

dba_user:
- schema: dbauser
schema_password_hash: B7C930D09B3AF263 # passwd = dbauser
state: present
default_tablespace: users
grants:
grants:
- "dba"

passw_user:
- schema: userpw
- schema: userpw
schema_password: userpw
state: present
default_tablespace: newtbs
grants:
grants:
- "approle1"

roles:
- name: approle1
role_grants:
role_grants:
- 'create session'
- 'select any table'
state: present



tasks:

Expand All @@ -72,30 +72,30 @@
with_items: tablespaces

- name: Create application role
oracle_role: hostname={{ hostname }} service_name={{ service_name }} user={{ user }} password={{ password }} role={{ item.name }} state={{ item.state }}
oracle_role: hostname={{ hostname }} service_name={{ service_name }} user={{ user }} password={{ password }} role={{ item.name }} state={{ item.state }}
environment: oracle_env
with_items: roles


- name: Add grants to role
oracle_grants: hostname={{ hostname }} service_name={{ service_name }} user={{ user }} password={{ password }} role={{ item.0.name }} grants="{{ item.1 }}" state={{ item.0.state }}
environment: oracle_env
with_subelements:
with_subelements:
- roles
- role_grants

- name: Create DBA user
oracle_user: hostname={{ hostname }} service_name={{ service_name }} mode=normal user={{ user }} password={{ password }} schema={{ item.0.schema }} schema_password_hash={{ item.0.schema_password_hash }} state={{ item.0.state }} default_tablespace={{ item.0.default_tablespace }} grants={{ item.1 }}
environment: oracle_env
with_subelements:
with_subelements:
- dba_user
- grants


- name: Create Application user
oracle_user: hostname={{ hostname }} service_name={{ service_name }} mode=normal user={{ user }} password={{ password }} schema={{ item.0.schema }} schema_password={{ item.0.schema_password }} state={{ item.0.state }} default_tablespace={{ item.0.default_tablespace }} grants={{ item.1 }}
environment: oracle_env
with_subelements:
with_subelements:
- passw_user
- grants

Expand Down Expand Up @@ -128,7 +128,3 @@
with_items: check_db_up.stdout_lines
when: restart_db
tags: check




2 changes: 1 addition & 1 deletion roles/common/templates/motd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FQDN: {{ ansible_fqdn }}
IP's:
{% for a in ansible_interfaces %}
{% if a != 'lo' %}
{{a}}: {{ hostvars[inventory_hostname]['ansible_'~a]['ipv4']['address'] }}
{{a}}: {{ hostvars[inventory_hostname]['ansible_'~a]['ipv4']['address'] }}
{% endif %}
{% endfor %}

Expand Down
2 changes: 1 addition & 1 deletion roles/oradb_manage_db/LISTENER.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ listener_installed:
listener_name: LISTENER1523
state: present

oracle_databases:
oracle_databases:
- home: 18300-base
oracle_db_name: cdb183
listener_name: LISTENER
2 changes: 1 addition & 1 deletion roles/oradb_manage_db/templates/pdb.sql.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ col global_name noprint
select upper(sys_context ('userenv', 'session_user') || ' @ ' ||sys_context ('userenv', 'instance_name') || ':' || sys_context('userenv', 'con_name')) global_name from dual;
set sqlprompt '&gname:> '
set heading on
set termout on
set termout on
1 change: 0 additions & 1 deletion roles/oradb_rman/templates/parameter_fra_disk.rman.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO {{rman_controlfi
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE CHANNEL DEVICE TYPE DISK clear;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+{{oracle_dbf_dir_asm}}/{{ item.0.oracle_db_name }}/snapcf_{{ item.0.oracle_db_name }}.f';

1 change: 0 additions & 1 deletion roles/oradb_rman/templates/parameter_rac.rman.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO {{rman_controlfi
CONFIGURE DEVICE TYPE DISK {{rman_device_type_disk}};
CONFIGURE CHANNEL DEVICE TYPE DISK {{ rman_channel_disk }};
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '{{oracle_dbf_dir_asm}}/%d/snapcf_PLANETP1.f'; # default

2 changes: 1 addition & 1 deletion roles/orahost/templates/motd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IP: {{ hostvars[host]['ansible_default_ipv4']['address'] }}


Kernel: {{ ansible_kernel }}
#cpu's: {{ ansible_processor_vcpus }}
#cpu's: {{ ansible_processor_vcpus }}
mem: {{ ansible_memtotal_mb }} MB


Expand Down
2 changes: 0 additions & 2 deletions roles/orahost_logrotate/templates/oracle_cleanup.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ find {{oracle_base}}/diag/asm/*/*/trace -name "*.tr?" -type f -mtime +{{oracle_

#
find {{oracle_base}}/diag/tnslsnr/*/*/alert -name "*.xml" -type f -mtime +{{oracle_cleanup_days}} -delete 2>/dev/null


1 change: 0 additions & 1 deletion roles/oraswdb_install/templates/dbora.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ case $1 in
esac

exit

2 changes: 1 addition & 1 deletion roles/oraswdb_install/templates/dotprofile-home.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH:$SQLPATH:$GG_HOME/
alias sqlp='. oraenv; rlwrap sqlplus'
alias dbh='cd $ORACLE_HOME'
alias dbb='cd $ORACLE_BASE'
alias c='clear'
alias c='clear'
2 changes: 1 addition & 1 deletion tools/ansible/install_ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ setup_venv()
setup_ansible()
{
echo "Install Ansible with pip3"
echo $workdir
echo "$workdir"
pip3 install -r "$workdir/requirements_ansible.txt"
}

Expand Down
4 changes: 3 additions & 1 deletion tools/dev/install_collection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
# Install the ansible-oracle collection from current source
#
set -eu

# shellcheck disable=SC2086
WORKTDIR="$(dirname ${BASH_SOURCE[0]})/../.."
COLLECTION_OUTDIR=/tmp/ansible-oracle-collection

cd "${WORKTDIR}"
echo "Working in $(pwd)"
test -s "${COLLECTION_OUTDIR}" || mkdir "${COLLECTION_OUTDIR}"

COLLECTION_VERSION=$(cat galaxy.yml | grep "^version: " | cut -d" " -f2)
COLLECTION_VERSION=$(grep "^version: " galaxy.yml | cut -d" " -f2)
COLLECTION_ARCHIVE="${COLLECTION_OUTDIR}/opitzconsulting-ansible_oracle-${COLLECTION_VERSION}.tar.gz"
echo "COLLECTION_ARCHIVE: ${COLLECTION_ARCHIVE}"

Expand Down
2 changes: 1 addition & 1 deletion vagrant/dbfs/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Vagrant.configure("2") do |config|
set -e
# configure local Nexus-Server when running
#
#
os_release=$(grep '^VERSION_ID' /etc/os-release | awk -F'=' ' gsub(/"/,"") { print $2}' | cut -b1)
if curl -f -s -q -m 3 http://192.168.56.12:8081/repository/ol${os_release}os-yum-group/ > /dev/null ; then
echo "Local Nexus3 Server for yum proxy found!"
Expand Down
4 changes: 2 additions & 2 deletions vagrant/has/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Vagrant.configure("2") do |config|
config.vm.disk :disk, size: "150GB", name: "#{vm_name}_oracle"
config.vm.disk :disk, size: "30GB", name: "#{vm_name}_asmdata1"
config.vm.disk :disk, size: "30GB", name: "#{vm_name}_asmfra1"

# config.disksize.size = '50GB'
config.vm.box = "Rendanic/oraclelinux-7.x"

Expand Down Expand Up @@ -71,7 +71,7 @@ Vagrant.configure("2") do |config|
set -e
# configure local Nexus-Server when running
#
#
os_release=$(grep '^VERSION_ID' /etc/os-release | awk -F'=' ' gsub(/"/,"") { print $2}' | cut -b1)
if curl -f -s -q -m 3 http://192.168.56.12:8081/repository/ol${os_release}os-yum-group/ > /dev/null ; then
echo "Local Nexus3 Server for yum proxy found!"
Expand Down

0 comments on commit 860b29a

Please sign in to comment.