2020-02-04 09:49:58 -05:00
|
|
|
---
|
2022-05-23 15:51:47 -04:00
|
|
|
- name: GHE API Configuration
|
2023-04-10 14:33:15 -04:00
|
|
|
######################
|
|
|
|
# Set the tags block #
|
|
|
|
######################
|
|
|
|
tags:
|
|
|
|
- github
|
|
|
|
- ghe_primary
|
|
|
|
- initialize
|
2022-05-23 15:51:47 -04:00
|
|
|
block:
|
2020-02-04 09:49:58 -05:00
|
|
|
# ##################################
|
|
|
|
# # Run config to take in settings #
|
|
|
|
# ##################################
|
|
|
|
# - name: Run ghe-config-apply for Settings to Take Effect
|
|
|
|
# shell: "nohup ghe-config-apply </dev/null >/dev/null 2>&1 &"
|
|
|
|
# async: 45
|
|
|
|
# poll: 0
|
|
|
|
# args:
|
|
|
|
# executable: "/bin/bash"
|
|
|
|
|
|
|
|
##################################
|
|
|
|
# Run config to take in settings #
|
|
|
|
##################################
|
|
|
|
- name: Run Configure for Settings to Take Effect
|
2022-03-24 10:26:33 -04:00
|
|
|
ansible.builtin.uri:
|
2020-02-04 09:49:58 -05:00
|
|
|
url: "https://{{ ansible_host }}:8443/setup/api/configure"
|
|
|
|
method: POST
|
|
|
|
return_content: "yes"
|
|
|
|
user: "api_key"
|
|
|
|
password: "{{ github_admin_password }}"
|
|
|
|
force_basic_auth: "yes"
|
|
|
|
validate_certs: "no"
|
|
|
|
status_code: 202
|
|
|
|
|
|
|
|
#################################################################
|
|
|
|
# Wait for 'ghe-config-apply' to be completed before continuing #
|
|
|
|
#################################################################
|
|
|
|
- name: Ensure ghe-config-apply is completed
|
|
|
|
# https://docs.ansible.com/ansible/uri_module.html
|
|
|
|
# yamllint disable-line
|
|
|
|
# https://developer.github.com/enterprise/v3/enterprise-admin/management_console/#check-configuration-status
|
2022-03-24 10:26:33 -04:00
|
|
|
ansible.builtin.uri:
|
2020-02-04 09:49:58 -05:00
|
|
|
url: "https://{{ ansible_host }}:8443/setup/api/configcheck"
|
|
|
|
method: GET
|
|
|
|
return_content: "yes"
|
|
|
|
user: "api_key"
|
|
|
|
password: "{{ github_admin_password }}"
|
|
|
|
force_basic_auth: "yes"
|
|
|
|
validate_certs: "no"
|
|
|
|
register: configcheck
|
|
|
|
until: configcheck.status == 200 and configcheck.json.status == "success"
|
|
|
|
retries: 100
|
|
|
|
delay: 10
|
|
|
|
|
|
|
|
#####################################
|
|
|
|
# Remove the files from the machine #
|
|
|
|
#####################################
|
|
|
|
# Need to remove the license file and settings
|
|
|
|
# files that were copied to the ghe server
|
|
|
|
- name: Remove temp Files from GHE
|
|
|
|
become: true
|
2022-03-24 10:26:33 -04:00
|
|
|
ansible.builtin.file:
|
2020-02-04 09:49:58 -05:00
|
|
|
path: "{{ item }}"
|
|
|
|
state: absent
|
|
|
|
with_items:
|
|
|
|
- "/tmp/ghe-license.ghl"
|
|
|
|
- "/tmp/settings.json"
|
|
|
|
- "/tmp/ldap-settings.json"
|