1
0
Fork 0
mirror of https://github.com/dawidd6/action-ansible-playbook.git synced 2024-11-26 02:11:30 +00:00
action-ansible-playbook/.github/workflows/test.yml

79 lines
2 KiB
YAML
Raw Normal View History

2020-03-21 16:06:40 +00:00
name: Test Action
2020-08-30 10:06:25 +00:00
on:
push:
branches:
- master
pull_request:
2020-03-21 16:06:40 +00:00
jobs:
2020-04-06 21:45:33 +00:00
test-remote:
2020-03-21 16:06:40 +00:00
runs-on: ubuntu-latest
steps:
2020-03-22 11:17:17 +00:00
- name: Checkout code
2020-03-21 16:06:40 +00:00
uses: actions/checkout@v2
2020-05-01 18:11:28 +00:00
- name: Setup remote
2020-03-22 11:17:17 +00:00
run: |
2020-05-01 18:11:28 +00: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
2020-05-14 18:20:43 +00:00
directory: test
2020-05-01 18:11:28 +00:00
key: ${{secrets.SSH_PRIVATE_KEY}}
inventory: |
[all]
localhost
2020-05-03 10:45:56 +00:00
options: |
-e docker_image=docker_url
2020-09-04 08:16:36 +00:00
-e docker_username=user
-e docker_password=pass
2020-05-03 10:45:56 +00:00
-e db_name=db_name
-e db_user=db_user
-e db_pass=db_pass
2020-04-06 21:45:33 +00:00
test-local:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
2020-03-22 11:17:17 +00:00
- name: Test local
2020-03-21 16:06:40 +00:00
uses: ./
with:
playbook: playbook.yml
requirements: requirements.yml
2020-04-06 21:53:57 +00:00
options: |
2020-05-01 18:11:28 +00:00
--inventory hosts
--limit local
2020-04-06 22:03:41 +00: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 22:58:47 +00:00
[all]
2020-05-01 18:11:28 +00:00
localhost ansible_connection=local
2020-04-06 22:03:41 +00:00
options: |
2020-04-06 22:58:47 +00:00
-e key1=val1
-e key2=val2
- name: Test local
uses: ./
with:
playbook: playbook.yml
vault_password: test
inventory: |
[all]
localhost ansible_connection=local