Refactor ansible inventory path and update output in get-host-info action.yml
This commit is contained in:
@@ -28,4 +28,4 @@ runs:
|
|||||||
TARGET_HOST: ${{ inputs.target-host }}
|
TARGET_HOST: ${{ inputs.target-host }}
|
||||||
run: |
|
run: |
|
||||||
system_id=$(ansible -i ansible/inventory/hosts -b -u $ANSIBLE_USER -m shell -a "read_system_id" $TARGET_HOST | tail -1)
|
system_id=$(ansible -i ansible/inventory/hosts -b -u $ANSIBLE_USER -m shell -a "read_system_id" $TARGET_HOST | tail -1)
|
||||||
echo "::set-output name=system-id::$system_id"
|
echo "system-id=$system_id" >> $GITHUB_OUTPUT
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ runs:
|
|||||||
HOST_GROUP: ${{ inputs.host-group }}
|
HOST_GROUP: ${{ inputs.host-group }}
|
||||||
run: |
|
run: |
|
||||||
ansible-inventory -i ansible/inventory/hosts --list --yaml $HOST_GROUP | grep -oP '(\w+\.){2}\w+' | sort -u > /tmp/ansible_hosts
|
ansible-inventory -i ansible/inventory/hosts --list --yaml $HOST_GROUP | grep -oP '(\w+\.){2}\w+' | sort -u > /tmp/ansible_hosts
|
||||||
echo "::set-output name=hosts::$(cat /tmp/ansible_hosts)"
|
echo "hosts=$(cat /tmp/ansible_hosts)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Read SSH host keys from remote hosts
|
- name: Read SSH host keys from remote hosts
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -78,7 +78,7 @@ runs:
|
|||||||
echo 'sectool vault get SSH_PASSWORD' > ~/.ssh_askpass && chmod +x ~/.ssh_askpass
|
echo 'sectool vault get SSH_PASSWORD' > ~/.ssh_askpass && chmod +x ~/.ssh_askpass
|
||||||
DISPLAY=None SSH_ASKPASS=~/.ssh_askpass ssh-add ~/.ssh/id_ecdsa < /dev/null
|
DISPLAY=None SSH_ASKPASS=~/.ssh_askpass ssh-add ~/.ssh/id_ecdsa < /dev/null
|
||||||
rm ~/.ssh_askpass
|
rm ~/.ssh_askpass
|
||||||
echo "::set-output name=ssh-auth-sock::$SSH_AUTH_SOCK"
|
echo "ssh-auth-sock=$SSH_AUTH_SOCK" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Check SSH Connection to remote hosts
|
- name: Check SSH Connection to remote hosts
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user