-
Notifications
You must be signed in to change notification settings - Fork 0
/
Python_install
117 lines (82 loc) · 4.79 KB
/
Python_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Python 3.12 installation:
https://www.linuxtuto.com/how-to-install-python-3-12-on-ubuntu-22-04/
apt update
https://github.com/pypa/pip/issues/10939
I correct the time zone
sudo apt clean
sudo apt autoclean
sudo apt update
apt-get update && apt-get upgrade
Docker:
docker run -i -t <img id> /bin/bash
https://www.geeksforgeeks.org/how-to-install-configure-and-use-git-on-ubuntu/
docker exec -it 1381230e5edd /bin/bash
docker save -o <path for created tar file> <image name>
docker load -i <path to docker image tar file>
apt update
apt install docker.io -y
systemctl enable docker --now
docker --version
docker build -t myimg:latest .
example
|playbook.yml
|hosts
|-vars
|-templates
|-scripts
cd example/ docker run -it --rm -v $PWD:/playbooks juniper/pyez-ansible ansible-playbook -i hosts playbook.yml
podman installation:
https://podman.io/docs/installation
sudo apt-get update
sudo apt-get -y install podman
podman build -t ansible:v1.0.6 .
~/ansible_docker_test1/ansible-junos-stdlib/tests$ pwd
/home/labroot/ansible_docker_test1/ansible-junos-stdlib/tests
~/ansible_docker_test1/ansible-junos-stdlib/tests$ ls
ansible.cfg junos_jsnapy pb.juniper_junos_facts.yml pb.juniper_junos_ping.yml pb.juniper_junos_software_member.yml pb.juniper_junos_system.yml
ansible.log pb.juniper_junos_command.yml pb.juniper_junos_file.yml pb.juniper_junos_pmtud.yml pb.juniper_junos_software.yml pb.juniper_junos_table.yml
inventory pb.juniper_junos_config.yml pb.juniper_junos_jsnapy.yml pb.juniper_junos_rpc.yml pb.juniper_junos_srx_cluster.yml README.md
~/ansible_docker_test1/ansible-junos-stdlib/tests$ cat inventory
[junos]
local_connection_testcases ansible_host=x.x.x.x ansible_user=xyz ansible_pass=xyz ansible_port=22 ansible_connection=local ansible_command_timeout=300
#pyez_connection_testcases ansible_host=x.x.x.x ansible_user=xyz ansible_ssh_pass=xyz ansible_port=22 ansible_connection=juniper.device.pyez ansible_command_timeout=300
[all:vars]
#ansible_python_interpreter=/root/ansible_release_test1/venv/bin/python
~/ansible_docker_test1/ansible-junos-stdlib/tests$ cat ansible.cfg
[defaults]
hash_behaviour=merge
inventory = inventory
host_key_checking = False
log_path = ./ansible.log
[persistent_connection]
command_timeout = 300
~/ansible_docker_test1/ansible-junos-stdlib/tests$ podman run -it --rm -v $PWD:/project ansible:v1.0.6 ansible-playbook -i inventory pb.juniper_junos_table.yml
~/ansible_docker_test1/ansible-junos-stdlib/tests$ podman run -it --rm -v $PWD:/project ansible:v1.0.6 ansible-playbook -i inventory pb.juniper_junos_table.yml
Executing given commands
PLAY [Test juniper.device.table PyEZ table/view module.] ******************************************************************************************************************
TASK [Retrieve LLDP Neighbor Information Using PyEZ-included Table] *******************************************************************************************************
[WARNING]: Platform linux on host local_connection_testcases is using the discovered Python interpreter at /usr/local/bin/python3.12, but future installation of another
Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible-core/2.18/reference_appendices/interpreter_discovery.html for more
information.
ok: [local_connection_testcases]
TASK [Check TEST 1] *******************************************************************************************************************************************************
ok: [local_connection_testcases] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [Retrieve routes within 192.68.1/8] **********************************************************************************************************************************
ok: [local_connection_testcases]
TASK [Check TEST 2] *******************************************************************************************************************************************************
ok: [local_connection_testcases] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [Retrieve ethernet devices] ******************************************************************************************************************************************
ok: [local_connection_testcases]
TASK [Check TEST 3] *******************************************************************************************************************************************************
ok: [local_connection_testcases] => {
"changed": false,
"msg": "All assertions passed"
}
PLAY RECAP ****************************************************************************************************************************************************************
local_connection_testcases : ok=6 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0