Skip to content

Commit

Permalink
oraswgi-install: ansible-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Rendanic committed Sep 13, 2021
1 parent 964ce99 commit 28b28ee
Show file tree
Hide file tree
Showing 14 changed files with 1,146 additions and 967 deletions.
1 change: 0 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ exclude_paths:
- roles/oradb-delete

# ansible-oracle roles wip - will be removed after refactoring
- roles/oraswgi-install
- roles/oraswgi-manage-patches
- roles/oraswgi-opatch
1 change: 1 addition & 0 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ jobs:
roles/oraswgi-golden-image
roles/oraswdb-install
roles/oraswdb-manage-patches
roles/oraswgi-install
args: ""
296 changes: 154 additions & 142 deletions roles/oraswgi-install/defaults/main.yml

Large diffs are not rendered by default.

90 changes: 56 additions & 34 deletions roles/oraswgi-install/tasks/11.2.0.3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,131 @@

- name: install-home-gi | Extract files to stage-area (GI)
unarchive:
src={{ oracle_stage }}/{{ item.filename }}
dest={{ oracle_stage }}/{{ item.version }}
copy=no
creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}}
with_items: "{{oracle_sw_image_gi}}"
become: yes
src={{ oracle_stage }}/{{ item.filename }}
dest={{ oracle_stage }}/{{ item.version }}
copy=no
creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }}
with_items: "{{ oracle_sw_image_gi }}"
become: true
become_user: "{{ grid_install_user }}"
tags:
- oragridswunpack
when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and oracle_sw_copy and oracle_sw_unpack

- name: install-home-gi | Extract files to stage-area (GI) (from remote location)
unarchive:
src={{ oracle_stage_remote }}/{{ item.filename }}
dest={{ oracle_stage }}/{{ item.version }}
copy=no
creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}}
with_items: "{{oracle_sw_image_gi}}"
become: yes
src={{ oracle_stage_remote }}/{{ item.filename }}
dest={{ oracle_stage }}/{{ item.version }}
copy=no
creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }}
with_items: "{{ oracle_sw_image_gi }}"
become: true
become_user: "{{ grid_install_user }}"
tags:
- oragridswunpack
- oragridswunpack
when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy and oracle_sw_unpack

- name: install-home-gi | Install cvuqdisk rpm
yum: name="{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/rpm/{{ cvuqdisk_rpm }}" state=present
# noqa ignore-errors
when: configure_cluster
tags: cvuqdisk
ignore_errors: true

- name: install-home-gi | Setup response file for install (GI)
template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes
with_items: "{{asm_diskgroups}}"
run_once: "{{ configure_cluster}}"
template:
src=grid-install.rsp.{{ oracle_install_version_gi }}.j2
dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }}
owner="{{ grid_install_user }}"
group={{ oracle_group }}
mode=0600
backup=yes
with_items: "{{ asm_diskgroups }}"
run_once: "{{ configure_cluster }}"
tags:
- responsefilegi
when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg

- name: install-home-gi | Install Grid Infrastructure
shell: "{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -ignoreSysPrereqs -showProgress -silent"
become: yes
# noqa yaml command-instead-of-shell
become: true
become_user: "{{ grid_install_user }}"
run_once: "{{ configure_cluster}}"
run_once: "{{ configure_cluster }}"
tags:
- oragridinstall
when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack
when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack
register: giinstall

- debug: var=giinstall.stdout_lines
run_once: "{{ configure_cluster}}"
# noqa unnamed-task
run_once: "{{ configure_cluster }}"
when: oracle_home_gi not in checkgiinstall.stdout

- include_role:
name: oraswgi-manage-patches
# noqa unnamed-task
name: oraswgi-manage-patches
when: patch_before_rootsh and apply_patches_gi

- name: install-home-gi | Run oraInstroot script after installation
shell: "{{ oracle_inventory_loc }}/orainstRoot.sh"
become: yes
# noqa command-instead-of-shell
become: true
tags:
- runroot
when: oracle_home_gi not in checkgiinstall.stdout

- name: install-home-gi | Run root script after installation (Master Node)
shell: "{{ oracle_home_gi }}/root.sh"
become: yes
run_once: "{{ configure_cluster}}"
# noqa command-instead-of-shell
become: true
run_once: "{{ configure_cluster }}"
tags:
- runroot
when: oracle_home_gi not in checkgiinstall.stdout
register: rootmaster

