action-ansible-playbook/.github/workflows/test.yml
2020-05-03 11:55:12 +02:00

59 lines
1.5 KiB
YAML

name: Test Action
on: push
jobs:
test-remote:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup remote
run: |
echo "${{secrets.SSH_PUBLIC_KEY}}" | sudo tee /etc/ssh/authorized_keys
sudo tee /etc/ssh/sshd_config <<EOF
PasswordAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile /etc/ssh/authorized_keys
PermitRootLogin no
Subsystem sftp /usr/lib/openssh/sftp-server
EOF
sudo systemctl restart sshd
- name: Test remote
uses: ./
with:
playbook: playbook.yml
directory: ./
key: ${{secrets.SSH_PRIVATE_KEY}}
inventory: |
[all]
localhost
test-local:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Test local
uses: ./
with:
playbook: playbook.yml
options: |
--inventory hosts
--limit local
test-local-more:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Test local
uses: ./
with:
playbook: playbook.yml
vault_password: test
inventory: |
[all]
localhost ansible_connection=local
options: |
-e key1=val1
-e key2=val2