From 5fea5ffa09d75c4197f038e64cb258a135b2b5a6 Mon Sep 17 00:00:00 2001
From: Mohammad Torkashvand <mohammad.torkashvand@geant.org>
Date: Tue, 17 Jun 2025 10:00:03 +0200
Subject: [PATCH] test
---
geant/gap_ansible/plugins/ansible.cfg | 6 ++++++
geant/gap_ansible/plugins/inventory.ini | 2 ++
geant/gap_ansible/plugins/netconf/junos.py | 10 ++++++++++
geant/gap_ansible/plugins/test-junos-private.yml | 16 ++++++++++++++++
4 files changed, 34 insertions(+)
create mode 100644 geant/gap_ansible/plugins/ansible.cfg
create mode 100644 geant/gap_ansible/plugins/inventory.ini
create mode 100644 geant/gap_ansible/plugins/test-junos-private.yml
diff --git a/geant/gap_ansible/plugins/ansible.cfg b/geant/gap_ansible/plugins/ansible.cfg
new file mode 100644
index 00000000..341647c0
--- /dev/null
+++ b/geant/gap_ansible/plugins/ansible.cfg
@@ -0,0 +1,6 @@
+[defaults]
+library = ./modules
+host_key_checking = False
+
+[netconf_connection]
+ssh_config = False
diff --git a/geant/gap_ansible/plugins/inventory.ini b/geant/gap_ansible/plugins/inventory.ini
new file mode 100644
index 00000000..34e78ba6
--- /dev/null
+++ b/geant/gap_ansible/plugins/inventory.ini
@@ -0,0 +1,2 @@
+[junos]
+my-junos ansible_host=62.40.119.4 ansible_user=gap-test ansible_password=concept_gear_ESSENTIAL93 ansible_connection=netconf ansible_network_os=juniper.junos.junos
diff --git a/geant/gap_ansible/plugins/netconf/junos.py b/geant/gap_ansible/plugins/netconf/junos.py
index 9c7986a8..f639edaa 100644
--- a/geant/gap_ansible/plugins/netconf/junos.py
+++ b/geant/gap_ansible/plugins/netconf/junos.py
@@ -1,3 +1,13 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+ANSIBLE_METADATA = {
+ "metadata_version": "1.1",
+ "status": ["preview"],
+ "supported_by": "community",
+ "supported_transports": ["netconf"],
+}
+
+
#
# (c) 2017 Red Hat Inc.
#
diff --git a/geant/gap_ansible/plugins/test-junos-private.yml b/geant/gap_ansible/plugins/test-junos-private.yml
new file mode 100644
index 00000000..c6987085
--- /dev/null
+++ b/geant/gap_ansible/plugins/test-junos-private.yml
@@ -0,0 +1,16 @@
+- name: Test private-candidate junos_config
+ hosts: junos
+ gather_facts: no
+ collections:
+ - geant.gap_ansible # <-- your locally installed collection
+
+ tasks:
+ - name: Open private candidate, push a change and commit
+ geant.gap_ansible.junos_config: # <-- module from geant.gap_ansible
+ lines:
+ - set system services ssh root-login allow
+ config_mode: private
+ register: result
+
+ - debug:
+ var: result
--
GitLab