Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request for vqfx_18.1R3 #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
install_prereqs: False
output_directory: output
enable_ssh_key_authentication: False
enable_ssh_key_authentication: True
disable_firewall: False
create_qemu_script: False
create_inventory: False
create_qemu_script: True
create_inventory: True
authentication_type: password
wrap_images: False
wrapper_image_name: ansible-network.img
Expand Down Expand Up @@ -39,6 +39,10 @@ checksum_to_platform_version:
platform: vqfx
build_version: 17.4R1
src_image_format: qcow2
cce6abf16e8d4fdcc178b0f6c8e7350929b1001a:
platform: vqfx
build_version: 18.1R3
src_image_format: qcow2
734f3400b6fb38ad0cea88eed2379729cf7b081c:
platform: vsrx
build_version: 18.1R1
Expand Down
6 changes: 6 additions & 0 deletions tasks/vqfx/18.1R3/bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Bootstrap VM
expect:
command: telnet localhost 8888
responses: "{{ expect_responses }}"
timeout: "{{ bootstrap_timeout }}"
8 changes: 8 additions & 0 deletions tasks/vqfx/18.1R3/configure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- junos_config:
src: "{{ image_config_path | default (platform + '/' + build_version + '/config.j2') }}"
vars:
ansible_user: root
ansible_ssh_pass: root123
ansible_port: 8022
ansible_network_os: junos
16 changes: 16 additions & 0 deletions templates/vqfx/18.1R3/config.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set system host-name {{ hostname }}
set system domain-name {{ domain_name }}

set system services ssh root-login deny
{% if authentication_type == 'pubkey' %}
{% for key in admin_user_ssh_keys %}
set system login user {{ admin_user }} class super-user authentication ssh-rsa "ssh-rsa {{ key }}"
{% endfor %}
{% for key in regular_user_ssh_keys %}
set system login user {{ regular_user }} class operator authentication ssh-rsa "ssh-rsa {{ key }}"
{% endfor %}
{% else %}
set system login user {{ admin_user }} class super-user authentication encrypted-password {{ admin_user_password | password_hash('sha512') }}
set system login user {{ regular_user }} class operator authentication encrypted-password {{ regular_user_password | password_hash('sha512') }}
{% endif %}
set interfaces em0 unit 0 family inet dhcp force-discover
10 changes: 10 additions & 0 deletions templates/vqfx/18.1R3/inventory.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[junos]
{{ hostname }}.{{ domain_name }}

[junos:vars]
ansible_network_os=junos
ansible_connection=local
ansible_host=localhost
ansible_port=8022
ansible_user={{ admin_user }}
ansible_ssh_pass={{ admin_user_password }}
3 changes: 3 additions & 0 deletions templates/vqfx/18.1R3/qemu.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

/usr/bin/qemu-system-x86_64 -nographic -m 6144 -smp 2 -enable-kvm -serial telnet:localhost:8888,server,nowait -monitor telnet:localhost:8889,server,nowait -netdev user,id=net0,hostfwd=tcp::8022-:22 -device e1000,netdev=net0 -netdev user,id=net1 -device e1000,netdev=net1 -netdev user,id=net2 -device e1000,netdev=net2 -drive file={{ image_name }}.qcow2,if=ide &
20 changes: 20 additions & 0 deletions vars/vqfx/18.1R3/vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
expect_responses:
'login: ': root
'root@:RE:0% ': cli
'root> ':
- config
- request dhcp client renew all
- "\x1d"
'root# ':
- set system root-authentication plain-text-password
- set system services ssh root-login allow
- set system services netconf ssh
- set interfaces em0 unit 0 family inet dhcp
- commit
- exit
'New password': root123
'Retype new password': root123
'telnet>': quit

qemu_command: "/usr/bin/qemu-system-x86_64 -nographic -m 2048 -enable-kvm -serial telnet:localhost:8888,server,nowait -monitor telnet:localhost:8889,server,nowait -netdev user,id=net0,hostfwd=tcp::8022-:22 -device e1000,netdev=net0 -drive file=cloned_image,if=ide"