From 2884777ecc70a307f2536df537350be17d01f7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Polg=C3=A1r?= <37218286+2colours@users.noreply.github.com> Date: Thu, 29 Feb 2024 02:09:45 +0100 Subject: [PATCH] Adding ansible action --- .github/workflows/main.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a41c61..97b2c3a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,3 +11,21 @@ jobs: - uses: actions/checkout@v4 - name: Install ansible control node run: sudo apt install ansible-core + - name: Add hosts to /etc/hosts + run: | + sudo echo "{{ secrets.SERVICE_HOST }} vps.contabo" >> /etc/hosts + - uses: dawidd6/action-ansible-playbook@v2.8.0 + with: + # Ansible playbook filepath + playbook: deploy-playbook.yml + # Ansible Galaxy requirements filepath + requirements: requirements.yml + # SSH private key used to connect to the host + key: '{{ secrets.HOST_PRIVATE_KEY }}' + # Custom content to write into hosts + inventory: | + [bot_host] + vps.contabo + # Contents of SSH known_hosts file + known_hosts: | + vps.contabo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC89CXXwoQmHZBJXMLAl9GPrQaGuF2PQ2tfTTqiPIvelxbAG3QJ+biXkSObrCE/At6hfAsNUMpzZw8MGwFM1VRempk+Hxpqbzevexb4HtX1Cv1tGRU5KbwbMhyewUAlyr6YQkLfTe4W9vphbJNIcmejDZVyPDH4n60i674duNgexwrbrC33GZkR07QgcSLy4wv8nSGdN5JRJ0hvC12LbXUIWKJYIyGjnziIONhQNSV/C8S53S78dALFwK04+qmNqdsgM6ML9gT7x0iapdCaG8NESqhvtjICC857Xbb+KJMkQbjPdP1XpBILqYP8vRLYnL4QOfkZh7kIEIR+JrFA9lZRmvbQtH2U+LSCsrTA7RNevPb3m1rvdAqOvxWQqRTzbQTb7SapZTWd0XX/hL2HBvCyOHisit9YPD4ksCyux+MrS9KyDiFxjONZGu4fLib+yC6sW9NiTDDWNfxglsjWL7gFUCQlvH2myBtEaFom1F2jHSHRaYRXOxyBotE1LRRHdd8qhQ9z5ZTVGaPoKWO8iVm5tbfyClBZrE+Vas9QRWlSq+sY4aI1JeuDIMyZgmZCabEDdShZe6gEZMRnYB8xZQw5m+d70anUjnSMNQAI2l9Hbl7M30nSmnuk7p8wyZ4LRiYoF7DYIyVv+/BqftVf6j2Sse4syRIV3qDzGeiiq+XBSQ==