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

Make some of the j2 templates source configurable #296

Merged
merged 1 commit into from
Nov 18, 2022
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
Make some of the j2 templates source configurable
  • Loading branch information
talek committed Nov 16, 2022
commit c7682572efeb8f0fbdd8b895234610f513d555a4
3 changes: 3 additions & 0 deletions changelogs/fragments/custom_template_path.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- "common, orahost, oraswdb_install: Make some of the j2 templates source configurable"
1 change: 1 addition & 0 deletions roles/common/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ install_os_packages: true
configure_epel_repo: true
configure_public_yum_repo: true
configure_motd: true
motd_template: motd.j2
configure_ntp: true
ntp_type: "{% if ansible_distribution_major_version | int >= 8 %}chrony\
{%- else %}ntp\
Expand Down
2 changes: 1 addition & 1 deletion roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

- name: Add motd
ansible.builtin.template:
src: motd.j2
src: "{{ motd_template }}"
dest: /etc/motd
mode: 0644
tags: motd
Expand Down
1 change: 1 addition & 0 deletions roles/orahost/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ oracle_user: oracle # User that will own the Oracle Insta
grid_user: grid
grid_install_user: "{% if role_separation %}{{ grid_user }}{% else %}{{ oracle_user }}{% endif %}"
configure_oracle_sudo: false
sudoers_template: sudoers.j2
etc_hosts_ip: "{% if 'virtualbox' in ansible_virtualization_type %}{{ ansible_all_ipv4_addresses[1] }}{% else %}{{ ansible_default_ipv4.address }}{% endif %}"
oracle_inventory_loc: /u01/app/oraInventory

Expand Down
4 changes: 2 additions & 2 deletions roles/orahost/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@

- name: User | Add Oracle user to sudoers
ansible.builtin.template:
src: sudoers.j2
src: "{{ sudoers_template }}"
dest: "/etc/sudoers.d/{{ item.username }}"
owner: root
mode: 0440
Expand All @@ -177,7 +177,7 @@

- name: User | Add Grid user to sudoers
ansible.builtin.template:
src: sudoers.j2
src: "{{ sudoers_template }}"
dest: "/etc/sudoers.d/{{ item.username }}"
owner: root
mode: 0440
Expand Down
2 changes: 2 additions & 0 deletions roles/oraswdb_install/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ oracle_sw_extract_path: "{%- if '18' in db_version -%}\
{{ oracle_stage }}/{{ item[0].version }}\
{%- endif -%}"

configure_oracle_profile: true
oracle_profile_name: ".profile_{{ dbh.home }}"
oracle_profile_template: dotprofile-home.j2

oracle_hostname: "{{ ansible_fqdn }}" # Full (FQDN) name of the host
www_download_bin: curl # curl (shell module) or get_url module
Expand Down
3 changes: 2 additions & 1 deletion roles/oraswdb_install/tasks/install-home-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@

- name: install_home_db | add dotprofile
ansible.builtin.template:
src: dotprofile-home.j2
src: "{{ oracle_profile_template }}"
dest: "{{ oracle_user_home }}/{{ oracle_profile_name }}"
owner: "{{ oracle_user }}"
group: "{{ oracle_group }}"
mode: 0660
# when: oracle_home_db not in existing_dbhome.stdout_lines
when: configure_oracle_profile
tags: create_db,dotprofile_db

- name: install_home_db | Setup response file for install (DB)
Expand Down