-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Silvija Tovernic
committed
Sep 21, 2024
1 parent
323141c
commit 79ca092
Showing
1 changed file
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,12 +73,42 @@ jobs: | |
output_file: ansible/inventory.ini | ||
|
||
|
||
# - name: Template Ansible vars file | ||
# uses: cuchi/[email protected] | ||
# with: | ||
# template: ansible/templates/group_vars_all.yml.j2 | ||
# output_file: ansible/group_vars/all.yml | ||
- name: Template Ansible vars file | ||
uses: cuchi/[email protected] | ||
with: | ||
template: ansible/templates/group_vars_all.yml.j2 | ||
output_file: ansible/group_vars/all.yml | ||
|
||
- name: Install Ansible and add SSH key for connection | ||
run: | | ||
pip3 install ansible | ||
ansible-playbook --version | ||
eval "$(ssh-agent -s)" | ||
chmod 600 ansible/ansible_ssh_key | ||
ssh-add ansible_ssh_key | ||
- name: Test connection to air-gapped VM (needed populate known_hosts file) | ||
if: env.VM_ENV == 'air-gapped' # -> TODO: remove condition when devel env is no longer needed | ||
run: | | ||
ssh_command="ssh -o StrictHostKeyChecking=no azureadmin@${JUMPHOST_IP} 'ssh -o StrictHostKeyChecking=no azureadmin@${RUNNER_HOST_IP} whoami'" | ||
eval $ssh_command | ||
- name: Configure VM with ansible | ||
run: | | ||
cd ansible | ||
ansible-playbook configure-image-factory-vm.yml | ||
# # - name: Configure VM with ansible | ||
# # run: | | ||
# # cd ansible | ||
# # cat inventory.ini | ||
|
||
# # ssh-add ansible_ssh_key | ||
# # ssh_command="ssh -o StrictHostKeyChecking=no azureadmin@${JUMPHOST_IP} 'ssh -o StrictHostKeyChecking=no azureadmin@${RUNNER_HOST_IP} whoami'" | ||
# # eval $ssh_command | ||
# # ansible-playbook configure-image-factory-vm.yml | ||
|
||
# OLD | ||
# - name: Install Ansible | ||
# run: | | ||
# pip3 install ansible | ||
|
@@ -93,4 +123,4 @@ jobs: | |
# # ssh-add ansible_ssh_key | ||
# # ssh_command="ssh -o StrictHostKeyChecking=no azureadmin@${JUMPHOST_IP} 'ssh -o StrictHostKeyChecking=no azureadmin@${RUNNER_HOST_IP} whoami'" | ||
# # eval $ssh_command | ||
# # ansible-playbook configure-image-factory-vm.yml | ||
# # ansible-playbook configure-image-factory-vm.yml |