- debug: var=rootmaster.stdout_lines
run_once: "{{ configure_cluster}}"
# noqa unnamed-task
run_once: "{{ configure_cluster }}"
when: oracle_home_gi not in checkgiinstall.stdout

- name: install-home-gi | Run root script after installation (Other Nodes)
shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh"
become: yes
with_indexed_items: "{{groups[hostgroup]}}"
# noqa command-instead-of-shell
become: true
with_indexed_items: "{{ groups[hostgroup] }}"
tags:
- runroot
#when: oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1
# when: oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1
when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout
register: rootother

- debug: var=rootother.stdout_lines
#when: not master_node and oracle_home_gi not in checkgiinstall.stdout
# noqa unnamed-task ignore-errors
# when: not master_node and oracle_home_gi not in checkgiinstall.stdout
when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout
ignore_errors: True
ignore_errors: true

- name: install-home-gi | Setup response file for configToolAllCommands
template: src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp owner="{{ grid_install_user }}" group={{ oracle_group }} mode=755 backup=yes
run_once: "{{ configure_cluster}}"
template:
src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2
dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp
owner="{{ grid_install_user }}"
group={{ oracle_group }}
mode=0755
backup=yes
run_once: "{{ configure_cluster }}"
tags:
- responsefileconfigtool
when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout

- name: install-home-gi | Run configToolAllCommands
shell: "{{ oracle_home_gi }}/cfgtoollogs/configToolAllCommands RESPONSE_FILE={{ oracle_rsp_stage }}/configtoolallcommands.rsp"
become: yes
# noqa command-instead-of-shell
become: true
become_user: "{{ grid_install_user }}"
run_once: "{{ configure_cluster}}"
run_once: "{{ configure_cluster }}"
tags:
- runconfigtool
when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout
Expand Down
90 changes: 56 additions & 34 deletions roles/oraswgi-install/tasks/11.2.0.4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,131 @@

- name: install-home-gi | Extract files to stage-area (GI)
unarchive:
src={{ oracle_stage_remote }}/{{ item.filename }}
dest={{ oracle_stage }}/{{ item.version }}
copy=no
creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}}
with_items: "{{oracle_sw_image_gi}}"
become: yes
src={{ oracle_stage_remote }}/{{ item.filename }}
dest={{ oracle_stage }}/{{ item.version }}
copy=no
creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }}
with_items: "{{ oracle_sw_image_gi }}"
become: true
become_user: "{{ grid_install_user }}"
tags:
- oragridswunpack
when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and oracle_sw_copy and oracle_sw_unpack

- name: install-home-gi | Extract files to stage-area (GI) (from remote location)
unarchive:
src={{ oracle_stage_remote }}/{{ item.filename }}
dest={{ oracle_stage }}/{{ item.version }}
copy=no
creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates}}
with_items: "{{oracle_sw_image_gi}}"
become: yes
src={{ oracle_stage_remote }}/{{ item.filename }}
dest={{ oracle_stage }}/{{ item.version }}
copy=no
creates={{ oracle_stage }}/{{ item.version }}/{{ item.creates }}
with_items: "{{ oracle_sw_image_gi }}"
become: true
become_user: "{{ grid_install_user }}"
tags:
- oragridswunpack
- oragridswunpack
when: oracle_home_gi not in checkgiinstall.stdout and oracle_install_version_gi == item.version and not oracle_sw_copy and oracle_sw_unpack

- name: install-home-gi | Install cvuqdisk rpm
# noqa ignore-errors
yum: name="{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/rpm/{{ cvuqdisk_rpm }}" state=present
when: configure_cluster
tags: cvuqdisk
ignore_errors: true

- name: install-home-gi | Setup response file for install (GI)
template: src=grid-install.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} owner="{{ grid_install_user }}" group={{ oracle_group }} mode=600 backup=yes
with_items: "{{asm_diskgroups}}"
run_once: "{{ configure_cluster}}"
template:
src=grid-install.rsp.{{ oracle_install_version_gi }}.j2
dest={{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }}
owner="{{ grid_install_user }}"
group={{ oracle_group }}
mode=0600
backup=yes
with_items: "{{ asm_diskgroups }}"
run_once: "{{ configure_cluster }}"
tags:
- responsefilegi
when: oracle_home_gi not in checkgiinstall.stdout and item.diskgroup == oracle_asm_init_dg

