lint/test/linters/ansible/roles/ghe_initialize/tasks/ghe-ldap-configuration.yml
Marco Ferrari e6cf8d3845
Move tests to the test directory (#4985)
* Move tests to the test directory

* Fix linting errors

* Add states back

* Add xml back
2023-12-15 08:50:35 +00:00

31 lines
1.1 KiB
YAML

---
- name: GHE LDAP configuration
######################
# Set the tags block #
######################
tags:
- openldap
block:
#######################################################
# 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
ansible.builtin.template:
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
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
retries: 10
delay: 2
register: http_ldapconfig_result
until: http_ldapconfig_result.rc == 0