Skip to content

Commit

Permalink
Merge pull request #36 from andreygubarev/fix-local-ssh
Browse files Browse the repository at this point in the history
Fix user network mode, update default local port to unprivileged `2222`
  • Loading branch information
andreygubarev authored Mar 3, 2024
2 parents 802c93a + bbbddb4 commit c9bf1a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Supported network modes:
- `user` - QEMU's user networking mode
- `vmnet-shared` - QEMU's `vmnet-shared` networking mode (MacOS only)


Supported disk types:

- `virtio` - QEMU's virtio disk type
Expand Down Expand Up @@ -82,7 +81,7 @@ platforms:

network_mode: vmnet-shared # optional, default is user
network_extra_args: "" # optional, only used when network_mode: user
network_ssh_port: 2222 # optional, default is 22
network_ssh_port: 2222 # optional, default is 2222
network_ssh_user: ansible # optional, default is ansible

vm_cpus: 1 # optional, default is 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- name: Wait for SSH to become available
ansible.builtin.wait_for_connection:
delay: 5
timeout: 300
timeout: 60

- name: Gather facts
ansible.builtin.setup:
4 changes: 2 additions & 2 deletions molecule_qemu/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
"network_mode": "{{ item.network_mode | default(qemu_network_mode) }}",
"network_mac": "{{ '52:54:00' | community.general.random_mac() | regex_replace('(^|:)0([0-9A-Fa-f])', '\\1\\2') }}",

"network_ssh_port": "{{ item.network_ssh_port | default(22) }}",
"network_ssh_port": "{{ item.network_ssh_port | default(2222) }}",
"network_ssh_user": "{{ item.network_ssh_user | default('ansible') }}",

"vm_extra_args": "{{ item.vm_extra_args | default(qemu_extra_args) }}",
"vm_cpus": "{{ item.vm_cpus | default(qemu_vm_cpus) }}",
"vm_memory": "{{ item.vm_memory | default(qemu_vm_memory) }}",
"vm_disk": "{{ item.vm_disk | default(qemu_vm_disk) }}",

"disk_type": "{{ item.disk_type | default(qemu_disk_type) }}",

"bios_type": "{{ item.bios_type | default(qemu_bios_type) }}",
Expand Down

0 comments on commit c9bf1a1

Please sign in to comment.