Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onr/dsos 2682/onr boe installer #677

Merged
merged 6 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
ansible_aws_ssm_bucket_name: s3-bucket20240321142315369800000001
dns_zone_internal: oasys-national-reporting.hmpps-development.modernisation-platform.internal
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
ansible_aws_ssm_bucket_name: s3-bucket20240321144721125500000001
dns_zone_internal: oasys-national-reporting.hmpps-preproduction.modernisation-platform.internal
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
ansible_aws_ssm_bucket_name: s3-bucket20240321144737986100000001
dns_zone_internal: oasys-national-reporting.hmpps-production.modernisation-platform.internal
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
ansible_aws_ssm_bucket_name: s3-bucket20240321144723303200000002
dns_zone_internal: oasys-national-reporting.hmpps-test.modernisation-platform.internal
76 changes: 75 additions & 1 deletion ansible/group_vars/server_type_onr_boe.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
---
ansible_python_interpreter: /usr/local/bin/python3.6
# FIXME: this is a rhel 6.9 instance so 'packages' role may not work the same way

users_and_groups_system:
- name: bobj
group: binstall
groups:
- dba
- sapsys

server_type_roles_list:
- users-and-groups
- sudoers
- get-ec2-facts
- set-ec2-hostname
- domain-search
- disable-ipv6
- disable-firewall
- time
- packages
- message-of-the-day
- amazon-ssm-agent
- amazon-cli
- ansible-script
- epel
- disks
# - oracle-19c-client
# - oracle-tns-entries
# - ncr-bip
- onr-boe
- collectd
- amazon-cloudwatch-agent
- amazon-cloudwatch-agent-collectd
# - collectd-service-metrics TODO: not defined yet

roles_list: "{{ (ami_roles_list | default([]) | difference(server_type_roles_list | default([]))) + (server_type_roles_list | default([])) }}"

packages_yum_install:
- nano
- vim
- make
- libstdc++.i686
- libstdc++.x86_64
- glibc.i686
- glibc.x86_64
- libX11.i686
- libX11.x86_64
- libXext.i686
- libXext.x86_64
- expat.i686
- expat.x86_64
# - libxcrypt.i686 removed from list as package is not available in RHEL 6
- libgcc.i686
- libgcc.x86_64
# - libnsl.i686 removed from list as package is not available in RHEL 6
- libXcursor.i686
- libXcursor.x86_64
- libXrender.i686
- libXrender.x86_64
- libXfixes.i686
- libXfixes.x86_64
- libxcb.i686
- libxcb.x86_64
- libXau.i686
- libXau.x86_64
- xz-libs.i686

disks_mount:
- ebs_device_name: /dev/sdb
dir: /u01
fstype: ext4
- ebs_device_name: /dev/sdc
dir: /u02
fstype: ext4
# - ebs_device_name: /dev/sds
# dir: swap
# fstype: swap
12 changes: 12 additions & 0 deletions ansible/roles/onr-boe/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
artefacts_s3_bucket_name: mod-platform-image-artefact-bucket20230203091453221500000001
artefacts_s3_bucket_path: hmpps/onr
artefact_dir: /u02 # check this
app_dir: /u01/app # check this

boe_software: ENTERPRISE07P_4-10007478.TGZ
boe_install_user: bobj
boe_install_group: binstall

stage: "{{ artefact_dir }}/stage"
temp: "{{ artefact_dir }}/temp"
6 changes: 6 additions & 0 deletions ansible/roles/onr-boe/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
dependencies:
- role: get-ec2-facts
- role: ansible-requirements
# - role: disable-ipv6 TODO: ask Craig what this is for
- role: disable-firewall
39 changes: 39 additions & 0 deletions ansible/roles/onr-boe/tasks/download-software.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
- name: Create directories
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ boe_install_user }}"
group: "{{ boe_install_group }}"
state: directory
recurse: yes
loop:
- "{{ temp }}"
- "{{ stage }}"
tags:
- amibuild
- oracle_19c_download
- oracle_19c_create_dirs

# - name: Download oracle prerequisite rpms from S3 bucket
# amazon.aws.aws_s3:
# bucket: "{{ artefacts_s3_bucket_name }}"
# object: "{{ artefacts_s3_bucket_path }}/{{ item }}"
# dest: "{{ stage }}/{{ item }}"
# mode: get
# overwrite: latest
# loop:
# - "{{ oracle_prereq_rpm }}"
# - "{{ oracle_asmlib_rpm }}"
# - "{{ oracleasm_support_rpm }}"

- name: Download Oracle 19c software from S3 bucket
amazon.aws.aws_s3:
bucket: "{{ artefacts_s3_bucket_name }}"
object: "{{ artefacts_s3_bucket_path }}/{{ item }}"
dest: "{{ stage }}/{{ item }}"
mode: get
overwrite: latest
loop:
- "{{ boe_software }}"
# - "{{ grid_software }}"
# - "{{ opatch }}"
38 changes: 38 additions & 0 deletions ansible/roles/onr-boe/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# - import_tasks: prereqs.yml
# tags:
# - always

# - import_tasks: users.yml
# tags:
# - amibuild
# - ec2provision
# - oracle_db_users

# - name: Set selinux to permissive mode
# import_role:
# name: selinux-config
# vars:
# selinux_state: permissive
# tags:
# - amibuild
# - ec2provision
# - oracle_db_selinux_permissive

# - import_tasks: get-facts.yml
# tags:
# - ec2provision
# - oracle_db_get_facts
# - oracle_db_reconfigure_has
# - oracle_db_restore_databases

- import_tasks: download-software.yml
tags:
- amibuild
- ec2provision
# - oracle_db_get_base_software
# - import_tasks: install-base-software.yml
# tags:
# - amibuild
# - ec2provision
# - oracle_db_install_base_software
Loading