- name: install-home-gi | Install Grid Infrastructure
shell: "{{ oracle_stage_install }}/{{ oracle_install_version_gi }}/grid/runInstaller -responseFile {{ oracle_rsp_stage }}/{{ oracle_grid_responsefile }} -waitforcompletion -ignorePrereq -ignoreSysPrereqs -showProgress -silent"
become: yes
# noqa yaml command-instead-of-shell
become: true
become_user: "{{ grid_install_user }}"
run_once: "{{ configure_cluster}}"
run_once: "{{ configure_cluster }}"
tags:
- oragridinstall
when: oracle_home_gi not in checkgiinstall.stdout #and oracle_sw_unpack
when: oracle_home_gi not in checkgiinstall.stdout # and oracle_sw_unpack
register: giinstall

- debug: var=giinstall.stdout_lines
run_once: "{{ configure_cluster}}"
# noqa unnamed-task
run_once: "{{ configure_cluster }}"
when: oracle_home_gi not in checkgiinstall.stdout

- include_role:
name: oraswgi-manage-patches
# noqa unnamed-task
name: oraswgi-manage-patches
when: patch_before_rootsh and apply_patches_gi

- name: install-home-gi | Run oraInstroot script after installation
shell: "{{ oracle_inventory_loc }}/orainstRoot.sh"
become: yes
# noqa command-instead-of-shell
become: true
tags:
- runroot
when: oracle_home_gi not in checkgiinstall.stdout

- name: install-home-gi | Run root script after installation (Master Node)
shell: "{{ oracle_home_gi }}/root.sh"
become: yes
run_once: "{{ configure_cluster}}"
# noqa command-instead-of-shell
become: true
run_once: "{{ configure_cluster }}"
tags:
- runroot
when: oracle_home_gi not in checkgiinstall.stdout
register: rootmaster

- debug: var=rootmaster.stdout_lines
run_once: "{{ configure_cluster}}"
# noqa unnamed-task
run_once: "{{ configure_cluster }}"
when: oracle_home_gi not in checkgiinstall.stdout

- name: install-home-gi | Run root script after installation (Other Nodes)
shell: "sleep {{ item.0 * 60 }}; {{ oracle_home_gi }}/root.sh"
become: yes
with_indexed_items: "{{groups[hostgroup]}}"
# noqa command-instead-of-shell
become: true
with_indexed_items: "{{ groups[hostgroup] }}"
tags:
- runroot
#when: oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1
# when: oracle_home_gi not in checkgiinstall.stdout and inventory_hostname == item.1
when: configure_cluster and inventory_hostname != cluster_master and inventory_hostname == item.1 and oracle_home_gi not in checkgiinstall.stdout
register: rootother

- debug: var=rootother.stdout_lines
#when: not master_node and oracle_home_gi not in checkgiinstall.stdout
# noqa unnamed-task ignore-errors
# when: not master_node and oracle_home_gi not in checkgiinstall.stdout
when: configure_cluster and inventory_hostname != cluster_master and oracle_home_gi not in checkgiinstall.stdout
ignore_errors: True
ignore_errors: true

- name: install-home-gi | Setup response file for configToolAllCommands
template: src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2 dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp owner="{{ grid_install_user }}" group={{ oracle_group }} mode=755 backup=yes
run_once: "{{ configure_cluster}}"
template:
src=configtoolallcommands.rsp.{{ oracle_install_version_gi }}.j2
dest={{ oracle_rsp_stage }}/configtoolallcommands.rsp
owner="{{ grid_install_user }}"
group={{ oracle_group }}
mode=0755
backup=yes
run_once: "{{ configure_cluster }}"
tags:
- responsefileconfigtool
when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout

- name: install-home-gi | Run configToolAllCommands
shell: "{{ oracle_home_gi }}/cfgtoollogs/configToolAllCommands RESPONSE_FILE={{ oracle_rsp_stage }}/configtoolallcommands.rsp"
become: yes
# noqa command-instead-of-shell
become: true
become_user: "{{ grid_install_user }}"
run_once: "{{ configure_cluster}}"
run_once: "{{ configure_cluster }}"
tags:
- runconfigtool
when: run_configtoolallcommand and oracle_home_gi not in checkgiinstall.stdout
Expand Down
Loading

0 comments on commit 28b28ee

Please sign in to comment.