websoft9/apps/roles/oracle/tasks/pre.yml
2022-07-25 16:42:39 +08:00

76 lines
2.0 KiB
YAML

- pause:
prompt: |
Choice Oracle edition:
0: Oracle enterprise
1: Oracle express
private: no
Default:0
register: oracle_edition_options
- set_fact:
oracle_edition_meta:
"0": "enterprise"
"1": "express"
- set_fact:
oracle_edition: "{{oracle_edition_meta[oracle_edition_options.user_input]}}"
- block:
- pause:
prompt: |
Choice Oracle version:
0: Oracle 21
1: Oracle 18
private: no
Default:0
register: oracle_version_options
- set_fact:
oracle_version_meta:
"0": "21.3.0-xe"
"1": "18.4.0-xe"
- set_fact:
oracle_version: "{{oracle_version_meta[oracle_version_options.user_input]}}"
- debug:
msg: "oracle_version is {{oracle_version}}"
- name: Config .env and docker-compose for start containers
shell: |
sed -i 's/APP_VERSION=.*/APP_VERSION={{oracle_version}}/g' {{installpath}}/{{appname}}/.env
cat {{installpath}}/{{appname}}/docker-compose.yml |yq eval 'del(.services.oracleex.profiles)' > /tmp/tmp.yml
cat /tmp/tmp.yml > docker-compose.yml
when: oracle_edition == "express"
- block:
- pause:
prompt: |
Choice Oracle version:
0: Oracle 21
1: Oracle 19
2: Oracle 12
private: no
Default:0
register: oracle_version_options
- set_fact:
oracle_version_meta:
"0": "21.3.0.0"
"1": "19.3.0.0"
"2": "12.2.0.1"
- set_fact:
oracle_version: "{{oracle_version_meta[oracle_version_options.user_input]}}"
- debug:
msg: "oracle_version is {{oracle_version}}"
- name: Config .env and docker-compose for start containers
shell: |
sed -i 's/APP_VERSION=.*/APP_VERSION={{oracle_version}}/g' {{installpath}}/{{appname}}/.env
yq eval 'del(.services.oracle.profiles)' docker-compose.yml > tmp.yml
cat tmp.yml > docker-compose.yml
rm -f tmp.yml
when: oracle_edition == "enterprise"