This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Run scripts should now ignore errors, and hopefully produce files as intended * Artifacts should now be created in the running directory * Creating individual artifact directories and doing result scan after * Fixed a ws issue with run_scripts playbook * Run scripts did not accept the chdir arg * Fixed typo for scripts results variable * Adding archive step to run tests since it should really be part of the default test * Explicitly calling archive since vars my not be referencable from other vars * Linchpin workspace should now default to libraries spec * Updated tests and fixed codenarc issues * Update release version and add parsing function * Codenarc narcing all over the new function * Updating CI Message to have better error handling and a map return * SSH mode support and remote target host update * Added lines to cover installing cert for RCM tools * Installing certs on host so we can pull down dev imgs * Ensuring backup cert install is still available * Fixed curl requests so that they will install certs correctly * Credentials should now be installed correctly on SSH mode hosts, and guaranteed install when rhpkg is specified * Moved script object into the final closure, so objects can be passed to it in SSH mode. * Updated logic to allow for non-root ssh mode, secret file injection, and env exports * Inject secret locations failed, so attemting to remove layer of indirection * Updating utils to once against attempt variable injection * Codenarc is a narc * Attempting to escape $ so that file in inject * Updated local install to mkdirs before copying files there * Removed Jenkins krb principal for files list * We should now install the correct rhpkg tools per the rhel host spec * Added overridable map for inventory vars * Fixed syntax for NoOpProvisioner inventory vars override * Renamed inventoryVars, updated tests, and ensured proper functioning for NoOpProvisioner * Variable naming convention consistency in LinchPin workspace * Reading hostname and ensuring only the hostname is picked up * Package name fix for RHEL-8 * Renamed resource playbooks to indicate what they were * Fixed distribution version * Fixed ternary grouping * Fixing python package install on RHEL 8 * Fixed path issue for renamed playbooks * RHEL 7 targets should no longer attempt to install python 3 * Renamed test output file to runlog * CI message should now be cleaned up * Pulled script var back out into the genericInstall since JNLP mode needs to be able to change the node BEFORE calling the sh step
- Loading branch information
Showing
16 changed files
with
310 additions
and
96 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
- name: "Run Scripts on each Inventory Host" | ||
hosts: all | ||
gather_facts: true | ||
vars_prompt: | ||
- name: test_dir | ||
prompt: "Please enter the path to your tests" | ||
|
||
tasks: | ||
- name: install rsync and the utilities to copy the tests to the remote host | ||
package: | ||
name: "{{ item }}" | ||
state: latest | ||
with_items: | ||
- rsync | ||
- "{{ ((ansible_facts['distribution'] == 'RedHat' or ansible_facts['distribution'] == 'CentOS') and | ||
ansible_facts['distribution_major_version'] | int >= 8) | | ||
ternary('python3-libselinux', 'libselinux-python') }}" | ||
- "{{ ((ansible_facts['distribution'] == 'RedHat' or ansible_facts['distribution'] == 'CentOS') and | ||
ansible_facts['distribution_major_version'] | int >= 8) | | ||
ternary('python3', 'python2') }}" | ||
|
||
- name: create a directory for the tests on the remote host | ||
file: | ||
path: "/tmp/{{ test_dir }}" | ||
state: directory | ||
|
||
- name: copy the tests onto the hosts where they will be executed | ||
synchronize: | ||
src: "{{ test_dir }}/scripts" | ||
dest: "/tmp/{{ test_dir }}" | ||
mode: push | ||
ignore_errors: true | ||
|
||
- name: scan and find the test scripts directory | ||
find: | ||
recurse: false | ||
paths: "/tmp/{{ test_dir }}/scripts" | ||
file_type: directory | ||
register: scripts_dir | ||
|
||
- name: loop through script directories and create artifacts directory | ||
file: | ||
path: "{{ script_dir }}/artifacts" | ||
state: directory | ||
loop: "{{ scripts_dir.files | map(attribute='path') | list }}" | ||
loop_control: | ||
loop_var: script_dir | ||
|
||
- name: loop through script directories, run test, and store artifacts | ||
shell: "bash -x test.sh {{ script_args | default('') }} &> artifacts/{{ ansible_architecture }}-runlog.txt" | ||
args: | ||
chdir: "{{ script_dir }}" | ||
loop: "{{ scripts_dir.files | map(attribute='path') | list }}" | ||
loop_control: | ||
loop_var: script_dir | ||
ignore_errors: yes | ||
register: scripts | ||
|
||
- name: fail if the return code is not 0 | ||
fail: | ||
msg: "The command ({{ item.cmd }}) failed with return code {{ item.rc }}" | ||
when: item.rc != 0 | ||
with_items: "{{ scripts.results }}" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.