2020-03-21 10:06:40 -06:00
|
|
|
name: Test Action
|
|
|
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
jobs:
|
2020-04-06 15:45:33 -06:00
|
|
|
test-remote:
|
2020-03-21 10:06:40 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-03-22 05:17:17 -06:00
|
|
|
- name: Checkout code
|
2020-03-21 10:06:40 -06:00
|
|
|
uses: actions/checkout@v2
|
2020-05-01 12:11:28 -06:00
|
|
|
- name: Setup remote
|
2020-03-22 05:17:17 -06:00
|
|
|
run: |
|
2020-05-01 12:11:28 -06:00
|
|
|
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
|
2020-04-06 15:45:33 -06:00
|
|
|
test-local:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2020-03-22 05:17:17 -06:00
|
|
|
- name: Test local
|
2020-03-21 10:06:40 -06:00
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
playbook: playbook.yml
|
2020-04-06 15:53:57 -06:00
|
|
|
options: |
|
2020-05-01 12:11:28 -06:00
|
|
|
--inventory hosts
|
|
|
|
--limit local
|
2020-04-06 16:03:41 -06:00
|
|
|
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: |
|
2020-04-06 16:58:47 -06:00
|
|
|
[all]
|
2020-05-01 12:11:28 -06:00
|
|
|
localhost ansible_connection=local
|
2020-04-06 16:03:41 -06:00
|
|
|
options: |
|
2020-04-06 16:58:47 -06:00
|
|
|
-e key1=val1
|
|
|
|
-e key2=val2
|