From 02acf4afd391ef86fba5d0cdddeb78205c9abae5 Mon Sep 17 00:00:00 2001 From: Benjamin Hays Date: Fri, 11 Oct 2024 21:46:56 -0400 Subject: [PATCH] add new gitea action for ansible deployment --- .gitea/workflows/ansible-deploy.yml | 46 +++++++++++++++++++++++++++++ Ansible/ansible.cfg | 7 +++++ ansible.cfg | 7 +++++ 3 files changed, 60 insertions(+) create mode 100644 .gitea/workflows/ansible-deploy.yml create mode 100644 Ansible/ansible.cfg create mode 100644 ansible.cfg diff --git a/.gitea/workflows/ansible-deploy.yml b/.gitea/workflows/ansible-deploy.yml new file mode 100644 index 0000000..54a5234 --- /dev/null +++ b/.gitea/workflows/ansible-deploy.yml @@ -0,0 +1,46 @@ +name: Ansible Deploy +on: + workflow_run: + workflows: ["Ansible Lint"] + types: + - completed +jobs: + deploy: + runs-on: ubuntu-latest + strategy: + matrix: + playbook: + - Ansible/openssh.yml + - Ansible/cloudflare-dns.yml + - Ansible/heartbeat.yml + - Ansible/debian.yml + steps: + - uses: actions/checkout@v4 + + - name: Install Ansible + run: | + apt update -y + apt install python3-pip -y + python3 -m pip install ansible + + #- name: Install Ansible Galaxy requirements + # run: | + # ansible-galaxy install -r requirements.yaml + + - name: Run playbook + uses: dawidd6/action-ansible-playbook@v2 + with: + # Required, playbook filepath + playbook: ${{ matrix.playbook }} + + # Optional, directory where playbooks live + directory: ./Ansible/ + + # 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 \ No newline at end of file diff --git a/Ansible/ansible.cfg b/Ansible/ansible.cfg new file mode 100644 index 0000000..a7e975a --- /dev/null +++ b/Ansible/ansible.cfg @@ -0,0 +1,7 @@ +[defaults] +nocows = 1 +host_key_checking = False +inventory = ./inventory.ini + +[privilege_escalation] +become_ask_pass = True diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..017a171 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,7 @@ +[defaults] +nocows = 1 +host_key_checking = False +inventory = ./Ansible/inventory.ini + +[privilege_escalation] +become_ask_pass = True