firmitas: replace file lookup with slurp task

Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
David Kirwan 2024-07-22 14:00:27 +01:00
parent 9e9dc31365
commit 93f9c80613
No known key found for this signature in database
GPG key ID: A5893AB6474AC37D

View file

@ -16,7 +16,7 @@
- firmitas-configuration-secret
# generate the templates for project to be created
- name: Create the myconfig.py configuration
- name: Create the certlist.yml configuration
ansible.builtin.template:
src: certlist.yml.j2
dest: /ocp4/openshift-apps/firmitas/certlist.yml
@ -26,6 +26,17 @@
tags:
- firmitas-configuration-secret
- name: read remote values.txt
register: firmitas_myconfig_py_file
ansible.builtin.slurp:
src: "/ocp4/openshift-apps/firmitas/myconfig.py"
- name: read remote values.txt
register: firmitas_certlist_yml_file
ansible.builtin.slurp:
src: "/ocp4/openshift-apps/firmitas/certlist.yml"
# Create the Secret from this file
# generate the templates for project to be created
- name: copy the templates to the host
@ -33,16 +44,6 @@
src: "secret-configuration.yml"
dest: "/root/ocp4/openshift-apps/firmitas/secret-configuration.yml"
mode: 0600
vars:
firmitas_myconfig_py_file:
"{{ lookup('file',
'/ocp4/openshift-apps/firmitas/myconfig.py')
}}"
firmitas_certlist_yml_file:
"{{ lookup('file',
'/ocp4/openshift-apps/firmitas/certlist.yml')
}}"
# apply the openshift resources
- name: oc apply resources