Skip to content
Snippets Groups Projects
Commit 273ae3ba authored by Jörg Sachse's avatar Jörg Sachse
Browse files

fix: use custom fact to write Rosetta app.version to global.properties file...

fix: use custom fact to write Rosetta app.version to global.properties file instead of the hardcoded shit that was used before and broke my installation
parent 7c31dd2e
No related branches found
No related tags found
No related merge requests found
Pipeline #6249 failed
#!/usr/bin/env bash
# example string in global.properties file:
# app.version=8.1.0.0
if [[ -e "/exlibris/dps/d4_1/system.dir/conf/global.properties" ]]; then
ver=$( grep -r "app.version" /exlibris/dps/d4_1/system.dir/conf/global.properties | cut -d "=" -f2 );
echo "{\"version\" : \"${ver}\"}";
fi
--- ---
### ROSETTA TASKS ### ROSETTA TASKS
- name: prepare custom facts
ansible.builtin.import_tasks: "rosetta/prepare_custom_facts.yml"
tags: [facts]
- name: configure iptables Rosetta - name: configure iptables Rosetta
ansible.builtin.import_tasks: "rosetta/configure_iptables_rosetta.yml" ansible.builtin.import_tasks: "rosetta/configure_iptables_rosetta.yml"
tags: [iptables] tags: [iptables]
......
---
- name: "Create custom fact directory"
ansible.builtin.file:
path: "/etc/ansible/facts.d"
state: "directory"
mode: "0755"
### ATTENTION!!!
# This custom fact script assumes that whatever app.version is set in the
# global.properties file IS THE CORRECT ONE! The mechanism is quite trivial:
# read the old value, set it as fact, write it to the template.
# If the previous app.version is set incorrectly, then the new one will be as
# well!
# Read up on custom facts here:
# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html#adding-custom-facts
- name: install custom fact file for getting installed Rosetta version
ansible.builtin.copy:
src: "etc/ansible/facts.d/rosetta_app_version.fact"
dest: "/etc/ansible/facts.d/rosetta_app_version.fact"
mode: "0755"
- name: "Re-run setup to use custom facts"
ansible.builtin.setup: ~
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment