blob: 288b391ef4556da0055da04f2afa3e0d5d194050 [file] [log] [blame]
---
# tasks file for apigee-opdk-setup-silent-file
- name: Update cache with manual_response_file if provided
cache:
key: 'manual_response_file'
value: '{{ manual_response_file }}'
when: manual_response_file is defined
- name: Construct the Edge response file
cache:
key: opdk_installation_config_file
value: "{{ opdk_installer_path }}/edge-response-{{ opdk_version }}-{{ region }}.conf"
- name: Remove the old response file
become: yes
file:
path: "{{ opdk_installation_config_file }}"
state: absent
when: manual_response_file is not defined or not manual_response_file
- name: Fail if ldap password is not provided
fail:
msg: "Ldap password is required, please provide ldap password"
when: opdk_ldap_pass is not defined or opdk_ldap_pass == ""
- include_tasks: cassandra.yml
- name: Regional LDAP IP for dc-1 if replicating LDAP
set_fact:
ldap_sid: '1'
ldap_peer: "{{ hostvars[groups['dc-2-ldap'][0]]['private_address'] }}"
when: region == 'dc-1' and opdk_ldap_type == '2' and groups['dc-2-ldap'] is defined
- name: Regional LDAP IP for dc-2 if replicating LDAP
set_fact:
ldap_sid: '2'
ldap_peer: "{{ hostvars[groups['dc-1-ldap'][0]]['private_address'] }}"
when: region == 'dc-2' and opdk_ldap_type == '2' and groups['dc-1-ldap'] is defined
- name: Ensure that a folder exists for the file to be generated
become: yes
file:
path: "{{ opdk_installation_config_file | dirname }}"
state: directory
- name: Construct name of the response file
cache:
key: 'opdk_installation_config_file'
value: '{{ opdk_installer_path }}/edge-response-{{ opdk_version }}-{{ region }}.conf'
- name: Touch file
become: yes
file:
state: touch
path: "{{ opdk_installation_config_file }}"
- name: Construct the silent-install file
become: yes
template:
src: 'silent-install.conf.j2'
dest: "{{ opdk_installation_config_file }}"
force: yes
owner: '{{ opdk_user_name }}'
group: '{{ opdk_group_name }}'
mode: 0655
when: manual_response_file is not defined or not manual_response_file
tags: ['no-silent-install']
- name: Copy provided silent-install file
become: yes
copy:
src: "{{ manual_response_file }}"
dest: "{{ opdk_installation_config_file }}"
owner: '{{ opdk_user_name }}'
group: '{{ opdk_group_name }}'
mode: 0655
when: manual_response_file is defined and manual_response_file
tags: ['no-silent-install']