mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-12-06 21:17:15 -07:00
Add support for SSH Host Key Checking
By default it seems that SSH host key checking has been disabled. This patch makes it optional. If a variable named known_hosts is passed in, the key checking will be enabled. The variable should contain the complete contents of the known_hosts file, which must contain the public key(s) of the host(s) in the inventory.
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -65,11 +65,15 @@ jobs:
|
||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||
EOF
|
||||
sudo systemctl restart sshd
|
||||
echo 'SSH_KNOWN_HOSTS<<EOF' >> $GITHUB_ENV
|
||||
echo $(ssh-keyscan localhost) >> $GITHUB_ENV
|
||||
echo 'EOF' >> $GITHUB_ENV
|
||||
- name: With everything
|
||||
uses: ./
|
||||
with:
|
||||
playbook: playbook.yml
|
||||
key: ${{env.SSH_PRIVATE_KEY}}
|
||||
known_hosts: ${{env.SSH_KNOWN_HOSTS}}
|
||||
directory: test
|
||||
vault_password: test
|
||||
requirements: requirements.yml
|
||||
|
||||
Reference in New Issue
Block a user