Compare commits

...

13 Commits

Author SHA1 Message Date
8784058874 Merge pull request 'Add an Gitea Action for Deploying Ansible Playbooks' (#1) from ansible-deploy-action into main
All checks were successful
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Successful in 1m5s
Ansible Deploy / deploy (Ansible/debian.yml) (push) Successful in 1m12s
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Successful in 1m0s
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Successful in 1m19s
Ansible Lint / build (push) Successful in 1m10s
Reviewed-on: #1
2024-10-13 01:42:00 +00:00
55dcb55854 Revert "revert to pip version and try new caching method"
All checks were successful
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Successful in 1m6s
Ansible Deploy / deploy (Ansible/debian.yml) (push) Successful in 1m18s
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Successful in 59s
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Successful in 1m17s
Ansible Lint / build (push) Successful in 1m10s
This reverts commit 5b0d0aa13e.
2024-10-12 21:32:25 -04:00
5b0d0aa13e revert to pip version and try new caching method
Some checks failed
Ansible Deploy / build (push) Failing after 5s
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Has been skipped
Ansible Deploy / deploy (Ansible/debian.yml) (push) Has been skipped
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Has been skipped
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Has been skipped
Ansible Lint / build (push) Successful in 1m12s
2024-10-12 21:29:49 -04:00
57e600f3d6 correct version to fix errors
All checks were successful
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Successful in 1m9s
Ansible Deploy / deploy (Ansible/debian.yml) (push) Successful in 1m9s
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Successful in 1m0s
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Successful in 1m16s
Ansible Lint / build (push) Successful in 1m11s
2024-10-12 19:35:52 -04:00
1c68f9d2e1 fix runner error with openssh playbook 2024-10-12 19:30:39 -04:00
43d2e66b6a add caching and version control for pip packages
Some checks failed
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Failing after 41s
Ansible Deploy / deploy (Ansible/debian.yml) (push) Failing after 14s
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Failing after 14s
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Failing after 15s
Ansible Lint / build (push) Successful in 1m9s
2024-10-12 19:28:23 -04:00
97d06dc4e1 seventh attempt
Some checks failed
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Successful in 1m4s
Ansible Deploy / deploy (Ansible/debian.yml) (push) Successful in 1m28s
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Successful in 1m0s
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Failing after 1m17s
Ansible Lint / build (push) Successful in 1m9s
2024-10-12 19:21:54 -04:00
39f57473f6 sixth attempt
Some checks failed
Ansible Deploy / deploy (Ansible/debian.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Has been cancelled
Ansible Lint / build (push) Successful in 1m13s
2024-10-12 19:12:11 -04:00
bd891445b7 fifth attempt
Some checks failed
Ansible Deploy / deploy (Ansible/debian.yml) (push) Waiting to run
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Waiting to run
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Waiting to run
Ansible Lint / build (push) Waiting to run
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Has been cancelled
2024-10-12 19:06:44 -04:00
919386cc3a fourth attempt
Some checks failed
Ansible Deploy / deploy (Ansible/debian.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Has been cancelled
Ansible Lint / build (push) Successful in 1m10s
2024-10-12 19:01:36 -04:00
c1e2aa4551 third attempt
Some checks failed
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Failing after 4s
Ansible Deploy / deploy (Ansible/debian.yml) (push) Failing after 4s
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Failing after 4s
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Failing after 4s
Ansible Lint / build (push) Has been cancelled
2024-10-12 19:00:35 -04:00
2b4418bdf1 second attempt at fixing deploy script
Some checks failed
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Failing after 5s
Ansible Deploy / deploy (Ansible/debian.yml) (push) Failing after 4s
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Failing after 3s
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Failing after 3s
Ansible Lint / build (push) Successful in 1m11s
2024-10-12 18:56:37 -04:00
e620667ee1 Revert previous error
Some checks failed
Ansible Deploy / deploy (Ansible/debian.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/heartbeat.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/openssh.yml) (push) Has been cancelled
Ansible Deploy / deploy (Ansible/cloudflare-dns.yml) (push) Has been cancelled
Ansible Lint / build (push) Successful in 1m12s
2024-10-12 18:41:22 -04:00
6 changed files with 34 additions and 12 deletions

View File

@ -3,6 +3,9 @@ on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
env:
RUNNER_TOOL_CACHE: /toolcache
ANSIBLE_VERSION: "8.7.0"
strategy:
matrix:
playbook:
@ -11,7 +14,29 @@ jobs:
- Ansible/heartbeat.yml
- Ansible/debian.yml
steps:
- uses: actions/checkout@v3
- name: Copy SSH Key
run: |
mkdir ~/.ssh/
echo "Host *" > ~/.ssh/config
echo " StrictHostKeyChecking no" >> ~/.ssh/config
echo '${{secrets.SSH_PRIVATE_KEY}}' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- uses: actions/checkout@v3
with:
submodules: recursive
- name: "Cache python packages"
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ env.ANSIBLE_VERSION }}
- name: Install Ansible
run: |
apt update -y
apt install python3-pip -y
python3 -m pip install ansible==${{ env.ANSIBLE_VERSION }}
#- name: Install Ansible Galaxy requirements
# run: |
@ -20,17 +45,13 @@ jobs:
- name: Run playbook
uses: dawidd6/action-ansible-playbook@v2
with:
# Required, playbook filepath
playbook: ${{ matrix.playbook }}
# Optional, directory where playbooks live
directory: ./
# Optional, SSH private key
key: ${{secrets.SSH_PRIVATE_KEY}}
vault_password: ${{secrets.VAULT_PASSWORD}}
# Optional, galaxy requirements filepath
# requirements: requirements.yaml
options: |
--inventory Ansible/inventory.ini
--inventory Ansible/inventory.ini
--extra-vars "@Ansible/homelab-vault/secrets.yml"

View File

@ -4,4 +4,4 @@ host_key_checking = False
inventory = ./inventory.ini
[privilege_escalation]
become_ask_pass = True
#become_ask_pass = True

@ -1 +1 @@
Subproject commit 6b8679decc51b10d3a028993d11892be763e0eb7
Subproject commit e95c8ff2aef2e919e5bf0fc8133aaec69ea8dc08

View File

@ -31,7 +31,7 @@
ansible.builtin.copy:
owner: bhays
mode: "0600"
src: ~/.ssh/authorized_keys
src: ../Configs/authorized_keys
dest: /home/bhays/.ssh/authorized_keys
- name: Copy secure login banner
ansible.builtin.copy:

1
Configs/authorized_keys Normal file
View File

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClhOkA+6Wj+HmJb32wqDXAksOr7mhRovSQAt/6PNem/q0R+JA4qyYpStPAkLTHmUJhUPYlyeVPJyaGxRyE96SSrLxy2tGvfch1D2XkrYTZoyEYc0QNg2PfgCkAZofDSPrErzcAzT9XBJ+/9rga8IBZ3F8Nm1gl401y0Ckchdne/i+npVurimpSMJbIwjIsg7ij1gWLL4idIftW7IDloWedI1O2XdBW9VDpA/zq46tBwt3Jeelv5oDCup6g9wLQwBpmegWXYS+p47vGzIYp2qBI2D/opOZCUaBNT81G80E9H0fsNDi8xCBfVj7zgBQHzviqGFqeKjU39FbLZlkeISMX rsa-key-20231020

View File

@ -4,4 +4,4 @@ host_key_checking = False
inventory = ./Ansible/inventory.ini
[privilege_escalation]
become_ask_pass = True
#become_ask_pass = True