mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-28 17:11:00 -05:00
Fix Ansible tests (#2668)
This commit is contained in:
parent
c5e5046b8b
commit
657efa16e5
8 changed files with 27 additions and 27 deletions
|
@ -9,6 +9,6 @@
|
||||||
# GHE config apply #
|
# GHE config apply #
|
||||||
####################
|
####################
|
||||||
- name: ghe config apply
|
- name: ghe config apply
|
||||||
command: ghe-config-apply
|
ansible.builtin.command: ghe-config-apply
|
||||||
poll: 0
|
poll: 0
|
||||||
async: 300
|
async: 300
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
- name: Wait for Admin port to come up (Port 8443)
|
- name: Wait for Admin port to come up (Port 8443)
|
||||||
## Doc: http://docs.ansible.com/ansible/latest/modules/wait_for_module.html
|
## Doc: http://docs.ansible.com/ansible/latest/modules/wait_for_module.html
|
||||||
## Helpful Google: ansible wait_for
|
## Helpful Google: ansible wait_for
|
||||||
wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: "{{ ansible_host }}"
|
host: "{{ ansible_host }}"
|
||||||
port: 8443
|
port: 8443
|
||||||
delay: 5
|
delay: 5
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
#################################
|
#################################
|
||||||
- name: Wait for http status 200
|
- name: Wait for http status 200
|
||||||
changed_when: false
|
changed_when: false
|
||||||
uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ ansible_host }}:8443"
|
url: "https://{{ ansible_host }}:8443"
|
||||||
validate_certs: "no"
|
validate_certs: "no"
|
||||||
register: http_result
|
register: http_result
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
# and place it on the new remote machine
|
# and place it on the new remote machine
|
||||||
- name: Copy collectd-settings.json File to GHE
|
- name: Copy collectd-settings.json File to GHE
|
||||||
become: true
|
become: true
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "collectd-settings.json.j2"
|
src: "collectd-settings.json.j2"
|
||||||
dest: /tmp/collectd-settings.json
|
dest: /tmp/collectd-settings.json
|
||||||
owner: admin
|
owner: admin
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
########################################################
|
########################################################
|
||||||
- name: Setup Grafana
|
- name: Setup Grafana
|
||||||
# yamllint disable
|
# yamllint disable
|
||||||
shell: curl --fail -Lk \
|
ansible.builtin.shell: curl --fail -Lk \
|
||||||
-X PUT "https://api_key:{{ github_admin_password }}@{{ ansible_host }}:8443/setup/api/settings" \
|
-X PUT "https://api_key:{{ github_admin_password }}@{{ ansible_host }}:8443/setup/api/settings" \
|
||||||
--data-urlencode "settings=`cat /tmp/collectd-settings.json`"
|
--data-urlencode "settings=`cat /tmp/collectd-settings.json`"
|
||||||
# yamllint enable
|
# yamllint enable
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
#####################################
|
#####################################
|
||||||
- name: Copy forwarding.conf File to GHE
|
- name: Copy forwarding.conf File to GHE
|
||||||
become: true
|
become: true
|
||||||
template:
|
ansible.builtin.template:
|
||||||
force: true
|
force: true
|
||||||
src: "forwarding.conf.j2"
|
src: "forwarding.conf.j2"
|
||||||
dest: /etc/collectd/conf.d/forwarding.conf
|
dest: /etc/collectd/conf.d/forwarding.conf
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
###########################################
|
###########################################
|
||||||
- name: Restart Collectd service
|
- name: Restart Collectd service
|
||||||
become: true
|
become: true
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: collectd
|
name: collectd
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
# Run config to take in settings #
|
# Run config to take in settings #
|
||||||
##################################
|
##################################
|
||||||
- name: Run Configure for Settings to Take Effect
|
- name: Run Configure for Settings to Take Effect
|
||||||
uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ ansible_host }}:8443/setup/api/configure"
|
url: "https://{{ ansible_host }}:8443/setup/api/configure"
|
||||||
method: POST
|
method: POST
|
||||||
return_content: "yes"
|
return_content: "yes"
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
# https://docs.ansible.com/ansible/uri_module.html
|
# https://docs.ansible.com/ansible/uri_module.html
|
||||||
# yamllint disable-line
|
# yamllint disable-line
|
||||||
# https://developer.github.com/enterprise/v3/enterprise-admin/management_console/#check-configuration-status
|
# https://developer.github.com/enterprise/v3/enterprise-admin/management_console/#check-configuration-status
|
||||||
uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ ansible_host }}:8443/setup/api/configcheck"
|
url: "https://{{ ansible_host }}:8443/setup/api/configcheck"
|
||||||
method: GET
|
method: GET
|
||||||
return_content: "yes"
|
return_content: "yes"
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
# files that were copied to the ghe server
|
# files that were copied to the ghe server
|
||||||
- name: Remove temp Files from GHE
|
- name: Remove temp Files from GHE
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items:
|
with_items:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
########################################
|
########################################
|
||||||
- name: Copy the script to the GHE instance
|
- name: Copy the script to the GHE instance
|
||||||
become: true
|
become: true
|
||||||
template:
|
ansible.builtin.template:
|
||||||
force: 'yes'
|
force: 'yes'
|
||||||
src: "ghe-config-apply.sh"
|
src: "ghe-config-apply.sh"
|
||||||
dest: /tmp/ghe-config-apply.sh
|
dest: /tmp/ghe-config-apply.sh
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
# Run config to take in settings #
|
# Run config to take in settings #
|
||||||
##################################
|
##################################
|
||||||
- name: Run ghe-config-apply for Settings to Take Effect
|
- name: Run ghe-config-apply for Settings to Take Effect
|
||||||
shell: "nohup ./tmp/ghe-config-apply.sh </dev/null >/dev/null 2>&1 &"
|
ansible.builtin.shell: "nohup ./tmp/ghe-config-apply.sh </dev/null >/dev/null 2>&1 &"
|
||||||
async: 300
|
async: 300
|
||||||
poll: 0
|
poll: 0
|
||||||
args:
|
args:
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# yamllint disable-line
|
# yamllint disable-line
|
||||||
## Documentation: http://docs.ansible.com/ansible/latest/modules/wait_for_module.html
|
## Documentation: http://docs.ansible.com/ansible/latest/modules/wait_for_module.html
|
||||||
## Helpful Google: ansible wait_for
|
## Helpful Google: ansible wait_for
|
||||||
wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: "{{ ansible_host }}"
|
host: "{{ ansible_host }}"
|
||||||
port: 8443
|
port: 8443
|
||||||
delay: 5
|
delay: 5
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
#################################
|
#################################
|
||||||
- name: Wait for http status 200
|
- name: Wait for http status 200
|
||||||
changed_when: false
|
changed_when: false
|
||||||
uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ ansible_host }}:8443"
|
url: "https://{{ ansible_host }}:8443"
|
||||||
validate_certs: "no"
|
validate_certs: "no"
|
||||||
register: http_result
|
register: http_result
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
# and place it on the new remote machine
|
# and place it on the new remote machine
|
||||||
- name: Copy License File to GHE
|
- name: Copy License File to GHE
|
||||||
become: true
|
become: true
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/ghe-license.ghl"
|
src: "{{ role_path }}/files/ghe-license.ghl"
|
||||||
dest: /tmp/ghe-license.ghl
|
dest: /tmp/ghe-license.ghl
|
||||||
owner: admin
|
owner: admin
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
# and place it on the new remote machine
|
# and place it on the new remote machine
|
||||||
- name: Copy settings.json File to GHE
|
- name: Copy settings.json File to GHE
|
||||||
become: true
|
become: true
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "settings.json.j2"
|
src: "settings.json.j2"
|
||||||
dest: /tmp/settings.json
|
dest: /tmp/settings.json
|
||||||
owner: admin
|
owner: admin
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
# Set up Admin password, License, and Initial Settings #
|
# Set up Admin password, License, and Initial Settings #
|
||||||
########################################################
|
########################################################
|
||||||
- name: Setup License, Admin Password, and Initial Settings
|
- name: Setup License, Admin Password, and Initial Settings
|
||||||
command: curl --fail -Lk \
|
ansible.builtin.command: curl --fail -Lk \
|
||||||
-X POST "https://{{ ansible_host }}:8443/setup/api/start" \
|
-X POST "https://{{ ansible_host }}:8443/setup/api/start" \
|
||||||
-F license=@/tmp/ghe-license.ghl \
|
-F license=@/tmp/ghe-license.ghl \
|
||||||
-F "password={{ github_admin_password }}" \
|
-F "password={{ github_admin_password }}" \
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
# Set the GHE Admin Password fact #
|
# Set the GHE Admin Password fact #
|
||||||
###################################
|
###################################
|
||||||
- name: Set the GitHub Admin password fact
|
- name: Set the GitHub Admin password fact
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
github_admin_password: "{{ github_admin_password }}"
|
github_admin_password: "{{ github_admin_password }}"
|
||||||
|
|
||||||
######################
|
######################
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# and place it on the new remote machine
|
# and place it on the new remote machine
|
||||||
- name: Copy ldap-settings.json File to GHE
|
- name: Copy ldap-settings.json File to GHE
|
||||||
become: true
|
become: true
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "ldap-settings.json.j2"
|
src: "ldap-settings.json.j2"
|
||||||
dest: /tmp/ldap-settings.json
|
dest: /tmp/ldap-settings.json
|
||||||
owner: admin
|
owner: admin
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
# Set up LDAP with ldap-settings.json #
|
# Set up LDAP with ldap-settings.json #
|
||||||
#######################################
|
#######################################
|
||||||
- name: Setup ldap with ldap-settings.json
|
- name: Setup ldap with ldap-settings.json
|
||||||
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
|
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
|
retries: 10
|
||||||
delay: 2
|
delay: 2
|
||||||
register: http_ldapconfig_result
|
register: http_ldapconfig_result
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# Need to run the tasks to stand up the GHE instance #
|
# Need to run the tasks to stand up the GHE instance #
|
||||||
######################################################
|
######################################################
|
||||||
# Configure the base system
|
# Configure the base system
|
||||||
- include_tasks: ghe-initial-configuration.yml
|
- ansible.builtin.include_tasks: ghe-initial-configuration.yml
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# Set the tags block #
|
# Set the tags block #
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
# Need to run the tasks to config LDAP on the GHE instance #
|
# Need to run the tasks to config LDAP on the GHE instance #
|
||||||
############################################################
|
############################################################
|
||||||
# Configure the base system
|
# Configure the base system
|
||||||
- include_tasks: ghe-ldap-configuration.yml
|
- ansible.builtin.include_tasks: ghe-ldap-configuration.yml
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# Set the tags block #
|
# Set the tags block #
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
# Need to run the tasks to stand up the GHE instance #
|
# Need to run the tasks to stand up the GHE instance #
|
||||||
######################################################
|
######################################################
|
||||||
# Configure the base system
|
# Configure the base system
|
||||||
- include_tasks: ghe-api-config-apply.yml
|
- ansible.builtin.include_tasks: ghe-api-config-apply.yml
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# Set the tags block #
|
# Set the tags block #
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
- name: Wait for Admin port to come up (Port 8443)
|
- name: Wait for Admin port to come up (Port 8443)
|
||||||
## Doc: http://docs.ansible.com/ansible/latest/modules/wait_for_module.html
|
## Doc: http://docs.ansible.com/ansible/latest/modules/wait_for_module.html
|
||||||
## Helpful Google: ansible wait_for
|
## Helpful Google: ansible wait_for
|
||||||
wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: "{{ ansible_host }}"
|
host: "{{ ansible_host }}"
|
||||||
port: 8443
|
port: 8443
|
||||||
delay: 5
|
delay: 5
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
#################################
|
#################################
|
||||||
- name: Wait for http status 200
|
- name: Wait for http status 200
|
||||||
changed_when: false
|
changed_when: false
|
||||||
uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ ansible_host }}:8443"
|
url: "https://{{ ansible_host }}:8443"
|
||||||
validate_certs: "no"
|
validate_certs: "no"
|
||||||
register: http_result
|
register: http_result
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
# and place it on the new remote machine
|
# and place it on the new remote machine
|
||||||
- name: Copy splunk-settings.json File to GHE
|
- name: Copy splunk-settings.json File to GHE
|
||||||
become: true
|
become: true
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "splunk-settings.json.j2"
|
src: "splunk-settings.json.j2"
|
||||||
dest: /tmp/splunk-settings.json
|
dest: /tmp/splunk-settings.json
|
||||||
owner: admin
|
owner: admin
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
########################################################
|
########################################################
|
||||||
- name: Setup Splunk
|
- name: Setup Splunk
|
||||||
# yamllint disable
|
# yamllint disable
|
||||||
shell: curl --fail -Lk \
|
ansible.builtin.shell: curl --fail -Lk \
|
||||||
-X PUT "https://api_key:{{ github_admin_password }}@{{ ansible_host }}:8443/setup/api/settings" \
|
-X PUT "https://api_key:{{ github_admin_password }}@{{ ansible_host }}:8443/setup/api/settings" \
|
||||||
--data-urlencode "settings=`cat /tmp/splunk-settings.json`"
|
--data-urlencode "settings=`cat /tmp/splunk-settings.json`"
|
||||||
# yamllint enable
|
# yamllint enable
|
||||||
|
|
Loading…
Reference in a new issue