mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-27 01:32:15 -05:00
91 lines
2.6 KiB
YAML
91 lines
2.6 KiB
YAML
|
---
|
||
|
- block:
|
||
|
###############################
|
||
|
# Wait for admin port to open #
|
||
|
###############################
|
||
|
- name: Wait for Admin port to come up (Port 8443)
|
||
|
## Doc: http://docs.ansible.com/ansible/latest/modules/wait_for_module.html
|
||
|
## Helpful Google: ansible wait_for
|
||
|
wait_for:
|
||
|
host: "{{ ansible_host }}"
|
||
|
port: 8443
|
||
|
delay: 5
|
||
|
timeout: 300
|
||
|
state: started
|
||
|
changed_when: false
|
||
|
|
||
|
#################################
|
||
|
# Wait for successful open port #
|
||
|
#################################
|
||
|
- name: Wait for http status 200
|
||
|
changed_when: false
|
||
|
uri:
|
||
|
url: "https://{{ ansible_host }}:8443"
|
||
|
validate_certs: "no"
|
||
|
register: http_result
|
||
|
# ignore_errors: true
|
||
|
until: http_result.status == 200
|
||
|
retries: 100
|
||
|
delay: 3
|
||
|
|
||
|
#######################################################
|
||
|
# 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 collectd-settings.json File to GHE
|
||
|
become: true
|
||
|
template:
|
||
|
src: "collectd-settings.json.j2"
|
||
|
dest: /tmp/collectd-settings.json
|
||
|
owner: admin
|
||
|
group: admin
|
||
|
mode: 0644
|
||
|
|
||
|
#########################################################
|
||
|
# Set up Admin password, License, and Initial Setttings #
|
||
|
#########################################################
|
||
|
- name: Setup Grafana
|
||
|
# yamllint disable
|
||
|
shell: curl --fail -Lk \
|
||
|
-X PUT "https://api_key:{{ github_admin_password }}@{{ ansible_host }}:8443/setup/api/settings" \
|
||
|
--data-urlencode "settings=`cat /tmp/collectd-settings.json`"
|
||
|
# yamllint enable
|
||
|
retries: 10
|
||
|
delay: 5
|
||
|
register: http_collectd_config_result
|
||
|
until: http_collectd_config_result.rc == 0
|
||
|
notify: ghe config apply
|
||
|
|
||
|
|
||
|
#####################################
|
||
|
# Edit forwarding.conf with metrics #
|
||
|
#####################################
|
||
|
- name: Copy forwarding.conf File to GHE
|
||
|
become: true
|
||
|
template:
|
||
|
force: true
|
||
|
src: "forwarding.conf.j2"
|
||
|
dest: /etc/collectd/conf.d/forwarding.conf
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0644
|
||
|
|
||
|
###########################################
|
||
|
# Restart Collectd service to take effect #
|
||
|
###########################################
|
||
|
- name: Restart Collectd service
|
||
|
become: true
|
||
|
service:
|
||
|
name: collectd
|
||
|
state: restarted
|
||
|
|
||
|
######################
|
||
|
# Set the tags block #
|
||
|
######################
|
||
|
tags:
|
||
|
- metrics
|
||
|
- github
|
||
|
- ghe_primary
|
||
|
- initialize
|