Skip to content

Commit

Permalink
test ssh command
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvija Tovernic committed Sep 20, 2024
1 parent bfa4651 commit 1cfa165
Showing 1 changed file with 39 additions and 27 deletions.
66 changes: 39 additions & 27 deletions .github/workflows/ansible-configure-if-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,50 @@ jobs:
template: ansible/templates/ansible_ssh_key.j2
output_file: ansible/ansible_ssh_key

- 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 inventory
uses: cuchi/[email protected]
with:
template: ansible/templates/inventory.ini.j2
output_file: ansible/inventory.ini

- name: Template Ansible private key file
uses: cuchi/[email protected]
with:
template: ansible/templates/ansible_ssh_key.j2
output_file: ansible/ansible_ssh_key

- name: Install Ansible
run: |
pip3 install ansible
- name: Print Ansible Version
run: ansible-playbook --version

- name: Configure VM with ansible
run: |
cd ansible
eval "$(ssh-agent -s)"
chmod 600 ansible_ssh_key
ssh-add ansible_ssh_key
cat inventory.ini
ansible-playbook -vvv configure-image-factory-vm.yml
ssh-add -l
ssh -o ForwardAgent=yes -o [email protected] -o StrictHostKeyChecking=no [email protected] 'hostname'
# - 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 inventory
# uses: cuchi/[email protected]
# with:
# template: ansible/templates/inventory.ini.j2
# output_file: ansible/inventory.ini

# - name: Template Ansible private key file
# uses: cuchi/[email protected]
# with:
# template: ansible/templates/ansible_ssh_key.j2
# output_file: ansible/ansible_ssh_key

# - name: Install Ansible
# run: |
# pip3 install ansible

# - name: Print Ansible Version
# run: ansible-playbook --version

# - name: Configure VM with ansible
# run: |
# cd ansible
# eval "$(ssh-agent -s)"
# chmod 600 ansible_ssh_key
# ssh-add ansible_ssh_key
# cat inventory.ini
# ansible-playbook -vvv configure-image-factory-vm.yml

# Test comment to trigger build #

0 comments on commit 1cfa165

Please sign in to comment.