generated from CC/VMServiceTemplate
ci/cd on push test
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m31s
Some checks failed
Deploy VM and App / terraform-ansible-deploy (push) Failing after 1m31s
This commit is contained in:
@@ -23,11 +23,12 @@ jobs:
|
|||||||
- name: Check files & Select tfvars
|
- name: Check files & Select tfvars
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
pwd
|
|
||||||
mkdir -p ansible/inventory
|
mkdir -p ansible/inventory
|
||||||
|
rm ansible/inventory/inventory.yml
|
||||||
|
|
||||||
cd terraform
|
cd terraform
|
||||||
|
rm vm_data.yml
|
||||||
cp "${{ inputs.tfvars_file || 'single.tfvars.example' }}" terraform.tfvars
|
cp "${{ inputs.tfvars_file || 'single.tfvars.example' }}" terraform.tfvars
|
||||||
ls
|
|
||||||
|
|
||||||
- uses: hashicorp/setup-terraform@v4
|
- uses: hashicorp/setup-terraform@v4
|
||||||
|
|
||||||
@@ -42,20 +43,6 @@ jobs:
|
|||||||
run: terraform apply -auto-approve
|
run: terraform apply -auto-approve
|
||||||
working-directory: "terraform"
|
working-directory: "terraform"
|
||||||
|
|
||||||
- name: Configure Git
|
|
||||||
run: |
|
|
||||||
git config user.name "git-bot"
|
|
||||||
git config user.email "got-bot@text.com"
|
|
||||||
|
|
||||||
- name: Commit and push to Gitea
|
|
||||||
run: |
|
|
||||||
git remote set-url origin https://$GITEA_USERNAME:${{ secrets.GIT_BOT_TOKEN }}@tea.charcarservices.uk/CC/N8N.git
|
|
||||||
git add terraform/vm_data.yml ansible/inventory/inventory.yml
|
|
||||||
git diff --cached --quiet || git commit -m "chore: update terraform outputs"
|
|
||||||
git push origin HEAD:main
|
|
||||||
env:
|
|
||||||
GITEA_USERNAME: git-bot # or your bot account
|
|
||||||
|
|
||||||
- name: Install Ansible
|
- name: Install Ansible
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -69,12 +56,24 @@ jobs:
|
|||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n" > ~/.ssh/config
|
echo -e "Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n" > ~/.ssh/config
|
||||||
|
|
||||||
- name: Setup Ansible Directories
|
- name: Ansible Inventory YML
|
||||||
run: |
|
run: |
|
||||||
pwd
|
|
||||||
cat ansible/inventory/inventory.yml
|
cat ansible/inventory/inventory.yml
|
||||||
ls -r
|
|
||||||
|
|
||||||
- name: Run playbook
|
- name: Run playbook
|
||||||
run: |
|
run: |
|
||||||
ansible-playbook ansible/playbooks/docker_copy.yml -i ansible/inventory/inventory.yml -u cloud --private-key ~/.ssh/id_rsa
|
ansible-playbook ansible/playbooks/docker_copy.yml -i ansible/inventory/inventory.yml -u cloud --private-key ~/.ssh/id_rsa
|
||||||
|
|
||||||
|
- name: Configure Git
|
||||||
|
run: |
|
||||||
|
git config user.name "git-bot"
|
||||||
|
git config user.email "got-bot@text.com"
|
||||||
|
|
||||||
|
- name: Commit and push to Gitea
|
||||||
|
run: |
|
||||||
|
git remote set-url origin https://$GITEA_USERNAME:${{ secrets.GIT_BOT_TOKEN }}@tea.charcarservices.uk/CC/N8N.git
|
||||||
|
git add terraform/vm_data.yml ansible/inventory/inventory.yml
|
||||||
|
git diff --cached --quiet || git commit -m "chore: update terraform outputs"
|
||||||
|
git push origin HEAD:main
|
||||||
|
env:
|
||||||
|
GITEA_USERNAME: git-bot # or your bot account
|
||||||
|
|||||||
Reference in New Issue
Block a user