lint/.automation/test/ansible/roles/ghe_initialize/tasks/ghe-ldap-configuration.yml

33 lines
1.1 KiB
YAML
Raw Normal View History

2020-02-04 09:49:58 -05:00
---
- name: GHE LDAP configuration
block:
2020-02-04 09:49:58 -05:00
#######################################################
# Copy License file to GHE to decrypt file and upload #
#######################################################
# Copy of the file will allow for Ansible Vault to decrypt the file
# and place it on the new remote machine
- name: Copy ldap-settings.json File to GHE
become: true
2022-03-24 10:26:33 -04:00
ansible.builtin.template:
2020-02-04 09:49:58 -05:00
src: "ldap-settings.json.j2"
dest: /tmp/ldap-settings.json
owner: admin
group: admin
mode: 0644
#######################################
# Set up LDAP with ldap-settings.json #
#######################################
- name: Setup ldap with ldap-settings.json
2022-03-24 10:26:33 -04:00
ansible.builtin.shell: curl --fail -Lk -X PUT 'https://api_key:{{ github_admin_password }}@{{ ansible_host }}:8443/setup/api/settings' --data-urlencode "settings=`cat /tmp/ldap-settings.json`" # yamllint disable-line
2020-02-04 09:49:58 -05:00
retries: 10
delay: 2
register: http_ldapconfig_result
until: http_ldapconfig_result.rc == 0
######################
# Set the tags block #
######################
tags:
- openldap